Run events in the database: Runs page and Agent run card on the Dokploy Portal

Snapshot of D:\Ecw Process 65c92c5 (2026-10-30).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ManikandanandClaude Opus 5.5 committed 2026-10-30 11:28:26 +05:30
1 parent d500f750da
commit 840272032a
9 files changed
+655 -46

No files matched your search

+18
View File
@@ -136,3 +136,21 @@ class SqlResultsRepo:
f"SELECT TOP 200 {_SELECT_COLUMNS} FROM {results_db.TABLE} "
f"WHERE claim_no LIKE ? ORDER BY run_at DESC, s_no, id",
[f"%{claim_no}%"])
# ── Run events (2026-10-30): the Runs page on a server Portal ─────────
def run_ids(self) -> list:
"""Every Run with events, newest first (at most 500)."""
return [r["run_id"] for r in self._query(
"SELECT TOP 500 run_id FROM dbo.CV_RunEvent "
"GROUP BY run_id ORDER BY run_id DESC")]
def run_event_lines(self, run_ids) -> list:
"""(run_id, JSON line) for those Runs, in the order written."""
run_ids = list(run_ids)[:500]
if not run_ids:
return []
marks = ", ".join("?" * len(run_ids))
return [(r["run_id"], r["body"]) for r in self._query(
f"SELECT run_id, body FROM dbo.CV_RunEvent "
f"WHERE run_id IN ({marks}) ORDER BY run_id, id", run_ids)]