Datenverlust-Counter hinzugefügt

This commit is contained in:
2025-12-13 12:54:43 +01:00
parent 59dd267659
commit 2dcc389f4b
3 changed files with 33 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
venv/
kver.db
*.env
__pycache__/
static/media/
+23
View File
@@ -1,3 +1,26 @@
$(() => {
$('#auth-visible').hide()
// Startdatum festlegen (Beispiel: 1. Januar 2025, 00:00:00 Uhr)
const startDate = new Date('2025-12-13T12:44:00').getTime();
function updateCounter() {
const now = new Date().getTime();
const diff = now - startDate;
// Berechne Tage, Stunden, Minuten
const days = Math.floor(diff / (1000 * 60 * 60 * 24));
const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((diff % (1000 * 60)) / 1000);
// Zeige den Counter an
$('#uptime-counter').html(`<strong>${days}</strong> Tage, <strong>${hours}</strong> Stunden, <strong>${minutes}</strong> Minuten und <strong>${seconds}</strong> Sekunden ohne Datenverlust!`);
}
// Aktualisiere den Counter sofort und dann jede Minute
updateCounter();
setInterval(updateCounter, 1000);
})
+5
View File
@@ -17,6 +17,9 @@
crossorigin="anonymous">
</script>
<script src="/static/js/main.js"></script>
<script>
</script>
</head>
<body>
<a href="/docs/impressum.html">Impressum</a>
@@ -25,6 +28,8 @@
<div class="htmx-indicator loading"></div>
<h1>Kontrollverlust</h1>
<span>Verbuggte scheise hier. Komm hack mich doch, trau dich!</span>
<div id="uptime-counter"></div>
<div hx-get="/header" hx-trigger="load"></div>
{% block content %}{% endblock %}
</body>