diff --git a/app.py b/app.py index c9a1ccd..b46edc6 100644 --- a/app.py +++ b/app.py @@ -96,6 +96,16 @@ async def dashboard_preview(theme_id: str, ext: str): raise HTTPException(404) +@app.get("/dashboard/{theme_id}/{path:path}") +async def dashboard_static(theme_id: str, path: str): + from models.dashboard import BUILTIN_DASHBOARDS_DIR, USER_DASHBOARDS_DIR + for base in [BUILTIN_DASHBOARDS_DIR, USER_DASHBOARDS_DIR]: + filepath = base / theme_id / path + if filepath.exists() and filepath.is_file(): + return FileResponse(filepath) + raise HTTPException(404) + + @app.get("/scene/{scene_id}/preview.{ext}") async def scene_preview(scene_id: str, ext: str): from models.scene import SCENES_DIR