Fix: Staging-Icon für iOS — apple-touch-icon dynamisch für Staging-Umgebung
- icon-180-staging.png erstellt (Helm-Icon, 180px für iOS-Homescreen) - spa_fallback: Staging-HTML ersetzt apple-touch-icon-Link dynamisch - SW by-v514, APP_VER 491
This commit is contained in:
parent
15d8347e16
commit
810c1a79dc
4 changed files with 12 additions and 2 deletions
|
|
@ -1401,6 +1401,16 @@ async def knigge_page():
|
||||||
# SPA Fallback — ALLE nicht-API-Routen gehen zur index.html
|
# SPA Fallback — ALLE nicht-API-Routen gehen zur index.html
|
||||||
@app.get("/{full_path:path}")
|
@app.get("/{full_path:path}")
|
||||||
async def spa_fallback(full_path: str):
|
async def spa_fallback(full_path: str):
|
||||||
|
IS_STAGING = os.getenv("STAGING", "false").lower() == "true"
|
||||||
|
if IS_STAGING:
|
||||||
|
from fastapi.responses import HTMLResponse
|
||||||
|
with open(f"{STATIC_DIR}/index.html", encoding="utf-8") as f:
|
||||||
|
html = f.read()
|
||||||
|
html = html.replace(
|
||||||
|
'<link rel="apple-touch-icon" sizes="180x180" href="/icons/icon-180.png">',
|
||||||
|
'<link rel="apple-touch-icon" sizes="180x180" href="/icons/icon-180-staging.png">',
|
||||||
|
)
|
||||||
|
return HTMLResponse(content=html, headers={"Cache-Control": "no-cache"})
|
||||||
return FileResponse(
|
return FileResponse(
|
||||||
f"{STATIC_DIR}/index.html",
|
f"{STATIC_DIR}/index.html",
|
||||||
headers={"Cache-Control": "no-cache"}
|
headers={"Cache-Control": "no-cache"}
|
||||||
|
|
|
||||||
BIN
backend/static/icons/icon-180-staging.png
Normal file
BIN
backend/static/icons/icon-180-staging.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
|
|
@ -3,7 +3,7 @@
|
||||||
Router, State-Management, Navigation, Initialisierung.
|
Router, State-Management, Navigation, Initialisierung.
|
||||||
============================================================ */
|
============================================================ */
|
||||||
|
|
||||||
const APP_VER = '490'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
const APP_VER = '491'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||||
const APP_VERSION = '1.0.0'; // ← semantische Version, wird bei make release gesetzt
|
const APP_VERSION = '1.0.0'; // ← semantische Version, wird bei make release gesetzt
|
||||||
const IS_STAGING = location.hostname === 'staging.banyaro.app';
|
const IS_STAGING = location.hostname === 'staging.banyaro.app';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
Offline-Cache + Push Notifications + Tile-Cache
|
Offline-Cache + Push Notifications + Tile-Cache
|
||||||
============================================================ */
|
============================================================ */
|
||||||
|
|
||||||
const CACHE_VERSION = 'by-v513';
|
const CACHE_VERSION = 'by-v514';
|
||||||
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
|
||||||
const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache
|
const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue