-
Please wait while processing the log data...
+ Loading Logs. Please wait...
diff --git a/src/websrc/myesp.js b/src/websrc/myesp.js
index 9f5d3af55..4d6277abc 100644
--- a/src/websrc/myesp.js
+++ b/src/websrc/myesp.js
@@ -95,25 +95,30 @@ function listntp() {
deviceTime();
}
-function revcommit() {
- document.getElementById("jsonholder").innerText = JSON.stringify(config, null, 2);
- $("#revcommit").modal("show");
+function home() {
+ window.location = '/';
}
-function uncommited() {
+function restart_alert() {
$("#commit").fadeOut(200, function () {
$(this).css("background", "gold").fadeIn(1000);
});
- document.getElementById("commit").innerHTML = "
Settings have changed. Click here to review and save.
";
+ document.getElementById("commit").innerHTML = "Settings have changed. It's recommended to reboot the system. Click here to restart.
";
+
$("#commit").click(function () {
- revcommit();
+ $("#reboot").modal("show");
return false;
});
}
-function custom_uncommited() {
- document.getElementById("jsonholder2").innerText = JSON.stringify(custom_config.settings, null, 2);
- $("#custom_revcommit").modal("show");
+function saveconfig() {
+ websock.send(JSON.stringify(config));
+ restart_alert();
+}
+
+function custom_saveconfig() {
+ websock.send(JSON.stringify(custom_config));
+ restart_alert();
}
function saventp() {
@@ -125,14 +130,13 @@ function saventp() {
config.ntp.enabled = true;
}
- uncommited();
+ saveconfig();
}
function forcentp() {
websock.send("{\"command\":\"forcentp\"}");
}
-
function savegeneral() {
var a = document.getElementById("adminpwd").value;
if (a === null || a === "") {
@@ -147,7 +151,7 @@ function savegeneral() {
config.general.serial = true;
}
- uncommited();
+ saveconfig();
}
function savemqtt() {
@@ -167,7 +171,7 @@ function savemqtt() {
config.mqtt.user = document.getElementById("mqttuser").value;
config.mqtt.password = document.getElementById("mqttpwd").value;
- uncommited();
+ saveconfig();
}
function savenetwork() {
@@ -186,7 +190,7 @@ function savenetwork() {
config.network.wmode = wmode;
config.network.password = document.getElementById("wifipass").value;
- uncommited();
+ saveconfig();
}
var formData = new FormData();
@@ -199,8 +203,8 @@ function inProgress(callback) {
var i = 0;
var prg = setInterval(function () {
$(".progress-bar").css("width", i + "%").attr("aria-valuenow", i).html(i + "%");
- i++;
- if (i === 101) {
+ i = i + 5;
+ if (i === 105) {
clearInterval(prg);
var a = document.createElement("a");
a.href = "http://" + config.general.hostname + ".local";
@@ -221,9 +225,6 @@ function inProgress(callback) {
contentType: false
});
break;
- case "commit":
- websock.send(JSON.stringify(config));
- break;
case "destroy":
websock.send("{\"command\":\"destroy\"}");
break;
@@ -238,10 +239,6 @@ function inProgress(callback) {
}).hide().fadeIn();
}
-function commit() {
- inProgress("commit");
-}
-
function handleSTA() {
document.getElementById("scanb").style.display = "block";
document.getElementById("hidessid").style.display = "block";
@@ -498,10 +495,10 @@ function restoreSet() {
return;
}
if (json.command === "configfile") {
- var x = confirm("File seems to be valid, do you wish to continue?");
+ var x = confirm("System Config file seems to be valid, do you wish to continue?");
if (x) {
config = json;
- uncommited();
+ saveconfig();
}
}
};
@@ -526,10 +523,10 @@ function restoreCustomSet() {
return;
}
if (json.command === "custom_configfile") {
- var x = confirm("File seems to be valid, do you wish to continue?");
+ var x = confirm("Custom Config file seems to be valid, do you wish to continue?");
if (x) {
custom_config = json;
- custom_uncommited();
+ custom_saveconfig();
}
}
};
@@ -677,10 +674,6 @@ function initMQTTLogTable() {
});
}
-function restartESP() {
- inProgress("restart");
-}
-
var nextIsNotJson = false;
function socketMessageListener(evt) {
diff --git a/tools/wsemulator/wserver.js b/tools/wsemulator/wserver.js
index 4aaa0147a..a99f2878d 100644
--- a/tools/wsemulator/wserver.js
+++ b/tools/wsemulator/wserver.js
@@ -51,7 +51,7 @@ var eventlog = {
"command": "eventlist",
"page": 1,
"haspages": 1,
- "list":[
+ "list": [
"{\"type\":\"WARN\",\"src\":\"system\",\"desc\":\"test data\",\"data\":\"Record #1\",\"time\": 1563371160}",
"{\"type\":\"WARN\",\"src\":\"system\",\"desc\":\"test data\",\"data\":\"Record #2\",\"time\":0}",
"{\"type\":\"INFO\",\"src\":\"system\",\"desc\":\"System booted\",\"data\":\"\",\"time\":1568660479}",
@@ -147,7 +147,7 @@ function sendStatus() {
function sendCustomStatus() {
var stats = {
"command": "custom_status",
- "version": "1.9.0",
+ "version": "1.9.1",
"customname": "EMS-ESP",
"appurl": "https://github.com/proddy/EMS-ESP",
"updateurl": "https://api.github.com/repos/proddy/EMS-ESP/releases/latest",
@@ -214,7 +214,7 @@ wss.on('connection', function connection(ws) {
console.log("[INFO] Got Command: " + obj.command);
switch (obj.command) {
case "configfile":
- console.log("[INFO] New system settings file received");
+ console.log("[INFO] New system config received");
configfile = obj;
break;
case "custom_configfile":
@@ -269,7 +269,7 @@ wss.on('connection', function connection(ws) {
console.log("[INFO] getting ntp time");
break;
default:
- console.log("[WARN] Unknown command ");
+ console.log("[WARN] Unknown command");
break;
}
});