Admin: Kachel 'Fotos freizugeben' + pending_fotos in Stats-API, SW by-v365

This commit is contained in:
rene 2026-04-25 09:44:17 +02:00
parent 034f7ef21f
commit b608d5635f
3 changed files with 11 additions and 1 deletions

View file

@ -185,6 +185,14 @@ async def stats(user=Depends(require_mod)):
ki_cloud_today = ki_local_today = ki_luna_today = 0 ki_cloud_today = ki_local_today = ki_luna_today = 0
ki_cloud_month = ki_local_month = ki_luna_month = 0 ki_cloud_month = ki_local_month = ki_luna_month = 0
# Ausstehende Wiki-Foto-Einreichungen
try:
pending_fotos = conn.execute(
"SELECT COUNT(*) FROM wiki_foto_submissions WHERE status='pending'"
).fetchone()[0]
except Exception:
pending_fotos = 0
# Social Media Tracking # Social Media Tracking
try: try:
social_total = conn.execute("SELECT COUNT(*) FROM social_content").fetchone()[0] social_total = conn.execute("SELECT COUNT(*) FROM social_content").fetchone()[0]
@ -225,6 +233,7 @@ async def stats(user=Depends(require_mod)):
"threads": threads, "threads": threads,
"posts": posts, "posts": posts,
"open_reports": open_reports, "open_reports": open_reports,
"pending_fotos": pending_fotos,
"banned": banned, "banned": banned,
"dogs_total": dogs_total, "dogs_total": dogs_total,
"poison_active": poison_total, "poison_active": poison_total,

View file

@ -196,6 +196,7 @@ window.Page_admin = (() => {
${_statCard('paw-print', 'Hunde', s.dogs_total, 'var(--c-primary)')} ${_statCard('paw-print', 'Hunde', s.dogs_total, 'var(--c-primary)')}
${_statCard('chat-circle-dots','Threads', s.threads, 'var(--c-text-secondary)')} ${_statCard('chat-circle-dots','Threads', s.threads, 'var(--c-text-secondary)')}
${_statCard('warning', 'Offene Meldungen', s.open_reports, s.open_reports > 0 ? 'var(--c-danger)' : 'var(--c-text-muted)')} ${_statCard('warning', 'Offene Meldungen', s.open_reports, s.open_reports > 0 ? 'var(--c-danger)' : 'var(--c-text-muted)')}
${_statCard('camera', 'Fotos freizugeben', s.pending_fotos ?? 0, (s.pending_fotos ?? 0) > 0 ? 'var(--c-warning)' : 'var(--c-text-muted)')}
${_statCard('skull', 'Gesperrte User', s.banned, s.banned > 0 ? '#f59e0b' : 'var(--c-text-muted)')} ${_statCard('skull', 'Gesperrte User', s.banned, s.banned > 0 ? '#f59e0b' : 'var(--c-text-muted)')}
${_statCard('warning-octagon', 'Giftk. aktiv', s.poison_active, 'var(--c-danger)')} ${_statCard('warning-octagon', 'Giftk. aktiv', s.poison_active, 'var(--c-danger)')}
${_statCard('bell', 'Push-Abos', s.push_subscriptions, 'var(--c-text-secondary)')} ${_statCard('bell', 'Push-Abos', s.push_subscriptions, 'var(--c-text-secondary)')}

View file

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