Dashboard
Deine gesamte Medienbibliothek und Systemauslastung auf einen Blick.
Systemauslastung
Aktuelle Werte aus dem Dashboard-Container
Dienste
Verbindung und Bibliotheksstatus
diff --git a/app.py b/app.py index cb888c5..b5efe3e 100644 --- a/app.py +++ b/app.py @@ -13,7 +13,7 @@ from datetime import datetime from pathlib import Path import requests -from flask import Flask, jsonify, render_template, request +from flask import Flask, jsonify, render_template, request, send_from_directory RADARR_URL = os.environ.get("RADARR_URL", "http://radarr:7878").rstrip("/") RADARR_API_KEY = os.environ.get("RADARR_API_KEY", "") @@ -57,6 +57,15 @@ try: except OSError as exc: log.warning("Datei-Logging nicht verfügbar (%s): %s", LOG_FILE, exc) app = Flask(__name__) + + +@app.get("/sw.js") +def service_worker(): + """Serve the worker from the origin root so it can control the whole app.""" + response = send_from_directory(app.static_folder, "sw.js", mimetype="application/javascript") + response.headers["Service-Worker-Allowed"] = "/" + response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate" + return response executor = ThreadPoolExecutor(max_workers=int(os.environ.get("SCAN_WORKERS", "2"))) scan_executor = ThreadPoolExecutor(max_workers=int(os.environ.get("SCAN_WORKERS", "4"))) jobs = {"radarr": {"state": "idle", "total": 0, "done": 0, "error": None}, "sonarr": {"state": "idle", "total": 0, "done": 0, "error": None}} diff --git a/static/manifest.json b/static/manifest.json index 536ff79..16ad1aa 100644 --- a/static/manifest.json +++ b/static/manifest.json @@ -13,7 +13,8 @@ "theme_color": "#1f252d", "orientation": "any", "icons": [ - {"src": "/static/media-mark-192.svg", "sizes": "192x192", "type": "image/svg+xml", "purpose": "any maskable"}, - {"src": "/static/media-mark-512.svg", "sizes": "512x512", "type": "image/svg+xml", "purpose": "any maskable"} + {"src": "/static/media-mark-192.svg", "sizes": "192x192", "type": "image/svg+xml", "purpose": "any"}, + {"src": "/static/media-mark-512.svg", "sizes": "512x512", "type": "image/svg+xml", "purpose": "any"}, + {"src": "/static/media-mark-512.svg", "sizes": "512x512", "type": "image/svg+xml", "purpose": "maskable"} ] } diff --git a/static/media-mark-192.svg b/static/media-mark-192.svg index 1a6011a..a912e33 100644 --- a/static/media-mark-192.svg +++ b/static/media-mark-192.svg @@ -1 +1 @@ - + diff --git a/static/sw.js b/static/sw.js index 6beaa79..48e8d32 100644 --- a/static/sw.js +++ b/static/sw.js @@ -1,5 +1,5 @@ -const CACHE_NAME = 'media-max-shell-v3'; -const SHELL = ['/static/media-mark.svg', '/static/manifest.json']; +const CACHE_NAME = 'media-max-shell-v4'; +const SHELL = ['/static/media-mark.svg', '/static/media-mark-192.svg', '/static/media-mark-512.svg', '/static/manifest.json']; self.addEventListener('install', event => { event.waitUntil(caches.open(CACHE_NAME).then(cache => cache.addAll(SHELL))); diff --git a/templates/index.html b/templates/index.html index 1b1baad..724776e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,4 +1,11 @@ + @@ -29,7 +36,6 @@
Deine gesamte Medienbibliothek und Systemauslastung auf einen Blick.
Aktuelle Werte aus dem Dashboard-Container
Verbindung und Bibliotheksstatus