diff --git a/srv/poe_manager/templates/index.html b/srv/poe_manager/templates/index.html
index 1f839b5..b3e19c3 100644
--- a/srv/poe_manager/templates/index.html
+++ b/srv/poe_manager/templates/index.html
@@ -46,10 +46,15 @@ document.addEventListener("DOMContentLoaded", () => {
function updateTimer() {
const now = Date.now();
const elapsed = now - lastUpdateTime;
- const remainingMs = intervalMilliseconds - (elapsed % intervalMilliseconds);
- const remainingSec = Math.ceil(remainingMs / 1000);
+ const remainingMs = intervalMilliseconds - elapsed;
+ const remainingSec = Math.ceil(Math.max(remainingMs, 0) / 1000);
document.getElementById("dashboard-timer").innerText =
`Nächste Prüfung in ${remainingSec} Sekunden`;
+
+ if (elapsed >= intervalMilliseconds) {
+ // Timer abgelaufen → Reload starten
+ window.location.reload();
+ }
}
function fetchLastLog() {