feat: add doc type and saved view counters to dashboard
All checks were successful
Deploy / deploy (push) Successful in 34s
All checks were successful
Deploy / deploy (push) Successful in 34s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1 +1,5 @@
|
|||||||
@AGENTS.MD
|
@AGENTS.MD
|
||||||
|
|
||||||
|
## Workflow
|
||||||
|
|
||||||
|
After every successful test run, commit and push to origin.
|
||||||
@@ -74,15 +74,24 @@ async def doc_counts_fragment(request: Request, session: Session = Depends(get_s
|
|||||||
all_counts = await asyncio.gather(
|
all_counts = await asyncio.gather(
|
||||||
*[_fetch_count(url, tok) for _, url, tok in tasks],
|
*[_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/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]
|
doc_counts = all_counts[0 * n : 1 * n]
|
||||||
tag_counts = all_counts[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 = []
|
parts = []
|
||||||
for (label, _, _), docs, tags in zip(tasks, doc_counts, tag_counts):
|
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 "?"
|
doc_val = str(docs) if docs is not None else "?"
|
||||||
tag_val = str(tags) if tags is not None else "?"
|
tag_val = str(tags) if tags is not None else "?"
|
||||||
parts.append(f"<span><strong>{label}:</strong> {doc_val} docs, {tag_val} tags</span>")
|
dt_val = str(dts) if dts is not None else "?"
|
||||||
|
view_val = str(views) if views is not None else "?"
|
||||||
|
parts.append(
|
||||||
|
f"<span><strong>{label}:</strong> {doc_val} docs, {tag_val} tags,"
|
||||||
|
f" {dt_val} doc types, {view_val} views</span>"
|
||||||
|
)
|
||||||
|
|
||||||
html = (
|
html = (
|
||||||
'<div style="display:flex; gap:1.5rem; flex-wrap:wrap; margin-bottom:1rem; font-size:0.95em;">'
|
'<div style="display:flex; gap:1.5rem; flex-wrap:wrap; margin-bottom:1rem; font-size:0.95em;">'
|
||||||
|
|||||||
Reference in New Issue
Block a user