VAPP-24: Dashboard: replace hardcoded Alerts KPI with real error count #27

Merged
David merged 2 commits from feat/dashboard-alerts-kpi-vapp-24 into main 2026-06-07 19:44:58 +02:00
Owner

VAPP-24: Dashboard: replace hardcoded Alerts KPI with real error count

The dashboard KPI strip hardcoded Kpi { label: "Alerts", value: "0" }, so it always read healthy. This derives the value from the event data the dashboard already fetches.

Changes

  • Compute the Alerts KPI as the count of error-severity events (EventSeverity::Error) in the last 24h from the list_events result the dashboard already loads. No new server fn. The server's events action caps results, so this is "errors among recent events", not a global total (noted in a code comment).
  • Accent the KPI value in the danger color when the count is non-zero, via a new "err" arm on the existing Kpi accent prop.
  • Wrap the KPI in a Link to the Events page so clicking it lands on the evidence. Route state cannot carry the severity filter today, so it navigates to plain /events (explicitly allowed by the issue).

Acceptance criteria

  • Alerts KPI shows the count of error-severity events from the last 24h of fetched events, not a hardcoded 0
  • Non-zero count is visually accented
  • Clicking the KPI lands on the Events page (plain /events; route state cannot carry the filter today)
  • just check passes

Refs VAPP-24.

## VAPP-24: Dashboard: replace hardcoded Alerts KPI with real error count The dashboard KPI strip hardcoded `Kpi { label: "Alerts", value: "0" }`, so it always read healthy. This derives the value from the event data the dashboard already fetches. ### Changes - Compute the Alerts KPI as the count of error-severity events (`EventSeverity::Error`) in the last 24h from the `list_events` result the dashboard already loads. No new server fn. The server's `events` action caps results, so this is "errors among recent events", not a global total (noted in a code comment). - Accent the KPI value in the danger color when the count is non-zero, via a new `"err"` arm on the existing `Kpi` `accent` prop. - Wrap the KPI in a `Link` to the Events page so clicking it lands on the evidence. Route state cannot carry the severity filter today, so it navigates to plain `/events` (explicitly allowed by the issue). ### Acceptance criteria - [x] Alerts KPI shows the count of error-severity events from the last 24h of fetched events, not a hardcoded 0 - [x] Non-zero count is visually accented - [x] Clicking the KPI lands on the Events page (plain `/events`; route state cannot carry the filter today) - [x] `just check` passes Refs VAPP-24.
feat(dashboard): derive Alerts KPI from real error events
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 54s
a81733e97c
Replace the hardcoded `Alerts` KPI value of "0" with a count of error-severity events from the last 24h of the events the dashboard already fetches. No new server fn: reuse the `list_events` result. Because the server's `events` action caps results, this is "errors among recent events", not a global total.

The KPI value is accented in the danger color when the count is non-zero (via a new `"err"` arm on the `Kpi` accent prop), and the whole KPI is wrapped in a `Link` to the Events page so clicking it lands on the evidence. Route state cannot carry the severity filter today, so it navigates to plain `/events`.

#VAPP-24
Merge branch 'main' into feat/dashboard-alerts-kpi-vapp-24
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
Check / fmt + clippy + build + tests (pull_request) Successful in 1m6s
b134279383
David merged commit 7e2e405d3a into main 2026-06-07 19:44:58 +02:00
David deleted branch feat/dashboard-alerts-kpi-vapp-24 2026-06-07 19:44:58 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Dependencies

No dependencies set

Reference
psa-systems/vervain-apps!27
No description provided.