From 8a5745e3373ac71e2cb07727a99dcc5930a31af2 Mon Sep 17 00:00:00 2001 From: Tim Eertmoed Date: Wed, 8 Oct 2025 20:46:00 +0200 Subject: [PATCH] srv/poe_manager/templates/index.html aktualisiert --- srv/poe_manager/templates/index.html | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/srv/poe_manager/templates/index.html b/srv/poe_manager/templates/index.html index 8d1e747..3d7ac24 100644 --- a/srv/poe_manager/templates/index.html +++ b/srv/poe_manager/templates/index.html @@ -62,22 +62,16 @@ document.addEventListener("DOMContentLoaded", () => { .then(response => response.text()) .then(data => { const lines = data.split("\n").filter(line => !line.includes("ist erreichbar!")); - let lastSepIndex = -1; - for (let i = lines.length - 1; i >= 0; i--) { - if (lines[i].startsWith("--------------------------------------------------------------------")) { - lastSepIndex = i; - break; - } - } - if (lastSepIndex >= 0 && lastSepIndex + 1 < lines.length) { - const firstLine = lines[lastSepIndex + 1]; - const match = firstLine.match(/^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})/); - if (match) lastUpdateTime = parseLogTimestamp(match[1]); - } + if (lines.length === 0) return; + + const lastLine = lines[lines.length - 1]; // letzte Zeile + const match = lastLine.match(/^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})/); + if (match) lastUpdateTime = parseLogTimestamp(match[1]); }) .catch(err => console.error("Fehler beim Laden der Logs:", err)); } + // Timer alle 1 Sekunde aktualisieren setInterval(updateTimer, 1000);