Version bumps, OTA working
All checks were successful
Test compiling project / test (push) Successful in 2m23s

This commit is contained in:
2025-02-22 22:15:43 +01:00
parent 32d35d7029
commit 6e171fbde7
5 changed files with 24 additions and 5 deletions

View File

@@ -54,7 +54,7 @@ function fetchUpdateData(gauge) {
.then(data => {
document.getElementById('current_fw').textContent = data.current_version || 'N/A';
document.getElementById('server_fw').textContent = data.new_version || 'N/A';
if (data.update_available == "true") {
if (data.update_available == true) {
document.getElementById("update_button").style.visibility = 'visible';
} else {
document.getElementById("update_button").style.visibility = 'hidden';

View File

@@ -28,7 +28,24 @@
console.log('Progress:', event.data);
// Update the progress bar
let progress = parseInt(event.data);
document.getElementById('progress').textContent = progress + '%';
if (progress == -1) {
document.getElementById('progress').textContent = "Upgrade Done, wait for reboot...";
const checkStatus = setInterval(() => {
fetch('/ota_udpate_status')
.then(response => {
if (response.ok) {
clearInterval(checkStatus);
window.location.href = '/';
}
})
.catch(error => console.error('Error checking OTA update status:', error));
}, 1000);
} else {
document.getElementById('progress').textContent = progress + '%';
}
};
ws.onerror = function(error) {

View File

@@ -1 +1 @@
3
4