Admin: APP-Version + SW-Version im System-Panel — SW by-v439, APP_VER 418

This commit is contained in:
rene 2026-04-26 17:44:45 +02:00
parent e0c2b2bdc1
commit 664fb2a79b
4 changed files with 20 additions and 4 deletions

View file

@ -569,6 +569,18 @@ async def system_info(user=Depends(require_admin)):
except (OSError, AttributeError): except (OSError, AttributeError):
pass 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 { return {
"db_size_mb": round(db_size_mb, 2), "db_size_mb": round(db_size_mb, 2),
"media_size_mb": round(media_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], "python_version": sys.version.split()[0],
"disk_total_gb": round(disk_total_gb, 2), "disk_total_gb": round(disk_total_gb, 2),
"disk_free_gb": round(disk_free_gb, 2), "disk_free_gb": round(disk_free_gb, 2),
"sw_version": sw_version,
} }

View file

@ -3,7 +3,7 @@
Router, State-Management, Navigation, Initialisierung. 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 = (() => { const App = (() => {

View file

@ -1064,8 +1064,11 @@ window.Page_admin = (() => {
${diskPct}% · ${diskUsedGb.toFixed(1)} / ${s.disk_total_gb.toFixed(1)} GB ${diskPct}% · ${diskUsedGb.toFixed(1)} / ${s.disk_total_gb.toFixed(1)} GB
</div> </div>
</div> </div>
<div style="margin-top:var(--space-3);font-size:var(--text-xs);color:var(--c-text-muted)"> <div style="margin-top:var(--space-3);font-size:var(--text-xs);color:var(--c-text-muted);display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:4px">
Python ${_esc(s.python_version)} <span>Python ${_esc(s.python_version)}</span>
<span style="font-family:monospace;font-size:var(--text-xs);background:var(--c-surface-2);padding:2px 8px;border-radius:4px;color:var(--c-text-secondary)">
APP v${typeof APP_VER !== 'undefined' ? APP_VER : '—'} · ${_esc(s.sw_version || '?')}
</span>
</div> </div>
</div> </div>
`; `;

View file

@ -3,7 +3,7 @@
Offline-Cache + Push Notifications + Tile-Cache Offline-Cache + Push Notifications + Tile-Cache
============================================================ */ ============================================================ */
const CACHE_VERSION = 'by-v438'; const CACHE_VERSION = 'by-v439';
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