From 2b92c328e125bc9c687f4aa337c6e67e62d1ab18 Mon Sep 17 00:00:00 2001 From: Tim Eertmoed Date: Wed, 8 Oct 2025 20:32:15 +0200 Subject: [PATCH] srv/poe_manager/templates/index.html aktualisiert --- srv/poe_manager/templates/index.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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() {