diff --git a/controller/cuda_grid_controller/http_api.py b/controller/cuda_grid_controller/http_api.py index fc3ad86..8f6f897 100644 --- a/controller/cuda_grid_controller/http_api.py +++ b/controller/cuda_grid_controller/http_api.py @@ -85,6 +85,15 @@ def create_app( await dispatcher.handle(instance, "layout.set", req.layout) return {"ok": True, "instance": instance, "layout": req.layout} + @app.get("/layouts/{instance}") + async def layouts_for_instance(instance: str) -> dict[str, Any]: + inst = _check_instance(instance) + return { + "instance": instance, + "layouts": list(inst.layout_map.keys()), + "current": await state.get_layout(instance), + } + # ─── Overlays ────────────────────────────────────────────────── @app.post("/overlay/{instance}/add") diff --git a/controller/cuda_grid_controller/static/index.html b/controller/cuda_grid_controller/static/index.html index a6f4b2e..826b3b9 100644 --- a/controller/cuda_grid_controller/static/index.html +++ b/controller/cuda_grid_controller/static/index.html @@ -4,7 +4,7 @@ cuda-grid control - +