From a6c3fbfe504aa02a73c321dbdd882854330b69bd Mon Sep 17 00:00:00 2001 From: Matt Mabrey Date: Wed, 23 Sep 2026 12:31:55 -0700 Subject: [PATCH] T11.5: admin console Activity & usage card (CR-019) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New card in admin.html/admin.js, above the old per-browser Usage logs card (which T11.6 retires next). Filters (date range, project, user, tool) drive GET /api/usage/summary; two export buttons call GET /api/usage/export (raw / sanitized) and save the CSV via a Blob, same download pattern wp-usage.js already uses. Access: the card lives inside admin.html, already gated admin-only client-side by gateByRole() (unchanged) - a non-admin never sees the card. The underlying API is gated server-side by require_user_manager regardless (admin or project_super_user on >=1 project), independent of and stricter than the client-side gate, so a non-admin request is refused even if someone reached the endpoint directly. Accessibility (C1): every control is a real / + + + + + + + + +
Loading…
+
+ + +
+ + + +

Usage logs

Engagement recorded by both tools — the work package creator and the SOP wizard — diff --git a/html/admin.js b/html/admin.js index f339bd1..e1a5934 100644 --- a/html/admin.js +++ b/html/admin.js @@ -24,6 +24,7 @@ function reveal(){ loadNotifications(); loadComments(); loadAudit(); + loadActivity(); loadUsage(); } function showDenied(){ @@ -189,6 +190,19 @@ async function loadProjects(){ banner.style.display='none'; _adminProjects = json; renderProjects(); + populateActivityProjectFilter(); +} + +// The activity project filter reuses the same project list the Projects card +// already fetched — no second /api/projects call just to fill a