Split monitor UI into separate HTML and JS assets
All checks were successful
CI / test (push) Successful in 7s

This commit is contained in:
Space-Banane
2026-05-27 22:01:06 +02:00
parent 111a1e84af
commit a8ef8ee552
5 changed files with 519 additions and 501 deletions

View File

@@ -15,7 +15,7 @@ from pydantic import BaseModel, Field
from .config import AppConfig, load_app_config
from .storage import HistoryDB
from .task_manager import JobManager
from .ui import monitoring_page_html
from .ui import monitoring_js_path, monitoring_page_html
class CreateJobRequest(BaseModel):
@@ -387,6 +387,10 @@ def create_app(config: AppConfig | None = None) -> FastAPI:
def ui_root() -> str:
return monitoring_page_html(device_hostname=device_hostname)
@app.get("/ui/monitoring.js")
def ui_monitoring_js() -> FileResponse:
return FileResponse(str(monitoring_js_path()), media_type="application/javascript")
@app.websocket("/ws")
async def ws_endpoint(websocket: WebSocket, token: str = Query(default="")) -> None:
if not token or not secrets.compare_digest(token, app_config.screenjob_token):