Skip to content

Commit

Permalink
update reboot page
Browse files Browse the repository at this point in the history
  • Loading branch information
softwarecrash committed Jul 7, 2023
1 parent 24d4eef commit 97f2612
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/webpages/reboot.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,29 @@ DALY2MQTT Project
https://github.com/softwarecrash/DALY2MQTT
*/
const char HTML_REBOOT[] PROGMEM = R"rawliteral(
%HEAD_TEMPLATE%
<figure class="text-center"><h1>Rebooting ...</h1></figure>
%HEAD_TEMPLATE%
<figure class="text-center"><h1>Rebooting </h1><h2 id="wait">.</h2></figure>
<div class="d-grid gap-2">
<a class="btn btn-primary" href="/" role="button">Main</a>
</div>

<script>
$(document).ready(function () {
setTimeout(startCheck, 2000);
window.dotsGoingUp = true;
var dots = window.setInterval( function() {
var wait = document.getElementById("wait");
if ( window.dotsGoingUp )
wait.innerHTML += ".";
else {
wait.innerHTML = wait.innerHTML.substring(1, wait.innerHTML.length);
if ( wait.innerHTML === ".")
window.dotsGoingUp = true;
}
if ( wait.innerHTML.length > 9 )
window.dotsGoingUp = false;
}, 100);

setTimeout(startCheck, 2000);

function startCheck(){
setInterval(serverReachable, 1000);
Expand All @@ -31,4 +44,4 @@ function serverReachable() {
</script>

%FOOT_TEMPLATE%
)rawliteral";
)rawliteral";

0 comments on commit 97f2612

Please sign in to comment.