feat: docs Sphinx pipeline + lien dashboard header

This commit is contained in:
Flag
2026-04-23 21:17:49 +00:00
parent 1bbb6c8e6d
commit 91b25f0aae
90 changed files with 9557 additions and 5 deletions

View File

@@ -132,6 +132,7 @@ async def lifespan(_: FastAPI):
app = FastAPI(title="cosma-qc", lifespan=lifespan)
templates = Jinja2Templates(directory=Path(__file__).parent / "templates")
app.mount("/static", StaticFiles(directory=Path(__file__).parent / "static"), name="static")
app.mount("/docs", StaticFiles(directory=Path("/app/docs"), html=True), name="docs")
_viser_probe_cache: dict[str, tuple[float, bool]] = {}
@@ -220,12 +221,13 @@ def _build_acquisitions():
# Mask the viser link when the demo.py that was serving it has since died.
if j["status"] == "done" and j["viser_url"] and not _viser_alive(j["viser_url"]):
d["viser_url"] = None
# GLB download link: served by http.server 8300 on the worker
# GLB download link: only when glb_path is set in DB (conversion confirmed)
glb_url = None
if d.get("status") == "done" and d.get("frames_dir") and d.get("worker_host"):
frames_basename = (d["frames_dir"] or "").rstrip("/").split("/")[-1]
if frames_basename:
glb_url = f"http://{d['worker_host']}:8300/{frames_basename}/reconstruction.glb"
glb_path = d.get("glb_path")
if glb_path and d.get("worker_host"):
dir_name = glb_path.rstrip("/").split("/")[-2]
file_name = glb_path.rstrip("/").split("/")[-1]
glb_url = f"http://{d['worker_host']}:8300/{dir_name}/{file_name}"
d["glb_url"] = glb_url
by_acq.setdefault(j["acquisition_id"], []).append(d)
by_acq_total[j["acquisition_id"]] = by_acq_total.get(j["acquisition_id"], 0) + dur_s