@@ -224,11 +224,12 @@ void goHome()
224224}
225225
226226String SendHTML (){
227- String page = " <!DOCTYPE html> <html>\n " ;
228- page +=" <head><meta name=\" viewport\" content=\" width=device-width, initial-scale=1.0, user-scalable=no\" >\n " ;
229- page +=" <title>Scooter Control</title>\n " ;
230- page +=" <style>html { font-family: Helvetica; display: inline-block; margin: 0px auto; text-align: center;}\n " ;
231- page +=" body{margin-top: 50px;} h1 {color: #444444;margin: 50px auto 30px;} h3 {color: #444444;margin-bottom: 50px;}#status {font-size: 36px;}\n " ;
227+ String page = " <!DOCTYPE html>\n " ;
228+ page += " <html>\n " ;
229+ page += " <head><meta name=\" viewport\" content=\" width=device-width, initial-scale=1.0, user-scalable=no\" >\n " ;
230+ page += " <title>Scooter Config</title>\n " ;
231+ page += " <style>html { font-family: Helvetica; display: inline-block; margin: 0px auto; text-align: center;}\n " ;
232+ page += " body{margin-top: 50px;} h1 {color: #444444;margin: 50px auto 30px;} h3 {color: #444444;margin-bottom: 50px;}#status {font-size: 36px;}\n " ;
232233 page += " .button {display: block;width: 120px;background-color: #1abc9c;border: none;color: white;padding: 13px 30px;" ;
233234 page += " text-decoration: none;font-size: 25px;margin: 0px auto 35px;cursor: pointer;border-radius: 4px;}\n " ;
234235 page += " .button2 {display: inline;width: 100px;background-color: #1abc9c;border: none;color: white;padding: 13px 30px;" ;
@@ -280,6 +281,7 @@ String SendRestart(){
280281 page +=" <small style='vertical-align: super;'>" +WiFi.localIP ().toString ()+" | " +WiFi.softAPIP ().toString ()+" </small>\n " ;
281282 page += " <script>\n " ;
282283 page += " var numFailures = 0;\n " ;
284+ page += " var timer;\n " ;
283285 page +=" function checkStatus()\n " ;
284286 page +=" {\n " ;
285287 page +=" var xhr = new XMLHttpRequest();\n " ;
@@ -293,6 +295,8 @@ String SendRestart(){
293295 page +=" if (xhr.status === 200) {\n " ;
294296 page +=" document.getElementById('status').style.color = 'green';\n " ;
295297 page += " window.location.href = '/';\n " ;
298+ page += " clearInterval(timer);\n " ;
299+ page += " document.getElementById('timer').innerHTML = '0';\n " ;
296300 page +=" }\n " ;
297301 page +=" else\n " ;
298302 page +=" {\n " ;
@@ -320,7 +324,7 @@ String SendRestart(){
320324 page += " \t\t checkStatus();\n " ;
321325 page += " \t\t }\n " ;
322326 page += " \t }\n " ;
323- page += " \t var timer = setInterval(asecondhaspassed, 1000);\n " ;
327+ page += " \t timer = setInterval(asecondhaspassed, 1000);\n " ;
324328 page += " </script>\n " ;
325329 page +=" </body>\n " ;
326330
0 commit comments