srv/poe_manager/templates/index.html aktualisiert
This commit is contained in:
@@ -46,10 +46,15 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||||||
function updateTimer() {
|
function updateTimer() {
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
const elapsed = now - lastUpdateTime;
|
const elapsed = now - lastUpdateTime;
|
||||||
const remainingMs = intervalMilliseconds - (elapsed % intervalMilliseconds);
|
const remainingMs = intervalMilliseconds - elapsed;
|
||||||
const remainingSec = Math.ceil(remainingMs / 1000);
|
const remainingSec = Math.ceil(Math.max(remainingMs, 0) / 1000);
|
||||||
document.getElementById("dashboard-timer").innerText =
|
document.getElementById("dashboard-timer").innerText =
|
||||||
`Nächste Prüfung in ${remainingSec} Sekunden`;
|
`Nächste Prüfung in ${remainingSec} Sekunden`;
|
||||||
|
|
||||||
|
if (elapsed >= intervalMilliseconds) {
|
||||||
|
// Timer abgelaufen → Reload starten
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function fetchLastLog() {
|
function fetchLastLog() {
|
||||||
|
|||||||
Reference in New Issue
Block a user