diff --git a/VERSION b/VERSION index dfc8356..39987d0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1098 \ No newline at end of file +1099 \ No newline at end of file diff --git a/backend/routes/admin.py b/backend/routes/admin.py index bfd02f8..713a055 100644 --- a/backend/routes/admin.py +++ b/backend/routes/admin.py @@ -211,6 +211,16 @@ async def stats(user=Depends(require_mod)): "SELECT type, COUNT(*) FROM osm_pois GROUP BY type ORDER BY 2 DESC" ).fetchall() } + # User-erstellte POIs nach Typ (type-Spalte kann komma-separiert sein wie 'freilauf,treffpunkt') + user_poi_total = conn.execute("SELECT COUNT(*) FROM user_map_pois").fetchone()[0] + user_poi_by_type = {} + for row in conn.execute("SELECT type FROM user_map_pois").fetchall(): + for t in (row[0] or "").split(","): + t = t.strip() + if t: + user_poi_by_type[t] = user_poi_by_type.get(t, 0) + 1 + # absteigend sortieren + user_poi_by_type = dict(sorted(user_poi_by_type.items(), key=lambda x: x[1], reverse=True)) # KI-Nutzung try: @@ -312,6 +322,8 @@ async def stats(user=Depends(require_mod)): "osm_total": osm_total, "osm_tiles": osm_tiles, "osm_by_type": osm_by_type, + "user_poi_total": user_poi_total, + "user_poi_by_type": user_poi_by_type, "ki_today": ki_today, "ki_week": ki_week, "ki_month": ki_month, diff --git a/backend/static/index.html b/backend/static/index.html index 8a6e432..bf2434e 100644 --- a/backend/static/index.html +++ b/backend/static/index.html @@ -101,9 +101,9 @@ - - - + + + @@ -625,11 +625,11 @@ - - - - - + + + + + diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 2cae07a..b275c15 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 = '1098'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '1099'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VERSION = '1.6.0'; // ← semantische Version, wird bei make release gesetzt window.APP_VER = APP_VER; // global verfügbar für andere Module (z.B. offline-indicator) window.APP_VERSION = APP_VERSION; diff --git a/backend/static/js/pages/admin.js b/backend/static/js/pages/admin.js index 311f104..4a1a63a 100644 --- a/backend/static/js/pages/admin.js +++ b/backend/static/js/pages/admin.js @@ -652,17 +652,43 @@ window.Page_admin = (() => { ` : ''} -
-

OSM-Cache nach Typ

-
- ${Object.entries(s.osm_by_type).map(([type, count]) => ` + ${(() => { + const POI_LABELS = { + waste_basket: 'Mülleimer', dog_park: 'Hundewiese', drinking_water: 'Wasserstelle', + tierarzt: 'Tierarzt', hundesalon: 'Hundesalon', hundeschule: 'Hundeschule', + shop: 'Shop', restaurant: 'Café / Restaurant', bank: 'Sitzbank', + hotel: 'Hotel', freilauf: 'Freilauf', kotbeutel: 'Kotbeutel', + parkplatz: 'Parkplatz', treffpunkt: 'Treffpunkt', sonstiges: 'Sonstiges', + giftkoeder: 'Giftköder', gefahr: 'Gefahr', + }; + const label = t => POI_LABELS[t] || t; + const row = ([type, count]) => `
- ${type} + ${label(type)} ${count.toLocaleString('de')} -
- `).join('')} +
`; + const userByType = s.user_poi_by_type || {}; + const userTotal = s.user_poi_total ?? 0; + return ` +
+

+ OSM-Cache nach Typ — ${(s.osm_total || 0).toLocaleString('de')} gecacht +

+
+ ${Object.entries(s.osm_by_type).map(row).join('')} +
-
+
+

+ Nutzer-POIs nach Typ — ${userTotal.toLocaleString('de')} gesamt +

+
+ ${Object.keys(userByType).length + ? Object.entries(userByType).map(row).join('') + : '
Noch keine Nutzer-POIs
'} +
+
`; + })()}
diff --git a/backend/static/sw.js b/backend/static/sw.js index ffa732a..51b4ac9 100644 --- a/backend/static/sw.js +++ b/backend/static/sw.js @@ -4,7 +4,7 @@ ============================================================ */ // ← EINZIGE Stelle für die Version — STATIC_ASSETS und CACHE_VERSION leiten sich ab -const VER = '1098'; +const VER = '1099'; const CACHE_VERSION = `by-v${VER}`; const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten