revert 8a5745e337
revert srv/poe_manager/templates/index.html aktualisiert
This commit is contained in:
@@ -62,16 +62,22 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||||||
.then(response => response.text())
|
.then(response => response.text())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
const lines = data.split("\n").filter(line => !line.includes("ist erreichbar!"));
|
const lines = data.split("\n").filter(line => !line.includes("ist erreichbar!"));
|
||||||
if (lines.length === 0) return;
|
let lastSepIndex = -1;
|
||||||
|
for (let i = lines.length - 1; i >= 0; i--) {
|
||||||
const lastLine = lines[lines.length - 1]; // letzte Zeile
|
if (lines[i].startsWith("--------------------------------------------------------------------")) {
|
||||||
const match = lastLine.match(/^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})/);
|
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 (match) lastUpdateTime = parseLogTimestamp(match[1]);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(err => console.error("Fehler beim Laden der Logs:", err));
|
.catch(err => console.error("Fehler beim Laden der Logs:", err));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Timer alle 1 Sekunde aktualisieren
|
// Timer alle 1 Sekunde aktualisieren
|
||||||
setInterval(updateTimer, 1000);
|
setInterval(updateTimer, 1000);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user