Spaces:
Running
Running
| """Web UI route — serves the single-page dashboard.""" | |
| from __future__ import annotations | |
| from pathlib import Path | |
| from fastapi import APIRouter | |
| from fastapi.responses import HTMLResponse, Response | |
| router = APIRouter(tags=["ui"]) | |
| UI_HTML_PATH = Path(__file__).parent / "ui.html" | |
| async def dashboard(): | |
| """Serve the main dashboard UI.""" | |
| content = UI_HTML_PATH.read_text(encoding="utf-8") | |
| return Response( | |
| content=content, | |
| media_type="text/html", | |
| headers={"Cache-Control": "no-cache, no-store, must-revalidate"}, | |
| ) | |