add button to force fetch NTP time

This commit is contained in:
Paul
2019-08-27 22:49:00 +02:00
parent 6274990353
commit ab73ea1c73
7 changed files with 38 additions and 10 deletions

View File

@@ -51,7 +51,7 @@ function browserTime() {
}
function deviceTime() {
var t = new Date(0); // The 0 there is the key, which sets the date to the epoch,
var t = new Date(0); // The 0 there is the key, which sets the date to the epoch
var devTime = Math.floor(utcSeconds + ((t.getTimezoneOffset() * 60) * -1));
t.setUTCSeconds(devTime);
document.getElementById("utc").innerHTML = t.toUTCString().slice(0, -3);
@@ -75,6 +75,9 @@ function listntp() {
if (config.ntp.enabled) {
$("input[name=\"ntpenabled\"][value=\"1\"]").prop("checked", true);
handleNTPON();
} else {
handleNTPOFF();
}
browserTime();
@@ -114,6 +117,11 @@ function saventp() {
uncommited();
}
function forcentp() {
websock.send("{\"command\":\"forcentp\"}");
}
function savegeneral() {
var a = document.getElementById("adminpwd").value;
if (a === null || a === "") {
@@ -238,6 +246,14 @@ function handleAP() {
document.getElementById("inputtohide").style.display = "block";
}
function handleNTPON() {
document.getElementById("forcentp").style.display = "block";
}
function handleNTPOFF() {
document.getElementById("forcentp").style.display = "none";
}
function listnetwork() {
document.getElementById("inputtohide").value = config.network.ssid;
document.getElementById("wifipass").value = config.network.password;