Refactor LED control UI to Vue3
This commit is contained in:
@@ -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}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user