diff --git a/webui.py b/webui.py index b127c13..fa07c81 100644 --- a/webui.py +++ b/webui.py @@ -258,9 +258,10 @@ async def run_sync_job(job_id: str, command: str) -> None: summary_line = "" async for raw in proc.stdout: text = raw.decode(errors="replace").rstrip() - _jobs[job_id]["output"].append({"type": "log", "message": text}) if text.startswith("Done."): summary_line = text + else: + _jobs[job_id]["output"].append({"type": "log", "message": text}) await proc.wait() success = proc.returncode == 0 _jobs[job_id]["output"].append({ @@ -514,6 +515,7 @@ async def dashboard(): Preview Changes +
@@ -552,6 +554,21 @@ async def start_pull(): return {"job_id": job_id, "stream_url": f"/stream/{job_id}"} +@app.post("/compare") +async def start_compare(): + if _active_job is not None: + raise HTTPException(status_code=409, detail="A sync job is already running") + settings = _load_settings() + local = settings.get("local", {}) + if not local.get("url") or not local.get("token"): + return JSONResponse( + status_code=400, + content={"detail": "Local instance not configured — set LOCAL_OUTLINE_URL and LOCAL_OUTLINE_TOKEN env vars"}, + ) + job_id = _new_job("compare") + return {"job_id": job_id, "stream_url": f"/stream/{job_id}"} + + @app.post("/push") async def start_push(): if _active_job is not None: