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

View File

@@ -161,3 +161,14 @@ code { background: rgba(255,255,255,0.05); padding: 0 0.25rem; border-radius: 3p
.badge.busy { display: inline-block; animation: spin 1.2s linear infinite; transform-origin: 50% 50%; }
.progress-wrap { display: flex; align-items: center; gap: 6px; }
.step-text { margin-top: 2px; color: var(--muted); font-size: 0.7rem; font-style: italic; font-variant-numeric: tabular-nums; }
.docs-link {
margin-left: auto;
font-size: 0.85rem;
color: #8ab4f8;
text-decoration: none;
padding: 0.2rem 0.6rem;
border: 1px solid #3c4043;
border-radius: 4px;
}
.docs-link:hover { background: #2d2f31; }

View File

@@ -12,6 +12,7 @@
<header>
<h1>cosma-qc</h1>
<span class="sub">post-acquisition QC · lingbot-map pipeline</span>
<a class="docs-link" href="/cosma-qc/docs/" target="_blank">📖 docs</a>
</header>
<section id="monitor" hx-get="partials/monitor" hx-trigger="load, every 5s" hx-swap="innerHTML">