From dc44452834a6f17d67ee09cfaa13c021d16d8b6a Mon Sep 17 00:00:00 2001 From: domverse Date: Mon, 30 Mar 2026 08:51:14 +0200 Subject: [PATCH] feat: add doc type and saved view counters to dashboard Co-Authored-By: Claude Sonnet 4.6 --- CLAUDE.md | 6 +++++- app/ui/routes.py | 21 +++++++++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 2b28033..1dcb421 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1 +1,5 @@ -@AGENTS.MD \ No newline at end of file +@AGENTS.MD + +## Workflow + +After every successful test run, commit and push to origin. \ No newline at end of file diff --git a/app/ui/routes.py b/app/ui/routes.py index 3ac192e..228cce7 100644 --- a/app/ui/routes.py +++ b/app/ui/routes.py @@ -74,15 +74,24 @@ async def doc_counts_fragment(request: Request, session: Session = Depends(get_s all_counts = await asyncio.gather( *[_fetch_count(url, tok) for _, url, tok in tasks], *[_fetch_count(url, tok, "/api/tags/") for _, url, tok in tasks], + *[_fetch_count(url, tok, "/api/document_types/") for _, url, tok in tasks], + *[_fetch_count(url, tok, "/api/saved_views/") for _, url, tok in tasks], ) - doc_counts = all_counts[:n] - tag_counts = all_counts[n:] + doc_counts = all_counts[0 * n : 1 * n] + tag_counts = all_counts[1 * n : 2 * n] + dt_counts = all_counts[2 * n : 3 * n] + view_counts = all_counts[3 * n : 4 * n] parts = [] - for (label, _, _), docs, tags in zip(tasks, doc_counts, tag_counts): - doc_val = str(docs) if docs is not None else "?" - tag_val = str(tags) if tags is not None else "?" - parts.append(f"{label}: {doc_val} docs, {tag_val} tags") + for (label, _, _), docs, tags, dts, views in zip(tasks, doc_counts, tag_counts, dt_counts, view_counts): + doc_val = str(docs) if docs is not None else "?" + tag_val = str(tags) if tags is not None else "?" + dt_val = str(dts) if dts is not None else "?" + view_val = str(views) if views is not None else "?" + parts.append( + f"{label}: {doc_val} docs, {tag_val} tags," + f" {dt_val} doc types, {view_val} views" + ) html = ( '
'