improved GUI password handling

fix serial console uptime
fix #384 round total values
This commit is contained in:
lumapu 2022-11-04 12:29:04 +01:00
parent 6a6d522d3b
commit 74f4a114cd
8 changed files with 19 additions and 14 deletions

View file

@ -12,7 +12,7 @@
<div class="pad">
<form action="/login" method="post">
<h2>AhoyDTU</h2>
<input type="password" name="pwd" value="">
<input type="password" name="pwd" value="" autofocus>
<input type="submit" name="login" value="login" class="btn">
</form>
</div>

View file

@ -307,6 +307,9 @@
function parseSys(obj) {
for(var i of [["device", "device_name"], ["ssid", "ssid"]])
document.getElementsByName(i[0])[0].value = obj[i[1]];
var e = document.getElementsByName("adminpwd")[0];
if(!obj["pwd_set"])
e.value = "";
parseVersion(obj);
}

View file

@ -53,7 +53,7 @@
}
}
getAjax("/api" + window.location.pathname, parse);
getAjax("/api/html" + window.location.pathname, parse);
</script>
</body>
</html>

View file

@ -113,7 +113,7 @@
// total
if(obj.length > 1) {
for(var j = 0; j < root.ch0_fld_names.length; j++) {
var val = total[j];
var val = Math.round(total[j] * 100) / 100;
if(val > 0) {
var sub = div(["subgrp"]);
sub.appendChild(span(val + " " + span(root["ch0_fld_units"][j], ["unit"]).innerHTML, ["value"]));