docs: update upgrade page message and improve progress display logic
This commit is contained in:
parent
7b52066378
commit
8c5e7e26ac
@ -206,10 +206,10 @@
|
|||||||
progress.textContent = '100%';
|
progress.textContent = '100%';
|
||||||
|
|
||||||
// Automatischer Neustart nach erfolgreicher Aktualisierung
|
// Automatischer Neustart nach erfolgreicher Aktualisierung
|
||||||
status.textContent = "Update successful! Restarting device...";
|
status.textContent = "Update successful! Restarting device... The page will reload in 30 seconds.";
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.location.reload();
|
window.location.href = '/';
|
||||||
}, 5000);
|
}, 30000);
|
||||||
} else {
|
} else {
|
||||||
document.querySelectorAll('form input[type=submit]').forEach(btn => btn.disabled = false);
|
document.querySelectorAll('form input[type=submit]').forEach(btn => btn.disabled = false);
|
||||||
}
|
}
|
||||||
|
@ -438,13 +438,18 @@ void setupWebserver(AsyncWebServer &server) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update OLED Display alle 25%
|
// Update OLED Display alle 5% und Webseite bei jeder Änderung
|
||||||
static int lastProgress = -1;
|
static int lastProgress = -1;
|
||||||
int currentProgress = (index + len) * 100 / updateSize;
|
int currentProgress = (index + len) * 100 / updateSize;
|
||||||
if (currentProgress % 25 == 0 && currentProgress != lastProgress) {
|
if (currentProgress != lastProgress) {
|
||||||
lastProgress = currentProgress;
|
// OLED nur alle 5% aktualisieren
|
||||||
|
if (currentProgress % 5 == 0) {
|
||||||
oledShowMessage(String(currentProgress) + "% complete");
|
oledShowMessage(String(currentProgress) + "% complete");
|
||||||
}
|
}
|
||||||
|
// Webseite bei jeder Änderung aktualisieren
|
||||||
|
lastProgress = currentProgress;
|
||||||
|
ws.textAll("{\"type\":\"updateProgress\",\"progress\":" + String(currentProgress) + "}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (final) {
|
if (final) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user