From be9f263e0d1837a23f3d29db02d4d288323bae38 Mon Sep 17 00:00:00 2001 From: rene Date: Fri, 15 May 2026 18:34:03 +0200 Subject: [PATCH] =?UTF-8?q?Feature:=20Stats-Band=20+=20Tagebuch-Eintr?= =?UTF-8?q?=C3=A4ge,=20km=20alle=20Routen=20(public+privat)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - landing.html: neues Stats-Band-Element 'Tagebuch-Einträge' (#big-diary) mit Wert aus diary_entries (war bereits im API-Response vorhanden) - stats.py km-Query: explizit WHERE is_valid=1 (kein is_public-Filter — private Routen werden mitgezählt, nur ungültige Aufzeichnungen ausgeschlossen) - SW by-v998, APP_VER 998 --- backend/main.py | 2 +- backend/routes/stats.py | 3 ++- backend/static/js/app.js | 2 +- backend/static/landing.html | 5 +++++ backend/static/sw.js | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/backend/main.py b/backend/main.py index 57280f3..97f397b 100644 --- a/backend/main.py +++ b/backend/main.py @@ -410,7 +410,7 @@ async def serve_media(path: str, request: _Request): raise _HE(404, "Nicht gefunden.") return _media_response(filepath) -APP_VER = "997" # muss mit APP_VER in app.js übereinstimmen +APP_VER = "998" # muss mit APP_VER in app.js übereinstimmen @app.get("/.well-known/assetlinks.json") async def assetlinks(): diff --git a/backend/routes/stats.py b/backend/routes/stats.py index 985a883..c683384 100644 --- a/backend/routes/stats.py +++ b/backend/routes/stats.py @@ -33,7 +33,8 @@ async def public_stats(): users = conn.execute("SELECT COUNT(*) FROM users").fetchone()[0] dogs = conn.execute("SELECT COUNT(*) FROM dogs").fetchone()[0] km = conn.execute( - "SELECT ROUND(COALESCE(SUM(distanz_km),0),0) FROM routes" + # Alle Routen (öffentlich + privat), nur valide Aufzeichnungen + "SELECT ROUND(COALESCE(SUM(distanz_km),0),0) FROM routes WHERE is_valid=1" ).fetchone()[0] posts = conn.execute("SELECT COUNT(*) FROM forum_posts").fetchone()[0] diary = conn.execute("SELECT COUNT(*) FROM diary").fetchone()[0] diff --git a/backend/static/js/app.js b/backend/static/js/app.js index d4a02cb..3535c94 100644 --- a/backend/static/js/app.js +++ b/backend/static/js/app.js @@ -3,7 +3,7 @@ Router, State-Management, Navigation, Initialisierung. ============================================================ */ -const APP_VER = '997'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '998'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VERSION = '1.6.0'; // ← semantische Version, wird bei make release gesetzt const IS_STAGING = location.hostname === 'staging.banyaro.app'; // Cache-Bust-Parameter nach Update-Reload sofort entfernen diff --git a/backend/static/landing.html b/backend/static/landing.html index 1c25492..04bfa4b 100644 --- a/backend/static/landing.html +++ b/backend/static/landing.html @@ -826,6 +826,10 @@
Forum-Beiträge
+
+
+
Tagebuch-Einträge
+
Mülleimer für Kotbeutel
@@ -1587,6 +1591,7 @@ set('big-dogs', d.dogs); set('big-km', d.km); set('big-posts', d.forum_posts); + set('big-diary', d.diary_entries); set('stat-kotbeutel', d.kotbeutel); set('big-kotbeutel', d.kotbeutel); diff --git a/backend/static/sw.js b/backend/static/sw.js index 43bd078..459e79c 100644 --- a/backend/static/sw.js +++ b/backend/static/sw.js @@ -3,7 +3,7 @@ Offline-Cache + Push Notifications + Tile-Cache ============================================================ */ -const CACHE_VERSION = 'by-v997'; +const CACHE_VERSION = 'by-v998'; const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache