From 664fb2a79b4e349a4cfe1c6519db91ae2ec67bbb Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 26 Apr 2026 17:44:45 +0200 Subject: [PATCH] =?UTF-8?q?Admin:=20APP-Version=20+=20SW-Version=20im=20Sy?= =?UTF-8?q?stem-Panel=20=E2=80=94=20SW=20by-v439,=20APP=5FVER=20418?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/routes/admin.py | 13 +++++++++++++ backend/static/js/app.js | 2 +- backend/static/js/pages/admin.js | 7 +++++-- backend/static/sw.js | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/backend/routes/admin.py b/backend/routes/admin.py index facd4d2..141b82d 100644 --- a/backend/routes/admin.py +++ b/backend/routes/admin.py @@ -569,6 +569,18 @@ async def system_info(user=Depends(require_admin)): except (OSError, AttributeError): pass + # SW-Cache-Version aus sw.js lesen + sw_version = "?" + try: + import re as _re + static_dir = os.getenv("STATIC_DIR", "/app/static") + sw_content = open(os.path.join(static_dir, "sw.js")).readline() + m = _re.search(r"'(by-v\d+)'", sw_content) + if m: + sw_version = m.group(1) + except Exception: + pass + return { "db_size_mb": round(db_size_mb, 2), "media_size_mb": round(media_size_mb, 2), @@ -576,6 +588,7 @@ async def system_info(user=Depends(require_admin)): "python_version": sys.version.split()[0], "disk_total_gb": round(disk_total_gb, 2), "disk_free_gb": round(disk_free_gb, 2), + "sw_version": sw_version, } diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 187591e..d053796 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 = '417'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '418'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const App = (() => { diff --git a/backend/static/js/pages/admin.js b/backend/static/js/pages/admin.js index 3d74055..a9c68c5 100644 --- a/backend/static/js/pages/admin.js +++ b/backend/static/js/pages/admin.js @@ -1064,8 +1064,11 @@ window.Page_admin = (() => { ${diskPct}% · ${diskUsedGb.toFixed(1)} / ${s.disk_total_gb.toFixed(1)} GB -
- Python ${_esc(s.python_version)} +
+ Python ${_esc(s.python_version)} + + APP v${typeof APP_VER !== 'undefined' ? APP_VER : '—'} · ${_esc(s.sw_version || '?')} +
`; diff --git a/backend/static/sw.js b/backend/static/sw.js index 125a592..06c2a1e 100644 --- a/backend/static/sw.js +++ b/backend/static/sw.js @@ -3,7 +3,7 @@ Offline-Cache + Push Notifications + Tile-Cache ============================================================ */ -const CACHE_VERSION = 'by-v438'; +const CACHE_VERSION = 'by-v439'; const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten