dev #1

Merged
alientim merged 145 commits from dev into main 2025-10-12 13:44:14 +02:00
Showing only changes of commit 8ff4515a17 - Show all commits

View File

@@ -16,7 +16,6 @@
<script>
function parseLogTimestamp(ts) {
// ts = "2025-10-08 16:48:16"
const parts = ts.match(/^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})$/);
if (!parts) return Date.now();
const [, year, month, day, hour, minute, second] = parts.map(Number);
@@ -65,9 +64,9 @@ document.addEventListener("DOMContentLoaded", () => {
function updateTimer() {
const now = Date.now();
const nextRefresh = lastUpdateTime + intervalMilliseconds;
const remainingMs = nextRefresh - now;
const remainingSec = Math.max(Math.ceil(remainingMs / 1000), 0);
const elapsed = now - lastUpdateTime;
const remainingMs = intervalMilliseconds - (elapsed % intervalMilliseconds);
const remainingSec = Math.ceil(remainingMs / 1000);
document.getElementById("timer").innerText = remainingSec;
}
@@ -77,7 +76,6 @@ document.addEventListener("DOMContentLoaded", () => {
setInterval(fetchLog, intervalMilliseconds);
setInterval(updateTimer, 1000);
});
</script>
{% endblock %}