feat(manager): notification bell, sign-in/venue/print settings, log download (platform-v2 2.6f)

- Bell in the header: /api/platform/notifications with unread count, live via
  the new LiveProvider (one createLiveClient connection) on platform_notification
  and reconnect; mark read / all; warning+critical pop a toast.
- Settings: Sign-in card (manager/waiter/device modes, require username, one
  session per manager/waiter, username autofill) replaces the dead v1
  security.login_method card; new "Venue & language" tab (language, time zone);
  print alert threshold in Printing. Tab labels are i18n keys.
- Technical > Log files: list + download of the daily logs (owner-level).
  Backend: GET /api/system/logs, /api/system/logs/{date} (core.settings.manage),
  error system.log_not_found.
- Setup wizard asks staff language and time zone (setup/init stores them).
- @xenia/ui theme helpers (applyTheme, getStoredTheme); the manager stays light
  until phase 6 converts the older pages (owner decision 2026-11-14).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-14 09:01:26 +02:00
co-authored by Claude Opus 5.5
parent 92bc1b0113
commit 2426ffddad
36 changed files with 995 additions and 92 deletions
+24
View File
@@ -1,5 +1,6 @@
from core.access.deps import public
from core.access.queries import holders_filter
from core.access.deps import require
import asyncio
import ipaddress
import json
@@ -77,6 +78,29 @@ def _lock_reason() -> str | None:
return None
# ── Log download (plan step 2.6f, APPS_PLATFORM §10) ───────────────────────────
# The daily files of core/logging.py. Owner-level (core.settings.manage): lines carry
# usernames, IPs and order ids (never secrets).
@router.get("/logs")
def list_logs(user: User = Depends(require("core.settings.manage"))):
"""[{date, name, size}] newest first (UTC days)."""
from core.logging import list_log_files
return list_log_files()
@router.get("/logs/{date}")
def download_log(date: str, user: User = Depends(require("core.settings.manage"))):
"""One day's file as an attachment (today's is still being written: a snapshot)."""
from fastapi.responses import FileResponse
from core.errors import XeniaError
from core.logging import log_file_for
f = log_file_for(date)
if f is None:
raise XeniaError("system.log_not_found", date=date)
return FileResponse(f, media_type="text/plain; charset=utf-8", filename=f.name)
@router.get("/status")
def system_status(db: Session = Depends(get_db), user: User = Depends(get_current_user)):
printers = db.query(Printer).filter(Printer.is_active == True).all()