Feature: ORS Admin-Card — Wochensumme + 30-Tage-Gesamt im Header — SW by-v491, APP_VER 468

This commit is contained in:
rene 2026-04-29 11:25:11 +02:00
parent 69cbf3c599
commit fe2e718827
3 changed files with 16 additions and 6 deletions

View file

@ -3,7 +3,7 @@
Router, State-Management, Navigation, Initialisierung.
============================================================ */
const APP_VER = '467'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
const APP_VER = '468'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
const App = (() => {

View file

@ -1220,6 +1220,11 @@ window.Page_admin = (() => {
const pct = Math.min(Math.round(count / limit * 100), 100);
const barColor = pct < 50 ? '#4ade80' : pct <= 80 ? '#facc15' : '#f87171';
// Wochensumme + Gesamtsumme aus daily_history
const hist7 = (d.daily_history || []).slice(-7);
const weekTotal = hist7.reduce((s, h) => s + (h.count ?? 0), 0);
const totalAll = (d.daily_history || []).reduce((s, h) => s + (h.count ?? 0), 0);
// Sparkline aus daily_history (letzte 30 Tage)
const hist = Array.isArray(d.daily_history) ? d.daily_history : [];
const W = 400, H = 60, padY = 5;
@ -1262,10 +1267,15 @@ window.Page_admin = (() => {
<span style="font-size:var(--text-sm);font-weight:var(--weight-semibold);color:var(--c-text);flex:1">
OpenRouteService
</span>
<span style="font-size:var(--text-xs);font-weight:700;padding:3px 10px;border-radius:999px;
background:${barColor}22;color:${barColor};border:1px solid ${barColor}44">
${count.toLocaleString('de')} / ${limit.toLocaleString('de')} heute
</span>
<div style="display:flex;gap:var(--space-2);align-items:center;flex-wrap:wrap">
<span style="font-size:var(--text-xs);font-weight:700;padding:3px 10px;border-radius:999px;
background:${barColor}22;color:${barColor};border:1px solid ${barColor}44">
${count.toLocaleString('de')} / ${limit.toLocaleString('de')} heute
</span>
<span style="font-size:var(--text-xs);color:var(--c-text-muted);white-space:nowrap">
${weekTotal} diese Woche · ${totalAll} gesamt (30 Tage)
</span>
</div>
</div>
<!-- Fortschrittsbalken -->

View file

@ -3,7 +3,7 @@
Offline-Cache + Push Notifications + Tile-Cache
============================================================ */
const CACHE_VERSION = 'by-v490';
const CACHE_VERSION = 'by-v491';
const CACHE_STATIC = `${CACHE_VERSION}-static`;
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten