admin: overview redesign, device scope, one formatting contract (milestone 39)

The Overview page takes the decided visual language (specs/ui-visual-redesign.md): four centred totals with their Activity links, a smoothed area chart of total and blocked queries with point hover and a tooltip beside the point, a stacked client chart in eight distinct hues plus one Other band, and a card row with the cache hit rate, the query types as a single-hue ramp ring, and the upstream breakdown.

GET /api/overview takes a client parameter; the scoped read uses idx_query_log_ts and the cache keeps scoped slots. The device selector beside the period selector is URL state, so a scoped view is a link, and the tile links carry the scope into Activity.

All numbers go through admin/src/lib/format.ts: grouped counts, two-decimal percentages, one-decimal rates, durations as the two largest nonzero units. A sweep test refuses toFixed, toLocaleString, Intl.NumberFormat and padStart anywhere else.

Chrome: one 4px radius from the metrics constants, shared Card with a prominent title and description, the sidebar grouped into Monitoring and System with a status block (protection, queries per minute on Overview, uptime), and the accent darkened to 5.43:1 on its wash.

Not built: the spec's ranked-list primitive, which has no consumer and no API rows. Codex could not review sessions B to D, its endpoint returned 404 for every call on 2026-09-03; the owner accepted the smoke-server screenshots.
This commit is contained in:
2026-09-03 17:16:24 +02:00
parent e656670dd4
commit 209c1c77a9
60 changed files with 2329 additions and 1009 deletions
@@ -0,0 +1,14 @@
import { parseClient } from "./clientScope";
test("one address passes, and nothing else does", () => {
expect(parseClient("192.0.2.30")).toBe("192.0.2.30");
expect(parseClient("2001:db8::1")).toBe("2001:db8::1");
expect(parseClient(undefined)).toBeUndefined();
expect(parseClient("")).toBeUndefined();
expect(parseClient(7)).toBeUndefined();
// A list is the Activity filter's grammar, not this page's.
expect(parseClient("192.0.2.30,192.0.2.31")).toBeUndefined();
// Longer than any address the server stores.
expect(parseClient("1".repeat(46))).toBeUndefined();
expect(parseClient("1".repeat(45))).toBe("1".repeat(45));
});