diff --git a/backend/main.py b/backend/main.py index d63ae64..ed8aac2 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 = "1070" # muss mit APP_VER in app.js übereinstimmen +APP_VER = "1071" # muss mit APP_VER in app.js übereinstimmen @app.get("/.well-known/assetlinks.json") async def assetlinks(): diff --git a/backend/routes/admin.py b/backend/routes/admin.py index c0ec221..a1c33a6 100644 --- a/backend/routes/admin.py +++ b/backend/routes/admin.py @@ -359,7 +359,7 @@ async def list_users( SELECT u.id, u.name, {_email_col}, u.rolle, u.is_premium, u.is_moderator, u.is_banned, u.ban_reason, u.is_founder, u.is_partner, u.founder_number, - u.created_at, u.last_login, u.subscription_tier, + u.created_at, u.last_login, u.last_seen, u.subscription_tier, (SELECT COUNT(*) FROM dogs d WHERE d.user_id=u.id) AS dog_count, (SELECT COUNT(*) FROM forum_threads t WHERE t.user_id=u.id AND t.is_deleted=0) AS thread_count, ROUND(COALESCE((SELECT SUM(r.distanz_km) FROM routes r WHERE r.user_id=u.id), 0), 1) AS total_km, diff --git a/backend/routes/auth.py b/backend/routes/auth.py index 0ccc0cd..7ee2d03 100644 --- a/backend/routes/auth.py +++ b/backend/routes/auth.py @@ -479,3 +479,10 @@ async def select_primary_dog(body: dict, user=Depends(get_current_user)): "UPDATE users SET needs_dog_selection=0 WHERE id=?", (user["id"],) ) return {"ok": True} + + +@router.post("/heartbeat") +async def heartbeat(user=Depends(get_current_user)): + with db() as conn: + conn.execute("UPDATE users SET last_seen=datetime('now') WHERE id=?", (user["id"],)) + return {"ok": True} diff --git a/backend/static/index.html b/backend/static/index.html index e8ea43a..7c87e70 100644 --- a/backend/static/index.html +++ b/backend/static/index.html @@ -101,9 +101,9 @@ - - - + + +
@@ -616,10 +616,10 @@ - - - - + + + + diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 1bec4db..8b1c343 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 = '1070'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '1071'; // ← 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/js/pages/admin.js b/backend/static/js/pages/admin.js index b7acbf5..4b644c6 100644 --- a/backend/static/js/pages/admin.js +++ b/backend/static/js/pages/admin.js @@ -820,7 +820,13 @@ window.Page_admin = (() => {