From 38bafbd43e18d0482c42b60922b35500482709ee Mon Sep 17 00:00:00 2001 From: Roel Schiphorst Date: Wed, 5 Oct 2022 11:28:22 +0200 Subject: [PATCH] improved firmware update --- RemoteIDModule/web/index.html | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/RemoteIDModule/web/index.html b/RemoteIDModule/web/index.html index c2266a6..e5ccd01 100644 --- a/RemoteIDModule/web/index.html +++ b/RemoteIDModule/web/index.html @@ -120,12 +120,19 @@

Firmware Update

if (evt.lengthComputable) { var per = evt.loaded / evt.total; $('#progress').html('progress: ' + Math.round(per*100) + '%'); + if (evt.loaded == evt.total) { + setTimeout(function(){ //popup after 1 second + $('#progress').html('progress: done'); + alert("Firmware upgrade completed!\n\nPress OK to reboot the RemoteID device."); + window.location.reload(1); + }, 1000); + } } }, false); return xhr; }, success:function(d, s) { - console.log('success!') + console.log('success!'); }, error: function (a, b, c) { } @@ -134,6 +141,10 @@

Firmware Update

// poll status information at 1Hz (900ms to cope with some lag) ajax_json_poll_fill("/ajax/status.json", 900); + + $(document).ready(function() { + $('#progress').html(''); //disable progress text after loading the page + });