feat: docs Sphinx pipeline + lien dashboard header
This commit is contained in:
12
app/main.py
12
app/main.py
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user