1
mirror of https://github.com/rvdbreemen/OTGW-firmware synced 2024-11-16 04:33:49 +01:00

fixed updating otmonitor values & style fixes

This commit is contained in:
Robert van den Breemen 2021-01-10 17:02:58 +01:00
parent 665fc995f0
commit 92495fcb40
2 changed files with 9 additions and 4 deletions

View File

@ -241,9 +241,13 @@ input {
}
/* OTmonitor */
.otmonrow: {
background: lightblue;
}
.otmoncolumn1 {
float: left;
width: 270px;
}
.otmoncolumn2 {
float: left;
@ -261,6 +265,7 @@ input {
content: "";
display: table;
clear: both;
background: lightblue;
}
/* define tag selectors () -------------------------------------------------- */

View File

@ -56,7 +56,7 @@
needReload = false;
refreshDevInfo();
refreshOTmonitor();
tid = setInterval(function(){refreshOTmonitor(); }, 2000); //delay is in milliseconds
tid = setInterval(function(){refreshOTmonitor(); }, 1000); //delay is in milliseconds
document.getElementById("displayMainPage").style.display = "block";
document.getElementById("displaySettingsPage").style.display = "none";
@ -168,17 +168,17 @@
{ // if element does not exists yet, then build page
var rowDiv = document.createElement("div");
rowDiv.setAttribute("class", "otmonrow");
rowDiv.setAttribute("id", "otmon_"+data[i].name);
//rowDiv.setAttribute("id", "otmon_"+data[i].name);
rowDiv.style.background = "lightblue";
//--- field Name ---
var fldDiv = document.createElement("div");
fldDiv.setAttribute("class", "otmoncolumn1")
fldDiv.textContent = translateToHuman(data[i].name);
fldDiv.setAttribute("id", "otmon_"+data[i].name);
rowDiv.appendChild(fldDiv);
//--- Value ---
var valDiv = document.createElement("div");
valDiv.setAttribute("class", "otmoncolumn2")
valDiv.setAttribute("id", "otmon_"+data[i].name);
valDiv.textContent = data[i].value;
rowDiv.appendChild(valDiv);
//--- Unit ---
@ -190,7 +190,7 @@
}
else
{ //if the element exists, then update the value
document.getElementById("otmon_"+data[i].name).value = data[i].value;
document.getElementById("otmon_"+data[i].name).textContent = data[i].value;
}
}