The dashboard shows query tiles and a stacked queries-over-time chart drawn with Chart.js in the active theme's colours, with a node filter #121

Open
opened 2026-10-31 12:42:10 -04:00 by claude · 0 comments
Owner
  • Draft: PQ-18
  • Priority: high
  • Agent: console-coder
  • Depends on: #120
  • Decisions: Q-PQ-2, Q-PQ-12, R2-STATS-NODE

Why

This is the first visible half of #110, and it lays the chart foundation and the node filter #122, #123 and #124 reuse.

What changes

  • src/angular/package.json: add @coreui/angular-chartjs (the 5.x line that matches @coreui/angular 5.7) and chart.js 4.x, both MIT. Record the bundle size before and after in the PR; the charts load with the dashboard route only.
  • src/angular/src/app/shared/charts/ (new): a chart-theme helper that reads colours from the CoreUI CSS variables of the active theme (body colour, border colour, the palette's primary, success, danger, warning and info) and rebuilds chart options when ThemeService.resolvedColorScheme() or ThemeService.palette() changes (src/angular/src/app/core/theme/theme.service.ts:61-82). Every chart in #122 to #124 uses it.
  • src/angular/src/app/features/dashboard/:
    • A statistics service that holds the selected range and node as signals and passes nodeId on every statistics call.
    • A node selector ("All nodes" and each entry of GET api/statistics/nodes), shown only when more than one node is listed.
    • Tiles: total, blocked and %, cached %, NXDOMAIN, average response time.
    • Queries over time: a stacked bar or area chart of allowed (not cached), cached and blocked per bucket.
    • A range selector (24 h / 7 d / 30 d); 24 h uses minute buckets, the others hour buckets.
  • Tiles and charts degrade to "no permission" without querylog:read, like fetchCount (dashboard-stats.service.ts:58-69).

Acceptance

  • Spec fails first: the summary tile shows "25 %" for 1 blocked of 4.
  • Spec: a bucket with total 10, blocked 3, cached 4 gives datasets allowed 3, cached 4, blocked 3.
  • Spec: with two nodes listed, choosing one sends its nodeId on the summary and time-series calls; with one node the selector is hidden.
  • Spec: switching resolvedColorScheme from light to dark changes the chart's tick colour to the dark theme's body colour.
  • Lint, format and test clean; smoke check in light and dark mode.
  • README dashboard text, including the node filter.

Source

  • audit-feature-parity.md §2A #1.
  • Owner decision 2026-10-31 (Q-PQ-2): "CoreUI Chart.js".
  • Owner decision 2026-10-31 (Q-PQ-12): "queries over time (stacked allowed/blocked/cached)"; charts follow light and dark themes.
  • Owner decision 2026-10-31, round 2 (R2-STATS-NODE): "dashboard shows all nodes or one".
- **Draft:** PQ-18 - **Priority:** high - **Agent:** console-coder - **Depends on:** #120 - **Decisions:** Q-PQ-2, Q-PQ-12, R2-STATS-NODE ### Why This is the first visible half of #110, and it lays the chart foundation and the node filter #122, #123 and #124 reuse. ### What changes - `src/angular/package.json`: add `@coreui/angular-chartjs` (the 5.x line that matches `@coreui/angular` 5.7) and `chart.js` 4.x, both MIT. Record the bundle size before and after in the PR; the charts load with the dashboard route only. - `src/angular/src/app/shared/charts/` (new): a chart-theme helper that reads colours from the CoreUI CSS variables of the active theme (body colour, border colour, the palette's primary, success, danger, warning and info) and rebuilds chart options when `ThemeService.resolvedColorScheme()` or `ThemeService.palette()` changes (`src/angular/src/app/core/theme/theme.service.ts:61-82`). Every chart in #122 to #124 uses it. - `src/angular/src/app/features/dashboard/`: - A statistics service that holds the selected range and node as signals and passes `nodeId` on every statistics call. - A node selector ("All nodes" and each entry of `GET api/statistics/nodes`), shown only when more than one node is listed. - Tiles: total, blocked and %, cached %, NXDOMAIN, average response time. - Queries over time: a stacked bar or area chart of allowed (not cached), cached and blocked per bucket. - A range selector (24 h / 7 d / 30 d); 24 h uses minute buckets, the others hour buckets. - Tiles and charts degrade to "no permission" without `querylog:read`, like `fetchCount` (`dashboard-stats.service.ts:58-69`). ### Acceptance - [ ] Spec fails first: the summary tile shows "25 %" for 1 blocked of 4. - [ ] Spec: a bucket with total 10, blocked 3, cached 4 gives datasets allowed 3, cached 4, blocked 3. - [ ] Spec: with two nodes listed, choosing one sends its `nodeId` on the summary and time-series calls; with one node the selector is hidden. - [ ] Spec: switching `resolvedColorScheme` from light to dark changes the chart's tick colour to the dark theme's body colour. - [ ] Lint, format and test clean; smoke check in light and dark mode. - [ ] README dashboard text, including the node filter. ### Source - `audit-feature-parity.md` §2A #1. - Owner decision 2026-10-31 (Q-PQ-2): "CoreUI Chart.js". - Owner decision 2026-10-31 (Q-PQ-12): "queries over time (stacked allowed/blocked/cached)"; charts follow light and dark themes. - Owner decision 2026-10-31, round 2 (R2-STATS-NODE): "dashboard shows all nodes or one".
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
lantea-one/ninlil#121
No description provided.