mirror of https://github.com/aredn/aredn.git
Minor changes to improve browser compatibility.
This commit is contained in:
parent
ac664f43a8
commit
6883725ca9
|
@ -194,10 +194,13 @@ function html.wait_for_reboot(delay, countdown, address)
|
|||
const div = document.getElementById("countdown");
|
||||
if (div) {
|
||||
let t = Math.round(]] .. countdown .. [[ - (Date.now() - start) / 1000);
|
||||
div.innerHTML = t <= 0 ? "" : new Date(1000 * t).toISOString().substring(14, 19);
|
||||
const cdp = document.getElementById("cdProgress");
|
||||
div.innerHTML = t <= 0 ? "..." : new Date(1000 * t).toISOString().substring(14, 19);
|
||||
const cdp = document.getElementById("cdprogress");
|
||||
if (cdp) {
|
||||
cdp.value = cdp.max - t;
|
||||
if (t < 0)
|
||||
cdp.removeAttribute("value");
|
||||
else
|
||||
cdp.setAttribute("value", cdp.getAttribute("max") - t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -265,8 +268,8 @@ function html.reboot()
|
|||
html.print("or<br><a href='http://" .. node .. ".local.mesh:8080/'>http://" .. node .. ".local.mesh:8080/</a></h3>")
|
||||
end
|
||||
end
|
||||
html.print("<br><h3><label for='cdProgress'>Rebooting: </label><progress id='cdProgress' max='120'/></h3>")
|
||||
html.print("<h1>Time Remaining: <span id='countdown'></h1>")
|
||||
html.print("<br><h3><label for='cdprogress'>Rebooting: </label><progress id='cdprogress' max='120'/></h3>")
|
||||
html.print("<h1>Time Remaining: <span id='countdown'/></h1>")
|
||||
html.print("</center></body></html>")
|
||||
http_footer()
|
||||
os.execute("reboot >/dev/null 2>&1")
|
||||
|
|
|
@ -123,7 +123,7 @@ function print_firmware_notice(reboot_when, href_addr, text_addr)
|
|||
received a new IP address and reconnect with<br>
|
||||
<a href='http://]] .. href_addr .. [[:8080/'>http://]] .. text_addr .. [[:8080/</a><br>
|
||||
This page will automatically reload once the upgrade has completed</h3>
|
||||
<br><h3><label for='cdProgress'>Writing firmware: </label><progress id='cdProgress' max='300'/></h3>
|
||||
<br><h3><label for='cdprogress'>Writing firmware: </label><progress id='cdprogress' max='300'/></h3>
|
||||
<h1>Time Remaining: <span id='countdown'></h1>
|
||||
</center></body></html>
|
||||
]])
|
||||
|
|
Loading…
Reference in New Issue