Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improved firmware update via web interface #80

Merged
merged 1 commit into from
Oct 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion RemoteIDModule/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,19 @@ <h2>Firmware Update</h2>
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) {
}
Expand All @@ -134,6 +141,10 @@ <h2>Firmware Update</h2>

// 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
});
</script>

</body>
Expand Down