Refactor LED control UI to Vue3

This commit is contained in:
sealks
2026-07-17 02:10:08 +08:00
parent fe906e028b
commit ba9f0044f3
16 changed files with 1906 additions and 752 deletions
+10 -5
View File
@@ -13,6 +13,11 @@ STATIC_DIR = WEB_DIR / "static"
router = APIRouter()
HTML_HEADERS = {
"Cache-Control": "no-store",
"Clear-Site-Data": '"cache"',
}
ALLOWED_ACTIONS = {
"page.next",
"page.prev",
@@ -20,12 +25,14 @@ ALLOWED_ACTIONS = {
"security.alert",
"timeline.pause",
"timeline.resume",
"motion.mode",
"scenario.focus",
}
@router.get("/", include_in_schema=False)
async def admin_index() -> FileResponse:
return FileResponse(STATIC_DIR / "admin" / "index.html")
return FileResponse(STATIC_DIR / "admin" / "index.html", headers=HTML_HEADERS)
@router.get("/output/{tile_id}", include_in_schema=False)
@@ -34,12 +41,12 @@ async def output_index(tile_id: str) -> FileResponse:
tiles.get(tile_id)
except KeyError as exc:
raise HTTPException(status_code=404, detail=f"Unknown output tile: {tile_id}") from exc
return FileResponse(STATIC_DIR / "output" / "index.html")
return FileResponse(STATIC_DIR / "output" / "index.html", headers=HTML_HEADERS)
@router.get("/wall-app", include_in_schema=False)
async def wall_app() -> FileResponse:
return FileResponse(STATIC_DIR / "output" / "index.html")
return FileResponse(STATIC_DIR / "output" / "index.html", headers=HTML_HEADERS)
@router.get("/favicon.ico", include_in_schema=False)
@@ -106,7 +113,6 @@ async def switch_scene(scene_id: str) -> dict:
)
sync.register_command(commit, payload)
await hub.broadcast(prepare, "admin", "outputs")
await hub.broadcast(commit, "admin", "outputs")
return payload
@@ -149,4 +155,3 @@ async def sync_status() -> dict:
async def telemetry(sample: PerformanceSample) -> dict:
sync.telemetry(sample)
return {"ok": True}