More work on webserver
This commit is contained in:
@@ -44,15 +44,6 @@
|
||||
"description": "Log level at the USB port.\nHigher level means more output.",
|
||||
"category": "System"
|
||||
},
|
||||
{
|
||||
"name": "adminPassword",
|
||||
"label": "Admin Password",
|
||||
"type": "password",
|
||||
"default": "esp32admin",
|
||||
"check": "checkAdminPass",
|
||||
"description": "Set the password for configuration modifications and firmware upload",
|
||||
"category": "System"
|
||||
},
|
||||
{
|
||||
"name": "useAdminPass",
|
||||
"label": "Use Admin-Pass",
|
||||
@@ -61,6 +52,18 @@
|
||||
"description": "A password for configuration modifications is required.",
|
||||
"category": "System"
|
||||
},
|
||||
{
|
||||
"name": "adminPassword",
|
||||
"label": "Admin Password",
|
||||
"type": "password",
|
||||
"default": "esp32admin",
|
||||
"check": "checkAdminPass",
|
||||
"description": "Set the password for configuration modifications and firmware upload",
|
||||
"category": "System",
|
||||
"condition": {
|
||||
"useAdminPass": "true"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "instDesc1",
|
||||
"label": "Description 1",
|
||||
|
||||
@@ -33,6 +33,9 @@ if (!window.isSecureContext) {
|
||||
|
||||
<div id="statusPage" class="tabPage">
|
||||
<div id="statusPageContent">
|
||||
<div class="row hidden">
|
||||
<span class="value" id="warnAdminPass">OK</span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span class="label">Firmware</span>
|
||||
<span class="value" id="version">---</span>
|
||||
|
||||
14
web/index.js
14
web/index.js
@@ -68,10 +68,11 @@
|
||||
}
|
||||
function update() {
|
||||
let now = (new Date()).getTime();
|
||||
let is_connected = (lastUpdate + 3 * updateInterval) > now;
|
||||
let ce = document.getElementById('connected');
|
||||
let cl = document.getElementById('conn_label');
|
||||
if (ce) {
|
||||
if ((lastUpdate + 3 * updateInterval) > now) {
|
||||
if (is_connected) {
|
||||
ce.classList.add('ok');
|
||||
cl.textContent = 'connected';
|
||||
}
|
||||
@@ -108,10 +109,12 @@
|
||||
resetForm();
|
||||
}
|
||||
})
|
||||
// check if any dynamic list needs update
|
||||
for (let l in dynLists) {
|
||||
if (loadDynList(l)) {
|
||||
updateDynLists(l, configDefinitions)
|
||||
if (is_connected) {
|
||||
// check if any dynamic list needs update
|
||||
for (let l in dynLists) {
|
||||
if (loadDynList(l)) {
|
||||
updateDynLists(l, configDefinitions)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -942,6 +945,7 @@
|
||||
forEl('#adminPassInput', function (el) {
|
||||
el.value = '';
|
||||
});
|
||||
alert("Admin password not cached anymore.");
|
||||
}
|
||||
function ensurePass() {
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
Reference in New Issue
Block a user