Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /amabito_veronica /src /veronica /ui /router.py
| # src/veronica/ui/router.py | |
| """FastAPI router for serving the Veronica web UI static files.""" | |
| from __future__ import annotations | |
| from pathlib import Path | |
| from fastapi import APIRouter | |
| from fastapi.responses import FileResponse, RedirectResponse | |
| from fastapi.staticfiles import StaticFiles | |
| STATIC_DIR = Path(__file__).parent / "static" | |
| router = APIRouter(tags=["ui"]) | |
| def mount_static(app: object) -> None: | |
| """Mount static files on the FastAPI app (call after app creation).""" | |
| app.mount("/ui/static", StaticFiles(directory=str(STATIC_DIR)), name="ui_static") # type: ignore[attr-defined] | |
| async def root_redirect() -> RedirectResponse: | |
| """Redirect root to the dashboard UI.""" | |
| return RedirectResponse(url="/ui/") | |
| async def dashboard_index() -> FileResponse: | |
| """Serve the dashboard HTML.""" | |
| return FileResponse(str(STATIC_DIR / "index.html")) | |
| async def events_page() -> FileResponse: | |
| """Serve the event log HTML.""" | |
| return FileResponse(str(STATIC_DIR / "events.html")) | |
| async def incident_page() -> FileResponse: | |
| """Serve the incident detail HTML.""" | |
| return FileResponse(str(STATIC_DIR / "incident.html")) | |
| async def policies_page() -> FileResponse: | |
| """Serve the policy editor HTML.""" | |
| return FileResponse(str(STATIC_DIR / "policies.html")) | |
| async def replay_page() -> FileResponse: | |
| """Serve the incident replay HTML.""" | |
| return FileResponse(str(STATIC_DIR / "replay.html")) | |
| async def rollouts_page() -> FileResponse: | |
| """Serve the rollout pipeline HTML.""" | |
| return FileResponse(str(STATIC_DIR / "rollouts.html")) | |
Xet Storage Details
- Size:
- 1.94 kB
- Xet hash:
- a330c93058522b154e613611b90e3fa63640f5d65bfa597c33695c6e8c3391b6
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.