Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Make the Alerts overview answer what is broken first

rcourtmanddd6ba04c60a
diff --git a/docs/release-control/v6/internal/subsystems/alerts.md b/docs/release-control/v6/internal/subsystems/alerts.md
index 3c89b76df0..f51a3f5a9f 100644
--- a/docs/release-control/v6/internal/subsystems/alerts.md
+++ b/docs/release-control/v6/internal/subsystems/alerts.md
@@ -2851,6 +2851,27 @@ notification truth: the delivery log card must not resolve, suppress, or
re-evaluate alerts, and it does not alter the `AlertConfig.enabled` versus
`activationState` ownership boundary above.
+### Overview states paused delivery once and keeps rows scannable
+
+The Alerts overview is where a notification lands, so it answers "what is
+broken now" before configuration. When notification delivery is gated off,
+`OverviewTab` renders the shared `AlertDeliveryPausedCard` once, driven by
+`useAlertDeliveryPausedReason` (the same activation reading the destinations
+tab uses), with overview wording and a link to the Notifications route. While
+that banner is shown, per-alert delivery lines for the global holds
+`notifications_inactive` and `notifications_disabled` are suppressed; every
+alert-specific hold (cooldown, quiet hours, rate limit, flapping, suppression
+window, monitor-only) still renders on its row. With detection switched off
+the banner must not claim Pulse is still detecting alerts. Active alerts
+render as compact rows: severity on the left edge, icon and badge, the alert
+type, the start time as a locale-aware relative age on the overview's minute
+clock, Acknowledge, Snooze and Investigate visible, and Timeline plus
+resource monitoring policy behind a More disclosure that also closes an open
+timeline. A one-line summary beside the heading counts open alerts by
+severity and the triggered-in-24h total; threshold override counts are
+configuration and do not appear on the overview. None of this changes alert
+lifecycle, acknowledgement, snooze, or delivery evaluation.
+
### External watchdog is Pulse-availability evidence, not notification delivery
The Alerts destinations surface owns the operator contract for an external
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index bd2fbe8a17..6e729b6b3f 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -7835,6 +7835,18 @@ layouts must retain associated labels and avoid horizontal overflow. Escalation
level delays and repeat intervals share the rendered 5–180 minute bounds; the
feature state clamps typed values before they can leave the control surface.
+### Alert overview rows and paused-delivery copy localize through the catalogs
+
+The alert overview summary (`alerts.overview.summary.*`), the row disclosure
+(`alerts.overview.action.moreActions` / `lessActions`) and every string of the
+shared paused-delivery banner (`alerts.delivery.paused.*`, used by both the
+overview and the destinations tab) route through `alertOverviewPresentation`
+or `alertDestinationsPresentation` and the English, German and Spanish
+catalogs. Relative alert ages format with `Intl.RelativeTimeFormat` in the
+active locale rather than the English-only `formatRelativeTime`. Proofs live
+in `frontend-modern/src/i18n/__tests__/i18n.test.ts` and
+`frontend-modern/src/utils/__tests__/alertOverviewPresentation.test.ts`.
+
### Alert groups use the shared localization boundary
Alert group disclosure and group acknowledgement copy routes through
diff --git a/docs/release-control/v6/internal/subsystems/security-privacy.md b/docs/release-control/v6/internal/subsystems/security-privacy.md
index cad361cf70..241e41af8d 100644
--- a/docs/release-control/v6/internal/subsystems/security-privacy.md
+++ b/docs/release-control/v6/internal/subsystems/security-privacy.md
@@ -2963,3 +2963,11 @@ delivers push notifications, and that it does not provide remote access to the
web UI. The earlier "secure remote web access" wording described a capability
that never existed. No data flow changed, and the published docs mirror stays
identical.
+
+### Alert overview locale additions
+
+The shared locale catalogs gain alert overview summary, row-disclosure and
+paused-delivery banner strings in English, German and Spanish. This is alert
+presentation copy only: no API token name, scope preset, privacy disclosure,
+telemetry statement or security term changes, and no request, storage or
+authorization path moves.
diff --git a/frontend-modern/browser-verification/4ade034180adab1f.json b/frontend-modern/browser-verification/4ade034180adab1f.json
new file mode 100644
index 0000000000..30b057696a
--- /dev/null
+++ b/frontend-modern/browser-verification/4ade034180adab1f.json
@@ -0,0 +1,62 @@
+{
+ "version": 1,
+ "base_sha": "e6167ef616dd326effc21114a549316e78fd3a9e",
+ "verified_at": "2026-10-04T23:22:09Z",
+ "result": "passed",
+ "changed_paths": [
+ "frontend-modern/src/features/alerts/AlertDeliveryPausedCard.tsx",
+ "frontend-modern/src/features/alerts/AlertOverviewActiveAlertsSection.tsx",
+ "frontend-modern/src/features/alerts/AlertOverviewAlertCard.tsx",
+ "frontend-modern/src/features/alerts/AlertOverviewStatsCards.tsx",
+ "frontend-modern/src/features/alerts/OverviewTab.tsx",
+ "frontend-modern/src/features/alerts/tabs/DestinationsTab.tsx",
+ "frontend-modern/src/features/alerts/useAlertDeliveryPausedReason.ts",
+ "frontend-modern/src/features/alerts/useAlertOverviewState.ts",
+ "frontend-modern/src/i18n/messages.de.ts",
+ "frontend-modern/src/i18n/messages.es.ts",
+ "frontend-modern/src/i18n/messages.ts",
+ "frontend-modern/src/utils/alertDestinationsPresentation.ts",
+ "frontend-modern/src/utils/alertOverviewPresentation.ts"
+ ],
+ "content_sha256": {
+ "frontend-modern/src/features/alerts/AlertDeliveryPausedCard.tsx": "3c96dbb9842fdee2b6533b99babedbfd91264a672d4053bddc7f1350fd863e22",
+ "frontend-modern/src/features/alerts/AlertOverviewActiveAlertsSection.tsx": "45c58d51fa0268f84938584ebb7de04c632ed9c980bbb56b1e22d6948bdd7fe2",
+ "frontend-modern/src/features/alerts/AlertOverviewAlertCard.tsx": "d383b427daf124b0afcf8da168946bc7b47b4a9c0a912f659479396c26b2dfc1",
+ "frontend-modern/src/features/alerts/AlertOverviewStatsCards.tsx": "57bb45e79b43df83abefce5e63972a66528b3c42c3702a3192e610f547a7bcea",
+ "frontend-modern/src/features/alerts/OverviewTab.tsx": "d8b94a9debcc5c0ea77d5dbcc39bc73aa93da0dc91824555d7aac0c91735638f",
+ "frontend-modern/src/features/alerts/tabs/DestinationsTab.tsx": "7a8d339342ced3965bdc9b05ba647b400dbc3b61ddc8f9e6e63f3baa08e497dd",
+ "frontend-modern/src/features/alerts/useAlertDeliveryPausedReason.ts": "4acfef78146f4d4e583361e402f2a1afa522cffc0870b5ff3cc2c489caa20330",
+ "frontend-modern/src/features/alerts/useAlertOverviewState.ts": "1290fc4d8a187dce20cd5dc3cb4ccf269f4fb086f797aa3c61eb5f1cde1cdbd7",
+ "frontend-modern/src/i18n/messages.de.ts": "159c093e34592dbe66a31116e9369fea833dd3fda48eb0df1e33896e1a738a3d",
+ "frontend-modern/src/i18n/messages.es.ts": "d6c2141132dc9fad5de7f3946e424b0e41e731690706ea0a0fc545f3a0446fdc",
+ "frontend-modern/src/i18n/messages.ts": "72e7c4e2918ca7f89af200a8ae2347be9b27b73b05eb69ea0d09842adf456912",
+ "frontend-modern/src/utils/alertDestinationsPresentation.ts": "ab0d54042c83529c8ccdcf88ec6490e27de610ba57821ba2196de07124edc3be",
+ "frontend-modern/src/utils/alertOverviewPresentation.ts": "c13780cb9212541e402012de29ee181354ba25fd85d307da58d79bc6f8dea538"
+ },
+ "routes": [
+ "/alerts/overview",
+ "/alerts/notifications"
+ ],
+ "viewports": [
+ {
+ "width": 1440,
+ "height": 900
+ },
+ {
+ "width": 390,
+ "height": 844
+ }
+ ],
+ "states": [
+ "Mock estate with 19 active alerts (2 critical, 17 warning) and notification delivery not activated. Before: each alert was a tinted card with five buttons and a repeated \"Notification delivery not turned on\" line, a three-row stats table sat above, 3 alerts fit at 1440x900. After: one paused-delivery banner with overview wording, a Set up where alerts go link and Turn on delivery; no per-row global delivery line; a summary line (2 critical, 17 warning, Triggered (24h) 19); 5 alerts above the fold.",
+ "Rows keep resource name, (type), severity badge, node and a relative start age with the full localized start time on hover; meta line (limit, alert-specific delivery holds, snooze expiry) only when present.",
+ "German locale: banner, summary, buttons (Bestaetigen, Zurueckstellen, Mehr) and relative age (vor 20 Min.) all localized.",
+ "Notifications tab still shows the paused banner through the shared hook with its destinations wording; the banner title colour is now readable (was text-amber-900/25).",
+ "Phone 390x844 dark: banner stacks, summary wraps under the heading, row actions wrap to two lines, More reveals Timeline and Monitoring."
+ ],
+ "interactions": [
+ "Clicked More on the first alert: Timeline and Monitoring appeared and the control read Less with aria-expanded true.",
+ "Clicked Timeline: the incident timeline loaded with filters and note box; Hide Timeline closed it while the disclosure stayed open; unit test covers Less closing an open timeline.",
+ "Repeated the More and Timeline interactions at phone width in dark mode; no page errors."
+ ]
+}
diff --git a/frontend-modern/src/features/alerts/AlertDeliveryPausedCard.tsx b/frontend-modern/src/features/alerts/AlertDeliveryPausedCard.tsx
index 697f91f258..6da1ddc63e 100644
--- a/frontend-modern/src/features/alerts/AlertDeliveryPausedCard.tsx
+++ b/frontend-modern/src/features/alerts/AlertDeliveryPausedCard.tsx
@@ -1,3 +1,5 @@
+import { Show } from 'solid-js';
+import { A } from '@solidjs/router';
import BellOffIcon from 'lucide-solid/icons/bell-off';
import { Card } from '@/components/shared/Card';
@@ -6,17 +8,23 @@ import {
getAlertDestinationsDeliveryPausedActionLabel,
getAlertDestinationsDeliveryPausedDescription,
getAlertDestinationsDeliveryPausedTitle,
+ getAlertDestinationsDeliverySetupLinkLabel,
} from '@/utils/alertDestinationsPresentation';
interface AlertDeliveryPausedCardProps {
reason: AlertDestinationsDeliveryPausedReason;
activating: boolean;
onActivate: () => void;
+ // The overview states the gate once for every listed alert and links to
+ // where destinations are set up; the destinations tab is that place.
+ surface?: 'destinations' | 'overview';
+ setupHref?: string;
}
-// Shown on the destinations surface whenever notification delivery is gated
-// off. Without it a user configures a destination, sends a passing test, and
-// never learns that live alerts are being dropped before they reach the queue.
+// Shown wherever notification delivery being gated off changes what the user
+// should believe. Without it a user configures a destination, sends a passing
+// test, and never learns that live alerts are being dropped before they reach
+// the queue; on the overview it replaces a warning repeated on every alert.
export function AlertDeliveryPausedCard(props: AlertDeliveryPausedCardProps) {
return (
<Card
@@ -29,22 +37,34 @@ export function AlertDeliveryPausedCard(props: AlertDeliveryPausedCardProps) {
<div class="flex min-w-0 items-start gap-3">
<BellOffIcon class="mt-0.5 h-4 w-4 shrink-0 text-amber-700 dark:text-amber-300" />
<div class="min-w-0">
- <h3 class="text-sm font-semibold text-amber-900/25 dark:text-amber-100">
+ <h3 class="text-sm font-semibold text-amber-900 dark:text-amber-100">
{getAlertDestinationsDeliveryPausedTitle()}
</h3>
<p class="mt-1 text-sm leading-6 text-amber-800 dark:text-amber-200">
- {getAlertDestinationsDeliveryPausedDescription(props.reason)}
+ {getAlertDestinationsDeliveryPausedDescription(props.reason, props.surface)}
</p>
</div>
</div>
- <button
- type="button"
- class="inline-flex shrink-0 items-center justify-center gap-2 rounded-md border border-amber-300 bg-transparent px-3 py-1.5 text-sm font-medium text-amber-800 transition hover:bg-amber-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-amber-700 dark:text-amber-200 dark:hover:bg-amber-900/30"
- disabled={props.activating}
- onClick={props.onActivate}
- >
- {getAlertDestinationsDeliveryPausedActionLabel()}
- </button>
+ <div class="flex shrink-0 flex-wrap items-center gap-3">
+ <Show when={props.setupHref}>
+ {(href) => (
+ <A
+ href={href()}
+ class="text-sm font-medium text-amber-800 underline underline-offset-2 hover:text-amber-900 dark:text-amber-200 dark:hover:text-amber-100"
+ >
+ {getAlertDestinationsDeliverySetupLinkLabel()}
+ </A>
+ )}
+ </Show>
+ <button
+ type="button"
+ class="inline-flex shrink-0 items-center justify-center gap-2 rounded-md border border-amber-300 bg-transparent px-3 py-1.5 text-sm font-medium text-amber-800 transition hover:bg-amber-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-amber-700 dark:text-amber-200 dark:hover:bg-amber-900/30"
+ disabled={props.activating}
+ onClick={props.onActivate}
+ >
+ {getAlertDestinationsDeliveryPausedActionLabel()}
+ </button>
+ </div>
</div>
</Card>
);
diff --git a/frontend-modern/src/features/alerts/AlertOverviewActiveAlertsSection.tsx b/frontend-modern/src/features/alerts/AlertOverviewActiveAlertsSection.tsx
index f61a8ee44e..4bd52b3d7e 100644
--- a/frontend-modern/src/features/alerts/AlertOverviewActiveAlertsSection.tsx
+++ b/frontend-modern/src/features/alerts/AlertOverviewActiveAlertsSection.tsx
@@ -15,6 +15,7 @@ import {
} from '@/utils/alertOverviewPresentation';
import { AlertOverviewAlertCard } from './AlertOverviewAlertCard';
+import { AlertOverviewStatsCards } from './AlertOverviewStatsCards';
import { useAlertGroupExpansion } from './useAlertGroupExpansion';
import { AlertIncidentSynthesisSummary } from './AlertIncidentSynthesisSummary';
import type { AlertIncidentTimelineState } from './useAlertIncidentTimelineState';
@@ -27,13 +28,17 @@ interface AlertOverviewActiveAlertsSectionProps {
alertsDisabled: boolean;
showAcknowledged: boolean;
setShowAcknowledged: (value: boolean) => void;
+ deliveryPausedGlobally?: boolean;
}
export function AlertOverviewActiveAlertsSection(props: AlertOverviewActiveAlertsSectionProps) {
const { isGroupExpanded, toggleGroup } = useAlertGroupExpansion();
return (
<div>
- <SectionHeader title={getAlertOverviewActiveSectionTitle()} size="md" class="mb-3" />
+ <div class="mb-3 flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1">
+ <SectionHeader title={getAlertOverviewActiveSectionTitle()} size="md" />
+ <AlertOverviewStatsCards state={props.state} />
+ </div>
<Show
when={Object.keys(props.activeAlerts).length > 0}
fallback={
@@ -124,7 +129,7 @@ export function AlertOverviewActiveAlertsSection(props: AlertOverviewActiveAlert
</Show>
<PlatformWindowedList
items={props.state.groupedAlerts}
- estimatedItemHeight={180}
+ estimatedItemHeight={104}
enableThreshold={24}
windowSize={32}
>
@@ -135,6 +140,7 @@ export function AlertOverviewActiveAlertsSection(props: AlertOverviewActiveAlert
alert={group.primary}
state={props.state}
timelineState={props.timelineState}
+ deliveryPausedGlobally={props.deliveryPausedGlobally}
/>
<Show when={group.related.length > 0}>
<div class="ml-4 border-l-2 border-border pl-3 mt-1">
@@ -173,6 +179,7 @@ export function AlertOverviewActiveAlertsSection(props: AlertOverviewActiveAlert
alert={alert}
state={props.state}
timelineState={props.timelineState}
+ deliveryPausedGlobally={props.deliveryPausedGlobally}
/>
)}
</For>
diff --git a/frontend-modern/src/features/alerts/AlertOverviewAlertCard.tsx b/frontend-modern/src/features/alerts/AlertOverviewAlertCard.tsx
index 77b59924a6..5cf8bca210 100644
--- a/frontend-modern/src/features/alerts/AlertOverviewAlertCard.tsx
+++ b/frontend-modern/src/features/alerts/AlertOverviewAlertCard.tsx
@@ -1,4 +1,4 @@
-import { Show } from 'solid-js';
+import { createSignal, Show } from 'solid-js';
import { A } from '@solidjs/router';
import { InvestigateAlertButton } from '@/components/Alerts/InvestigateAlertButton';
@@ -19,6 +19,8 @@ import {
getAlertOverviewStartedAtLabel,
getAlertOverviewStartedAtClass,
getAlertOverviewTimelineActionLabel,
+ getAlertOverviewMoreActionsLabel,
+ formatAlertOverviewStartedAgo,
getAlertOverviewSnoozedUntilLabel,
getAlertOverviewSnoozeLabel,
} from '@/utils/alertOverviewPresentation';
@@ -37,8 +39,15 @@ interface AlertOverviewAlertCardProps {
alert: Alert;
state: AlertOverviewState;
timelineState: AlertIncidentTimelineState;
+ // True while the page states that delivery is off for every alert; the
+ // per-alert line would only repeat that banner.
+ deliveryPausedGlobally?: boolean;
}
+// Delivery holds that apply to every alert at once. The overview states them
+// in one banner instead of on each card.
+const GLOBAL_DELIVERY_HOLD_REASONS = new Set(['notifications_inactive', 'notifications_disabled']);
+
export function AlertOverviewAlertCard(props: AlertOverviewAlertCardProps) {
const alertKey = () => getCanonicalAlertId(props.alert);
const hasResource = () =>
@@ -54,8 +63,22 @@ export function AlertOverviewAlertCard(props: AlertOverviewAlertCardProps) {
);
const deliveryDiagnosis = () => props.state.deliveryDiagnoses()[alertKey()];
- const deliveryStatusLine = () =>
- describeAlertDeliveryStatus(deliveryDiagnosis(), props.alert.acknowledged);
+ const deliveryStatusLine = () => {
+ const diagnosis = deliveryDiagnosis();
+ if (
+ props.deliveryPausedGlobally &&
+ GLOBAL_DELIVERY_HOLD_REASONS.has((diagnosis?.reason || '').split(':')[0])
+ ) {
+ return null;
+ }
+ return describeAlertDeliveryStatus(diagnosis, props.alert.acknowledged);
+ };
+ const [moreOpen, setMoreOpen] = createSignal(false);
+ const hasMetaLine = () =>
+ (!isPulseSystemAlert(props.alert) && props.alert.threshold > 0) ||
+ Boolean(deliveryStatusLine()) ||
+ (isAlertSnoozed(props.alert) && Boolean(props.alert.operationalRecord?.suppression?.expiresAt));
+ const timelineOpen = () => props.timelineState.expandedIncidents().has(alertKey());
const resourceLink = (): string => {
const rid = props.alert.resourceId ?? '';
@@ -102,11 +125,11 @@ export function AlertOverviewAlertCard(props: AlertOverviewAlertCardProps) {
return (
<div id={`alert-${alertKey()}`} class={alertCardPresentation().cardClassName}>
- <div class="flex flex-col sm:flex-row sm:items-start">
+ <div class="flex flex-col gap-2 sm:flex-row sm:items-start">
<div class="flex items-start flex-1">
<div class={alertCardPresentation().iconClassName}>
{props.alert.acknowledged ? (
- <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
+ <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
stroke-linecap="round"
stroke-linejoin="round"
@@ -115,7 +138,7 @@ export function AlertOverviewAlertCard(props: AlertOverviewAlertCardProps) {
/>
</svg>
) : (
- <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
+ <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
stroke-linecap="round"
stroke-linejoin="round"
@@ -126,7 +149,7 @@ export function AlertOverviewAlertCard(props: AlertOverviewAlertCardProps) {
)}
</div>
<div class="flex-1 min-w-0">
- <div class="flex flex-wrap items-center gap-2">
+ <div class="flex flex-wrap items-center gap-x-2 gap-y-0.5">
<Show
when={hasResource()}
fallback={
@@ -164,50 +187,57 @@ export function AlertOverviewAlertCard(props: AlertOverviewAlertCardProps) {
{getAlertOverviewSnoozeLabel()}
</span>
</Show>
+ <span
+ class={getAlertOverviewStartedAtClass()}
+ title={getAlertOverviewStartedAtLabel(
+ new Date(props.alert.startTime).toLocaleString(),
+ )}
+ >
+ {formatAlertOverviewStartedAgo(props.alert.startTime, props.state.tick())}
+ </span>
</div>
- <p class="text-sm text-base-content mt-1 wrap-break-word">{props.alert.message}</p>
- <div class="flex flex-wrap items-center gap-x-3 gap-y-0.5 mt-1">
- <p class={getAlertOverviewStartedAtClass()}>
- {getAlertOverviewStartedAtLabel(new Date(props.alert.startTime).toLocaleString())}
- </p>
- <Show when={!isPulseSystemAlert(props.alert) && props.alert.threshold > 0}>
- <span class="text-xs text-muted">
- limit: {props.alert.threshold}
- {props.alert.type === 'temperature' || props.alert.type === 'diskTemperature'
- ? '°C'
- : '%'}
- </span>
- </Show>
- <Show when={deliveryStatusLine()}>
- <span
- class={
- deliveryStatusLine()?.tone === 'attention'
- ? 'text-xs text-amber-600 dark:text-amber-400'
- : 'text-xs text-muted'
+ <p class="text-sm text-base-content mt-0.5 wrap-break-word">{props.alert.message}</p>
+ <Show when={hasMetaLine()}>
+ <div class="flex flex-wrap items-center gap-x-3 gap-y-0.5 mt-0.5">
+ <Show when={!isPulseSystemAlert(props.alert) && props.alert.threshold > 0}>
+ <span class="text-xs text-muted">
+ limit: {props.alert.threshold}
+ {props.alert.type === 'temperature' || props.alert.type === 'diskTemperature'
+ ? '°C'
+ : '%'}
+ </span>
+ </Show>
+ <Show when={deliveryStatusLine()}>
+ <span
+ class={
+ deliveryStatusLine()?.tone === 'attention'
+ ? 'text-xs text-amber-600 dark:text-amber-400'
+ : 'text-xs text-muted'
+ }
+ title={deliveryDiagnosis()?.message}
+ >
+ {deliveryStatusLine()?.label}
+ </span>
+ </Show>
+ <Show
+ when={
+ isAlertSnoozed(props.alert) &&
+ props.alert.operationalRecord?.suppression?.expiresAt
}
- title={deliveryDiagnosis()?.message}
>
- {deliveryStatusLine()?.label}
- </span>
- </Show>
- <Show
- when={
- isAlertSnoozed(props.alert) &&
- props.alert.operationalRecord?.suppression?.expiresAt
- }
- >
- <span class="text-xs text-blue-600 dark:text-blue-400">
- {getAlertOverviewSnoozedUntilLabel(
- new Date(
- props.alert.operationalRecord!.suppression!.expiresAt!,
- ).toLocaleString(),
- )}
- </span>
- </Show>
- </div>
+ <span class="text-xs text-blue-600 dark:text-blue-400">
+ {getAlertOverviewSnoozedUntilLabel(
+ new Date(
+ props.alert.operationalRecord!.suppression!.expiresAt!,
+ ).toLocaleString(),
+ )}
+ </span>
+ </Show>
+ </div>
+ </Show>
</div>
</div>
- <div class="flex flex-wrap items-center gap-1.5 sm:gap-2 mt-3 sm:mt-0 sm:ml-4 self-end sm:self-start justify-end">
+ <div class="flex flex-wrap items-center gap-1.5 sm:ml-4 self-end sm:self-start justify-end">
<button
class={getAlertOverviewPrimaryActionClass(props.alert.acknowledged)}
disabled={processing()}
@@ -229,6 +259,43 @@ export function AlertOverviewAlertCard(props: AlertOverviewAlertCardProps) {
timelineState={props.timelineState}
/>
</Show>
+ <InvestigateAlertButton
+ alert={props.alert}
+ resourceType={
+ typeof props.alert.metadata?.resourceType === 'string'
+ ? (props.alert.metadata.resourceType as string)
+ : undefined
+ }
+ variant="text"
+ size="sm"
+ patrolOption
+ />
+ <button
+ type="button"
+ class={getAlertOverviewSecondaryActionClass()}
+ aria-expanded={moreOpen() || timelineOpen()}
+ onClick={() => {
+ if (moreOpen() || timelineOpen()) {
+ // Less closes everything the disclosure opened, timeline included.
+ setMoreOpen(false);
+ if (timelineOpen()) {
+ void props.timelineState.toggleIncidentTimeline(
+ alertKey(),
+ alertKey(),
+ props.alert.startTime,
+ );
+ }
+ return;
+ }
+ setMoreOpen(true);
+ }}
+ >
+ {getAlertOverviewMoreActionsLabel(moreOpen() || timelineOpen())}
+ </button>
+ </div>
+ </div>
+ <Show when={moreOpen() || timelineOpen()}>
+ <div class="mt-2 flex flex-wrap items-center justify-end gap-1.5 border-t border-border pt-2">
<button
class={getAlertOverviewSecondaryActionClass()}
onClick={() => {
@@ -239,9 +306,7 @@ export function AlertOverviewAlertCard(props: AlertOverviewAlertCardProps) {
);
}}
>
- {getAlertOverviewTimelineActionLabel(
- props.timelineState.expandedIncidents().has(alertKey()),
- )}
+ {getAlertOverviewTimelineActionLabel(timelineOpen())}
</button>
<Show when={hasResource()}>
<ResourceMonitoringPolicyAction
@@ -251,21 +316,10 @@ export function AlertOverviewAlertCard(props: AlertOverviewAlertCardProps) {
platformType={platformTypeForPolicy()}
/>
</Show>
- <InvestigateAlertButton
- alert={props.alert}
- resourceType={
- typeof props.alert.metadata?.resourceType === 'string'
- ? (props.alert.metadata.resourceType as string)
- : undefined
- }
- variant="text"
- size="sm"
- patrolOption
- />
</div>
- </div>
- <Show when={props.timelineState.expandedIncidents().has(alertKey())}>
- <div class="mt-3 border-t border-border pt-3">
+ </Show>
+ <Show when={timelineOpen()}>
+ <div class="mt-2 border-t border-border pt-3">
<IncidentTimelinePanel
loading={() => props.timelineState.incidentLoading()[alertKey()]}
error={() => props.timelineState.incidentErrors()[alertKey()]}
diff --git a/frontend-modern/src/features/alerts/AlertOverviewStatsCards.tsx b/frontend-modern/src/features/alerts/AlertOverviewStatsCards.tsx
index dcfc348a16..963115e0b5 100644
--- a/frontend-modern/src/features/alerts/AlertOverviewStatsCards.tsx
+++ b/frontend-modern/src/features/alerts/AlertOverviewStatsCards.tsx
@@ -1,10 +1,10 @@
import { Show } from 'solid-js';
-import { Card } from '@/components/shared/Card';
import { StatusDot } from '@/components/shared/StatusDot';
-import { Table, TableBody, TableCell, TableRow } from '@/components/shared/Table';
-import { getAlertOverviewStatsLabels } from '@/utils/alertOverviewPresentation';
-import type { StatusIndicatorVariant } from '@/utils/status';
+import {
+ getAlertOverviewSeverityCountLabel,
+ getAlertOverviewStatsLabels,
+} from '@/utils/alertOverviewPresentation';
import type { AlertOverviewState } from './useAlertOverviewState';
@@ -12,78 +12,47 @@ interface AlertOverviewStatsCardsProps {
state: AlertOverviewState;
}
-const dotCellClass = 'w-6 pl-3 pr-0';
-const labelCellClass = 'text-base-content';
-const valueCellClass = 'pr-1.5 text-right font-semibold tabular-nums text-base-content';
-const criticalCellClass = 'pr-3 text-right';
-
-const VARIANT_ACTIVE: Record<'triggered' | 'acknowledged', StatusIndicatorVariant> = {
- triggered: 'warning',
- acknowledged: 'success',
-};
-
-const variantForCount = (count: number, active: StatusIndicatorVariant): StatusIndicatorVariant =>
- count > 0 ? active : 'muted';
-
+// One line beside the active-alerts heading: what is open now by severity,
+// then how much fired in the last day. It replaces a three-row table whose
+// override count was configuration, not status.
export function AlertOverviewStatsCards(props: AlertOverviewStatsCardsProps) {
const labels = () => getAlertOverviewStatsLabels();
+ const stats = () => props.state.alertStats();
return (
- <Card padding="none" tone="card" class="overflow-hidden">
- <Table class="min-w-full text-xs">
- <TableBody>
- <TableRow>
- <TableCell class={dotCellClass}>
- <StatusDot
- variant={variantForCount(
- props.state.alertStats().total24h,
- VARIANT_ACTIVE.triggered,
- )}
- size="sm"
- ariaHidden
- />
- </TableCell>
- <TableCell class={labelCellClass}>{labels().last24Hours}</TableCell>
- <TableCell class={valueCellClass} data-testid="alert-overview-stat-value">
- {props.state.alertStats().total24h}
- </TableCell>
- <TableCell class={criticalCellClass}>
- <Show when={props.state.alertStats().critical24h > 0}>
- <span class="text-[10px] font-normal text-red-600 dark:text-red-400">
- {props.state.alertStats().critical24h} critical
- </span>
- </Show>
- </TableCell>
- </TableRow>
- <TableRow>
- <TableCell class={dotCellClass}>
- <StatusDot
- variant={variantForCount(
- props.state.alertStats().acknowledged,
- VARIANT_ACTIVE.acknowledged,
- )}
- size="sm"
- ariaHidden
- />
- </TableCell>
- <TableCell class={labelCellClass}>{labels().acknowledged}</TableCell>
- <TableCell class={valueCellClass} data-testid="alert-overview-stat-value">
- {props.state.alertStats().acknowledged}
- </TableCell>
- <TableCell class={criticalCellClass} />
- </TableRow>
- <TableRow>
- <TableCell class={dotCellClass}>
- <StatusDot variant="muted" size="sm" ariaHidden />
- </TableCell>
- <TableCell class={labelCellClass}>{labels().workloadOverrides}</TableCell>
- <TableCell class={valueCellClass} data-testid="alert-overview-stat-value">
- {props.state.alertStats().overrides}
- </TableCell>
- <TableCell class={criticalCellClass} />
- </TableRow>
- </TableBody>
- </Table>
- </Card>
+ <div class="flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted">
+ <Show when={stats().activeCritical > 0}>
+ <span class="inline-flex items-center gap-1.5 font-medium text-red-700 dark:text-red-300">
+ <StatusDot variant="danger" size="sm" ariaHidden />
+ {getAlertOverviewSeverityCountLabel('critical', stats().activeCritical)}
+ </span>
+ </Show>
+ <Show when={stats().activeWarning > 0}>
+ <span class="inline-flex items-center gap-1.5 font-medium text-yellow-700 dark:text-yellow-300">
+ <StatusDot variant="warning" size="sm" ariaHidden />
+ {getAlertOverviewSeverityCountLabel('warning', stats().activeWarning)}
+ </span>
+ </Show>
+ <span class="inline-flex items-center gap-1" data-alert-overview-stat="triggered24h">
+ <span>{labels().last24Hours}</span>
+ <span
+ class="font-semibold tabular-nums text-base-content"
+ data-testid="alert-overview-stat-value"
+ >
+ {props.state.alertStats().total24h}
+ </span>
+ </span>
+ <Show when={props.state.alertStats().acknowledged > 0}>
+ <span class="inline-flex items-center gap-1" data-alert-overview-stat="acknowledged">
+ <span>{labels().acknowledged}</span>
+ <span
+ class="font-semibold tabular-nums text-base-content"
+ data-testid="alert-overview-stat-value"
+ >
+ {props.state.alertStats().acknowledged}
+ </span>
+ </span>
+ </Show>
+ </div>
);
}
diff --git a/frontend-modern/src/features/alerts/OverviewTab.tsx b/frontend-modern/src/features/alerts/OverviewTab.tsx
index 64daf8a1b1..e7572d3e7b 100644
--- a/frontend-modern/src/features/alerts/OverviewTab.tsx
+++ b/frontend-modern/src/features/alerts/OverviewTab.tsx
@@ -5,9 +5,10 @@ import { useLocation } from '@solidjs/router';
import type { Alert } from '@/types/api';
import { AlertDeliveryHealthCard } from './AlertDeliveryHealthCard';
+import { AlertDeliveryPausedCard } from './AlertDeliveryPausedCard';
import { AlertOverviewActiveAlertsSection } from './AlertOverviewActiveAlertsSection';
-import { AlertOverviewStatsCards } from './AlertOverviewStatsCards';
import type { Override } from './types';
+import { useAlertDeliveryPausedReason } from './useAlertDeliveryPausedReason';
import { useAlertIncidentTimelineState } from './useAlertIncidentTimelineState';
import { useAlertOverviewState } from './useAlertOverviewState';
import { useNotificationDeliveryHealth } from './useNotificationDeliveryHealth';
@@ -36,6 +37,9 @@ export function OverviewTab(props: {
// is the channel that would have reported it. Surface it on the tab people
// actually open, not only on the destinations config tab.
const deliveryHealthState = useNotificationDeliveryHealth();
+ // Delivery being off applies to every alert at once, so it is said once here
+ // rather than on each card.
+ const deliveryPaused = useAlertDeliveryPausedReason();
onMount(() => {
void deliveryHealthState.loadDeliveryHealth();
});
@@ -98,7 +102,17 @@ export function OverviewTab(props: {
showRefresh={deliveryHealthState.deliveryHealthUnavailable()}
/>
</Show>
- <AlertOverviewStatsCards state={overviewState} />
+ <Show when={deliveryPaused.pausedReason()}>
+ {(reason) => (
+ <AlertDeliveryPausedCard
+ reason={reason()}
+ surface="overview"
+ setupHref="/alerts/notifications"
+ activating={deliveryPaused.activating()}
+ onActivate={() => void deliveryPaused.activate()}
+ />
+ )}
+ </Show>
<AlertOverviewActiveAlertsSection
state={overviewState}
timelineState={timelineState}
@@ -106,6 +120,7 @@ export function OverviewTab(props: {
alertsDisabled={props.alertsDisabled()}
showAcknowledged={props.showAcknowledged()}
setShowAcknowledged={props.setShowAcknowledged}
+ deliveryPausedGlobally={deliveryPaused.pausedReason() !== null}
/>
</div>
);
diff --git a/frontend-modern/src/features/alerts/__tests__/AlertOverviewAlertCard.system-scope.test.tsx b/frontend-modern/src/features/alerts/__tests__/AlertOverviewAlertCard.system-scope.test.tsx
index b150134fa8..f4e95fc971 100644
--- a/frontend-modern/src/features/alerts/__tests__/AlertOverviewAlertCard.system-scope.test.tsx
+++ b/frontend-modern/src/features/alerts/__tests__/AlertOverviewAlertCard.system-scope.test.tsx
@@ -23,6 +23,7 @@ import { AlertOverviewAlertCard } from '../AlertOverviewAlertCard';
const acknowledge = vi.fn();
const toggleTimeline = vi.fn();
const state = {
+ tick: () => Date.now(),
processingAlerts: () => new Set(),
snoozeProcessingAlerts: () => new Set(),
deliveryDiagnoses: () => ({}),
@@ -45,6 +46,7 @@ describe('Pulse system-alert overview scope', () => {
));
expect(screen.getByText('Pulse').closest('a')).toBeNull();
expect(screen.getByText(alert.message)).toBeInTheDocument();
+ fireEvent.click(screen.getByRole('button', { name: 'More' }));
expect(screen.queryByText('Resource monitoring policy')).toBeNull();
fireEvent.click(screen.getByRole('button', { name: 'Acknowledge' }));
expect(acknowledge).toHaveBeenCalledWith(alert);
@@ -64,6 +66,7 @@ describe('Pulse system-alert overview scope', () => {
));
expect(screen.getByText('Pulse').closest('a')).toBeNull();
expect(screen.queryByText(/limit:/)).toBeNull();
+ fireEvent.click(screen.getByRole('button', { name: 'More' }));
expect(screen.queryByText('Resource monitoring policy')).toBeNull();
});
@@ -83,6 +86,33 @@ describe('Pulse system-alert overview scope', () => {
'/proxmox/overview',
);
expect(screen.getByText('limit: 80%')).toBeInTheDocument();
+ // Monitoring policy is a secondary action behind the More disclosure.
+ expect(screen.queryByText('Resource monitoring policy')).toBeNull();
+ fireEvent.click(screen.getByRole('button', { name: 'More' }));
expect(screen.getByText('Resource monitoring policy')).toBeInTheDocument();
});
+
+ it('closes the open timeline when the disclosure is collapsed', () => {
+ const alert = makeSystemAlert('cpu', { id: 'open-timeline', resourceId: 'vm-pulse' });
+ const openTimeline = {
+ expandedIncidents: () => new Set(['open-timeline']),
+ toggleIncidentTimeline: toggleTimeline,
+ incidentLoading: () => ({}),
+ incidentErrors: () => ({}),
+ incidentTimelines: () => ({}),
+ eventFilters: () => new Set(),
+ setEventFilters: vi.fn(),
+ incidentNoteDrafts: () => ({}),
+ incidentNoteSaving: () => new Set(),
+ } as unknown as AlertIncidentTimelineState;
+ render(() => (
+ <AlertOverviewAlertCard alert={alert} state={state} timelineState={openTimeline} />
+ ));
+ // An open timeline keeps the disclosure open, so the control reads Less
+ // and must close the timeline rather than do nothing.
+ const less = screen.getByRole('button', { name: 'Less' });
+ expect(less).toHaveAttribute('aria-expanded', 'true');
+ fireEvent.click(less);
+ expect(toggleTimeline).toHaveBeenCalledWith('open-timeline', 'open-timeline', alert.startTime);
+ });
});
diff --git a/frontend-modern/src/features/alerts/__tests__/OverviewTab.timelineerror.test.tsx b/frontend-modern/src/features/alerts/__tests__/OverviewTab.timelineerror.test.tsx
index 68612a1274..87a8e5f1d3 100644
--- a/frontend-modern/src/features/alerts/__tests__/OverviewTab.timelineerror.test.tsx
+++ b/frontend-modern/src/features/alerts/__tests__/OverviewTab.timelineerror.test.tsx
@@ -73,6 +73,7 @@ describe('OverviewTab incident timeline error state', () => {
render(() => <OverviewTab {...defaultProps()} />);
// Click the Timeline button to expand
+ fireEvent.click(screen.getByText('More'));
const timelineBtn = screen.getByText('Timeline');
fireEvent.click(timelineBtn);
@@ -91,6 +92,7 @@ describe('OverviewTab incident timeline error state', () => {
render(() => <OverviewTab {...defaultProps()} />);
// Click Timeline to expand — first call fails
+ fireEvent.click(screen.getByText('More'));
const timelineBtn = screen.getByText('Timeline');
fireEvent.click(timelineBtn);
@@ -126,6 +128,7 @@ describe('OverviewTab incident timeline error state', () => {
render(() => <OverviewTab {...defaultProps()} />);
+ fireEvent.click(screen.getByText('More'));
const timelineBtn = screen.getByText('Timeline');
fireEvent.click(timelineBtn);
@@ -161,6 +164,7 @@ describe('OverviewTab incident timeline error state', () => {
render(() => <OverviewTab {...defaultProps()} />);
+ fireEvent.click(screen.getByText('More'));
const timelineBtn = screen.getByText('Timeline');
fireEvent.click(timelineBtn);
@@ -198,6 +202,7 @@ describe('OverviewTab incident timeline error state', () => {
render(() => <OverviewTab {...defaultProps()} />);
+ fireEvent.click(screen.getByText('Mehr'));
fireEvent.click(screen.getByText('Zeitleiste'));
await waitFor(() => {
diff --git a/frontend-modern/src/features/alerts/__tests__/OverviewTab.total24h.test.tsx b/frontend-modern/src/features/alerts/__tests__/OverviewTab.total24h.test.tsx
index a8f7539356..359d15bb3c 100644
--- a/frontend-modern/src/features/alerts/__tests__/OverviewTab.total24h.test.tsx
+++ b/frontend-modern/src/features/alerts/__tests__/OverviewTab.total24h.test.tsx
@@ -1,5 +1,5 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
-import { cleanup, render, screen, waitFor } from '@solidjs/testing-library';
+import { cleanup, fireEvent, render, screen, waitFor } from '@solidjs/testing-library';
import { DEFAULT_LOCALE, setActiveLocale } from '@/i18n';
import type { Alert, AlertDeliveryDiagnosis } from '@/types/api';
@@ -101,7 +101,7 @@ describe('OverviewTab Last 24 Hours stat', () => {
expect(
screen
.getByText('Triggered (24h)')
- .closest('tr')
+ .closest('[data-alert-overview-stat]')
?.querySelector('[data-testid="alert-overview-stat-value"]')?.textContent,
).toBe('0');
});
@@ -120,10 +120,10 @@ describe('OverviewTab Last 24 Hours stat', () => {
const label = screen.getByText('Triggered (24h)');
const statValue = label
- .closest('tr')
+ .closest('[data-alert-overview-stat]')
?.querySelector('[data-testid="alert-overview-stat-value"]');
expect(statValue?.textContent).toBe('1');
- expect(screen.getAllByText('Monitoring')).toHaveLength(2);
+ expect(screen.getAllByRole('button', { name: 'More' })).toHaveLength(2);
});
it('shows 0 when all alerts are older than 24 hours', () => {
@@ -139,7 +139,7 @@ describe('OverviewTab Last 24 Hours stat', () => {
const label = screen.getByText('Triggered (24h)');
const statValue = label
- .closest('tr')
+ .closest('[data-alert-overview-stat]')
?.querySelector('[data-testid="alert-overview-stat-value"]');
expect(statValue?.textContent).toBe('0');
});
@@ -158,28 +158,36 @@ describe('OverviewTab Last 24 Hours stat', () => {
const label = screen.getByText('Triggered (24h)');
const statValue = label
- .closest('tr')
+ .closest('[data-alert-overview-stat]')
?.querySelector('[data-testid="alert-overview-stat-value"]');
expect(statValue?.textContent).toBe('3');
});
- it('keeps the critical annotation in its own cell so counts stay right-aligned', () => {
+ it('states open alerts by severity separately from the triggered count', () => {
const recentTime = new Date(Date.now() - 1_800_000).toISOString();
const activeAlerts: Record<string, Alert> = {
critical: { ...makeAlert('critical', recentTime), level: 'critical' },
+ warning: { ...makeAlert('warning', recentTime), level: 'warning' },
+ acked: { ...makeAlert('acked', recentTime), level: 'critical', acknowledged: true },
};
render(() => <OverviewTab {...defaultProps({ activeAlerts })} />);
- const label = screen.getByText('Triggered (24h)');
- const cells = Array.from(label.closest('tr')!.querySelectorAll('td'));
- const valueIndex = cells.findIndex(
- (cell) => cell.getAttribute('data-testid') === 'alert-overview-stat-value',
+ // Severity counts cover open alerts only; the triggered count keeps every
+ // alert that fired in the window, acknowledged or not.
+ expect(screen.getByText('1 critical')).toBeTruthy();
+ expect(screen.getByText('1 warning')).toBeTruthy();
+ const triggered = screen
+ .getByText('Triggered (24h)')
+ .closest('[data-alert-overview-stat]')
+ ?.querySelector('[data-testid="alert-overview-stat-value"]');
+ expect(triggered?.textContent).toBe('3');
+ const acknowledged = document.querySelector(
+ '[data-alert-overview-stat="acknowledged"] [data-testid="alert-overview-stat-value"]',
);
- expect(valueIndex).toBeGreaterThanOrEqual(0);
- expect(cells[valueIndex].textContent).toBe('1');
- expect(cells[valueIndex + 1]?.textContent).toContain('1 critical');
+ expect(acknowledged?.textContent).toBe('1');
+ expect(screen.queryByText('Workload Overrides')).toBeNull();
});
it('excludes future-dated alerts (clock skew)', () => {
@@ -193,7 +201,7 @@ describe('OverviewTab Last 24 Hours stat', () => {
const label = screen.getByText('Triggered (24h)');
const statValue = label
- .closest('tr')
+ .closest('[data-alert-overview-stat]')
?.querySelector('[data-testid="alert-overview-stat-value"]');
expect(statValue?.textContent).toBe('0');
});
@@ -210,7 +218,7 @@ describe('OverviewTab Last 24 Hours stat', () => {
const label = screen.getByText('Triggered (24h)');
const statValue = label
- .closest('tr')
+ .closest('[data-alert-overview-stat]')
?.querySelector('[data-testid="alert-overview-stat-value"]');
expect(statValue?.textContent).toBe('1');
@@ -273,6 +281,7 @@ describe('OverviewTab Last 24 Hours stat', () => {
const activeAlerts: Record<string, Alert> = {
recent: makeAlert('recent', recentTime),
+ acked: { ...makeAlert('acked', recentTime), acknowledged: true },
};
render(() => <OverviewTab {...defaultProps({ activeAlerts })} />);
@@ -280,9 +289,10 @@ describe('OverviewTab Last 24 Hours stat', () => {
expect(screen.getByText('Activadas (24h)')).toBeInTheDocument();
expect(screen.getByText('Reconocidas')).toBeInTheDocument();
expect(screen.getByText('Alertas activas')).toBeInTheDocument();
- expect(screen.getByText('Reconocer')).toBeInTheDocument();
+ expect(screen.getAllByText('Reconocer').length).toBeGreaterThan(0);
+ fireEvent.click(screen.getAllByText('Más')[0]);
expect(screen.getByText('Linea de tiempo')).toBeInTheDocument();
- expect(screen.getByText('en node1')).toBeInTheDocument();
+ expect(screen.getAllByText('en node1').length).toBeGreaterThan(0);
expect(screen.getByText('VM recent')).toBeInTheDocument();
expect(screen.getByText('High CPU on VM recent')).toBeInTheDocument();
});
diff --git a/frontend-modern/src/features/alerts/tabs/DestinationsTab.tsx b/frontend-modern/src/features/alerts/tabs/DestinationsTab.tsx
index d6462cefe9..56fefd9c7c 100644
--- a/frontend-modern/src/features/alerts/tabs/DestinationsTab.tsx
+++ b/frontend-modern/src/features/alerts/tabs/DestinationsTab.tsx
@@ -1,9 +1,6 @@
import { AlertQueueActionFeedback } from '../AlertQueueActionFeedback';
-import { createMemo, createSignal, Show } from 'solid-js';
+import { Show } from 'solid-js';
import { hasFeature } from '@/stores/license';
-import { useAlertsActivation } from '@/stores/alertsActivation';
-import { logger } from '@/utils/logger';
-import type { AlertDestinationsDeliveryPausedReason } from '@/utils/alertDestinationsPresentation';
import { AlertAppriseDestinationsSection } from '../AlertAppriseDestinationsSection';
import { AlertDeliveryHealthCard } from '../AlertDeliveryHealthCard';
import { AlertDeliveryLogCard } from '../AlertDeliveryLogCard';
@@ -14,6 +11,7 @@ import { AlertDestinationsLoadingState } from '../AlertDestinationsLoadingState'
import { AlertEmailDestinationsSection } from '../AlertEmailDestinationsSection';
import { AlertPushDestinationsSection } from '../AlertPushDestinationsSection';
import { AlertWebhookDestinationsSection } from '../AlertWebhookDestinationsSection';
+import { useAlertDeliveryPausedReason } from '../useAlertDeliveryPausedReason';
import {
useAlertDestinationsTabState,
@@ -31,49 +29,19 @@ export interface DestinationsTabProps extends AlertDestinationsTabStateProps {
export function DestinationsTab(props: DestinationsTabProps) {
const state = useAlertDestinationsTabState(props);
- const alertsActivation = useAlertsActivation();
- const [activating, setActivating] = createSignal(false);
-
// Destinations configured here are inert while delivery is gated off, so the
// pause has to be visible on this surface rather than only on the overview.
- const pausedReason = createMemo<AlertDestinationsDeliveryPausedReason | null>(() => {
- // Until the alert config resolves, activation state is null and would read
- // as paused; staying quiet avoids a false warning on every tab open.
- if (!alertsActivation.config() || alertsActivation.activationState() === null) {
- return null;
- }
- if (alertsActivation.notificationDeliveryEnabled()) {
- return null;
- }
- if (!alertsActivation.detectionEnabled()) {
- return 'detection_off';
- }
- return alertsActivation.activationState() === 'snoozed' ? 'snoozed' : 'not_activated';
- });
-
- const handleActivate = async () => {
- if (activating()) {
- return;
- }
- setActivating(true);
- try {
- await alertsActivation.activate();
- } catch (error) {
- logger.error('Failed to activate notification delivery from destinations tab', error);
- } finally {
- setActivating(false);
- }
- };
+ const deliveryPaused = useAlertDeliveryPausedReason();
return (
<div class="flex w-full max-w-full flex-col gap-6 md:gap-8">
<Show when={!state.isLoading()} fallback={<AlertDestinationsLoadingState />}>
- <Show when={pausedReason()}>
+ <Show when={deliveryPaused.pausedReason()}>
{(reason) => (
<AlertDeliveryPausedCard
reason={reason()}
- activating={activating()}
- onActivate={() => void handleActivate()}
+ activating={deliveryPaused.activating()}
+ onActivate={() => void deliveryPaused.activate()}
/>
)}
</Show>
diff --git a/frontend-modern/src/features/alerts/useAlertDeliveryPausedReason.ts b/frontend-modern/src/features/alerts/useAlertDeliveryPausedReason.ts
new file mode 100644
index 0000000000..424fe4557d
--- /dev/null
+++ b/frontend-modern/src/features/alerts/useAlertDeliveryPausedReason.ts
@@ -0,0 +1,50 @@
+import { createMemo, createSignal, type Accessor } from 'solid-js';
+
+import { useAlertsActivation } from '@/stores/alertsActivation';
+import type { AlertDestinationsDeliveryPausedReason } from '@/utils/alertDestinationsPresentation';
+import { logger } from '@/utils/logger';
+
+export interface AlertDeliveryPausedState {
+ pausedReason: Accessor<AlertDestinationsDeliveryPausedReason | null>;
+ activating: Accessor<boolean>;
+ activate: () => Promise<void>;
+}
+
+// Why live alerts are not reaching any destination, or null when delivery is
+// on. Shared by the overview and the notifications tab so both surfaces name
+// the same gate in the same words.
+export function useAlertDeliveryPausedReason(): AlertDeliveryPausedState {
+ const alertsActivation = useAlertsActivation();
+ const [activating, setActivating] = createSignal(false);
+
+ const pausedReason = createMemo<AlertDestinationsDeliveryPausedReason | null>(() => {
+ // Until the alert config resolves, activation state is null and would read
+ // as paused; staying quiet avoids a false warning on every page open.
+ if (!alertsActivation.config() || alertsActivation.activationState() === null) {
+ return null;
+ }
+ if (alertsActivation.notificationDeliveryEnabled()) {
+ return null;
+ }
+ if (!alertsActivation.detectionEnabled()) {
+ return 'detection_off';
+ }
+ return alertsActivation.activationState() === 'snoozed' ? 'snoozed' : 'not_activated';
+ });
+
+ const activate = async () => {
+ if (activating()) {
+ return;
+ }
+ setActivating(true);
+ try {
+ await alertsActivation.activate();
+ } catch (error) {
+ logger.error('Failed to activate notification delivery', error);
+ } finally {
+ setActivating(false);
+ }
+ };
+
+ return { pausedReason, activating, activate };
+}
diff --git a/frontend-modern/src/features/alerts/useAlertOverviewState.ts b/frontend-modern/src/features/alerts/useAlertOverviewState.ts
index 377bb479e1..24c3fde4a6 100644
--- a/frontend-modern/src/features/alerts/useAlertOverviewState.ts
+++ b/frontend-modern/src/features/alerts/useAlertOverviewState.ts
@@ -114,8 +114,11 @@ export function useAlertOverviewState(props: UseAlertOverviewStateProps) {
const age = tick() - ts;
return age >= 0 && age < 86_400_000;
});
+ const unacknowledged = alerts.filter((alert) => !alert.acknowledged);
return {
- active: alerts.filter((alert) => !alert.acknowledged).length,
+ active: unacknowledged.length,
+ activeCritical: unacknowledged.filter((alert) => alert.level === 'critical').length,
+ activeWarning: unacknowledged.filter((alert) => alert.level === 'warning').length,
acknowledged: alerts.filter((alert) => alert.acknowledged).length,
total24h: recent.length,
critical24h: recent.filter((alert) => alert.level === 'critical').length,
@@ -167,6 +170,7 @@ export function useAlertOverviewState(props: UseAlertOverviewStateProps) {
});
return {
+ tick,
alertStats,
filteredAlerts,
groupedAlerts,
diff --git a/frontend-modern/src/i18n/__tests__/i18n.test.ts b/frontend-modern/src/i18n/__tests__/i18n.test.ts
index 8031a44bd9..f900989ff7 100644
--- a/frontend-modern/src/i18n/__tests__/i18n.test.ts
+++ b/frontend-modern/src/i18n/__tests__/i18n.test.ts
@@ -158,6 +158,36 @@ describe('i18n foundation', () => {
}
});
+ it('localizes the alert overview summary, row disclosure and paused-delivery banner', () => {
+ expect(t('alerts.overview.summary.critical', { count: 2 }, 'en')).toBe('2 critical');
+ expect(t('alerts.overview.summary.warning', { count: 3 }, 'de')).toBe('3 Warnung');
+ expect(t('alerts.overview.action.moreActions', undefined, 'es')).toBe('Más');
+ expect(t('alerts.delivery.paused.title', undefined, 'de')).toBe(
+ 'Benachrichtigungen sind pausiert',
+ );
+ const pausedKeys = [
+ 'alerts.delivery.paused.title',
+ 'alerts.delivery.paused.action',
+ 'alerts.delivery.paused.setupLink',
+ 'alerts.delivery.paused.reason.detectionOff',
+ 'alerts.delivery.paused.reason.snoozed',
+ 'alerts.delivery.paused.reason.notActivated',
+ 'alerts.delivery.paused.consequence.destinations',
+ 'alerts.delivery.paused.consequence.destinationsDetectionOff',
+ 'alerts.delivery.paused.consequence.overview',
+ 'alerts.delivery.paused.consequence.overviewDetectionOff',
+ 'alerts.overview.action.moreActions',
+ 'alerts.overview.action.lessActions',
+ ] as const;
+ for (const key of pausedKeys) {
+ const english = t(key, undefined, 'en');
+ for (const locale of SUPPORTED_LOCALES) {
+ expect(t(key, undefined, locale)).toBeTruthy();
+ if (locale !== 'en') expect(t(key, undefined, locale)).not.toBe(english);
+ }
+ }
+ });
+
it('localizes alert group correlation labels across every supported locale', () => {
expect(t('alerts.overview.group.linkedSignal', { count: 1 }, 'en')).toBe('+1 linked signal');
expect(t('alerts.overview.group.linkedSignal', { count: 1 }, 'de')).toBe(
diff --git a/frontend-modern/src/i18n/messages.de.ts b/frontend-modern/src/i18n/messages.de.ts
index 92aad8c3f5..4f15078939 100644
--- a/frontend-modern/src/i18n/messages.de.ts
+++ b/frontend-modern/src/i18n/messages.de.ts
@@ -63,6 +63,8 @@ export const DE_MESSAGE_OVERRIDES = {
'alerts.overview.action.cancel': 'Abbrechen',
'alerts.overview.action.hideAcknowledged': 'Bestaetigte ausblenden',
'alerts.overview.action.hideTimeline': 'Zeitleiste ausblenden',
+ 'alerts.overview.action.moreActions': 'Mehr',
+ 'alerts.overview.action.lessActions': 'Weniger',
'alerts.overview.action.processing': 'Wird verarbeitet...',
'alerts.overview.action.resume': 'Fortsetzen',
'alerts.overview.action.showAcknowledged': 'Bestaetigte anzeigen',
@@ -124,6 +126,25 @@ export const DE_MESSAGE_OVERRIDES = {
'Schalten Sie Warnmeldungen ein, um die Ueberwachung fortzusetzen und Konfigurationstabs freizugeben',
'alerts.overview.paused.title': 'Warnmeldungen sind pausiert',
'alerts.overview.section.activeAlerts': 'Aktive Warnmeldungen',
+ 'alerts.overview.summary.warning': '{count} Warnung',
+ 'alerts.overview.summary.critical': '{count} kritisch',
+ 'alerts.delivery.paused.title': 'Benachrichtigungen sind pausiert',
+ 'alerts.delivery.paused.action': 'Zustellung einschalten',
+ 'alerts.delivery.paused.setupLink': 'Ziele fuer Warnmeldungen einrichten',
+ 'alerts.delivery.paused.reason.detectionOff':
+ 'Warnmeldungen sind in der Warnkonfiguration ausgeschaltet.',
+ 'alerts.delivery.paused.reason.snoozed':
+ 'Die Zustellung von Benachrichtigungen ist zurueckgestellt.',
+ 'alerts.delivery.paused.reason.notActivated':
+ 'Die Zustellung von Benachrichtigungen wurde fuer diese Installation noch nicht eingeschaltet.',
+ 'alerts.delivery.paused.consequence.destinations':
+ 'Pulse erkennt weiterhin Warnmeldungen, sendet aber keine davon an die Ziele unten. Testnachrichten umgehen die Pause, ein erfolgreicher Test bedeutet also nicht, dass echte Warnmeldungen ankommen.',
+ 'alerts.delivery.paused.consequence.destinationsDetectionOff':
+ 'Solange Warnmeldungen ausgeschaltet sind, meldet Pulse keine neuen, und keine wird an die Ziele unten gesendet. Testnachrichten umgehen die Pause, ein erfolgreicher Test bedeutet also nicht, dass echte Warnmeldungen ankommen.',
+ 'alerts.delivery.paused.consequence.overview':
+ 'Pulse erkennt die Warnmeldungen unten weiterhin, aber niemand wird darueber benachrichtigt.',
+ 'alerts.delivery.paused.consequence.overviewDetectionOff':
+ 'Solange Warnmeldungen ausgeschaltet sind, meldet Pulse keine neuen, und niemand wird benachrichtigt.',
'alerts.overview.snooze.description':
'Pausiert Benachrichtigungen und Eskalationen fuer diesen Vorfall. Ueberwachung und Erkennung der Behebung laufen weiter.',
'alerts.overview.snooze.option.eightHours': 'Fuer 8 Stunden',
diff --git a/frontend-modern/src/i18n/messages.es.ts b/frontend-modern/src/i18n/messages.es.ts
index f8cb8c2f15..664e62dc02 100644
--- a/frontend-modern/src/i18n/messages.es.ts
+++ b/frontend-modern/src/i18n/messages.es.ts
@@ -62,6 +62,8 @@ export const ES_MESSAGE_OVERRIDES = {
'alerts.overview.action.cancel': 'Cancelar',
'alerts.overview.action.hideAcknowledged': 'Ocultar reconocidas',
'alerts.overview.action.hideTimeline': 'Ocultar linea de tiempo',
+ 'alerts.overview.action.moreActions': 'Más',
+ 'alerts.overview.action.lessActions': 'Menos',
'alerts.overview.action.processing': 'Procesando...',
'alerts.overview.action.resume': 'Reanudar',
'alerts.overview.action.showAcknowledged': 'Mostrar reconocidas',
@@ -119,6 +121,24 @@ export const ES_MESSAGE_OVERRIDES = {
'Activa las alertas para reanudar la monitorizacion y desbloquear las pestañas de configuracion',
'alerts.overview.paused.title': 'Las alertas estan pausadas',
'alerts.overview.section.activeAlerts': 'Alertas activas',
+ 'alerts.overview.summary.warning': '{count} de aviso',
+ 'alerts.overview.summary.critical': '{count} críticas',
+ 'alerts.delivery.paused.title': 'Las notificaciones están en pausa',
+ 'alerts.delivery.paused.action': 'Activar el envío',
+ 'alerts.delivery.paused.setupLink': 'Configurar adónde van las alertas',
+ 'alerts.delivery.paused.reason.detectionOff':
+ 'Las alertas están desactivadas en la configuración de alertas.',
+ 'alerts.delivery.paused.reason.snoozed': 'El envío de notificaciones está pospuesto.',
+ 'alerts.delivery.paused.reason.notActivated':
+ 'El envío de notificaciones aún no se ha activado en esta instalación.',
+ 'alerts.delivery.paused.consequence.destinations':
+ 'Pulse sigue detectando alertas, pero ninguna se enviará a los destinos de abajo. Los mensajes de prueba omiten la pausa, así que una prueba correcta no significa que las alertas reales lleguen.',
+ 'alerts.delivery.paused.consequence.destinationsDetectionOff':
+ 'Mientras las alertas estén desactivadas, Pulse no genera alertas nuevas y ninguna se enviará a los destinos de abajo. Los mensajes de prueba omiten la pausa, así que una prueba correcta no significa que las alertas reales lleguen.',
+ 'alerts.delivery.paused.consequence.overview':
+ 'Pulse sigue detectando las alertas de abajo, pero nadie recibe avisos sobre ellas.',
+ 'alerts.delivery.paused.consequence.overviewDetectionOff':
+ 'Mientras las alertas estén desactivadas, Pulse no genera alertas nuevas y nadie recibe avisos.',
'alerts.overview.snooze.description':
'Pausa las notificaciones y el escalado de este incidente. La monitorizacion continua y la resolucion se sigue detectando.',
'alerts.overview.snooze.option.eightHours': 'Durante 8 horas',
diff --git a/frontend-modern/src/i18n/messages.ts b/frontend-modern/src/i18n/messages.ts
index ab13ef5f47..0543799b22 100644
--- a/frontend-modern/src/i18n/messages.ts
+++ b/frontend-modern/src/i18n/messages.ts
@@ -163,6 +163,8 @@ export const EN_MESSAGES = {
'alerts.overview.action.cancel': 'Cancel',
'alerts.overview.action.hideAcknowledged': 'Hide acknowledged',
'alerts.overview.action.hideTimeline': 'Hide Timeline',
+ 'alerts.overview.action.moreActions': 'More',
+ 'alerts.overview.action.lessActions': 'Less',
'alerts.overview.action.processing': 'Processing...',
'alerts.overview.action.resume': 'Resume',
'alerts.overview.action.showAcknowledged': 'Show acknowledged',
@@ -218,6 +220,24 @@ export const EN_MESSAGES = {
'Toggle alerts on to resume monitoring and unlock configuration tabs',
'alerts.overview.paused.title': 'Alerting is paused',
'alerts.overview.section.activeAlerts': 'Active Alerts',
+ 'alerts.overview.summary.warning': '{count} warning',
+ 'alerts.overview.summary.critical': '{count} critical',
+ 'alerts.delivery.paused.title': 'Notifications are paused',
+ 'alerts.delivery.paused.action': 'Turn on delivery',
+ 'alerts.delivery.paused.setupLink': 'Set up where alerts go',
+ 'alerts.delivery.paused.reason.detectionOff':
+ 'Alerts are switched off in the alert configuration.',
+ 'alerts.delivery.paused.reason.snoozed': 'Notification delivery is snoozed.',
+ 'alerts.delivery.paused.reason.notActivated':
+ 'Notification delivery has not been turned on for this install yet.',
+ 'alerts.delivery.paused.consequence.destinations':
+ 'Pulse is still detecting alerts, but none of them will be sent to the destinations below. Test messages bypass the pause, so a successful test does not mean live alerts are getting through.',
+ 'alerts.delivery.paused.consequence.destinationsDetectionOff':
+ 'Pulse is not raising new alerts while they are switched off, and none of them will be sent to the destinations below. Test messages bypass the pause, so a successful test does not mean live alerts are getting through.',
+ 'alerts.delivery.paused.consequence.overview':
+ 'Pulse is still detecting the alerts below, but nobody is being notified about them.',
+ 'alerts.delivery.paused.consequence.overviewDetectionOff':
+ 'Pulse is not raising new alerts while they are switched off, so nobody is being notified.',
'alerts.overview.snooze.description':
'Pause notifications and escalation for this incident. Monitoring continues and resolution is still detected.',
'alerts.overview.snooze.option.eightHours': 'For 8 hours',
@@ -773,6 +793,8 @@ export const ALERTS_OVERVIEW_MIGRATED_MESSAGE_KEYS = [
'alerts.overview.action.cancel',
'alerts.overview.action.hideAcknowledged',
'alerts.overview.action.hideTimeline',
+ 'alerts.overview.action.moreActions',
+ 'alerts.overview.action.lessActions',
'alerts.overview.action.processing',
'alerts.overview.action.resume',
'alerts.overview.action.showAcknowledged',
@@ -823,6 +845,18 @@ export const ALERTS_OVERVIEW_MIGRATED_MESSAGE_KEYS = [
'alerts.overview.paused.description',
'alerts.overview.paused.title',
'alerts.overview.section.activeAlerts',
+ 'alerts.overview.summary.warning',
+ 'alerts.overview.summary.critical',
+ 'alerts.delivery.paused.title',
+ 'alerts.delivery.paused.action',
+ 'alerts.delivery.paused.setupLink',
+ 'alerts.delivery.paused.reason.detectionOff',
+ 'alerts.delivery.paused.reason.snoozed',
+ 'alerts.delivery.paused.reason.notActivated',
+ 'alerts.delivery.paused.consequence.destinations',
+ 'alerts.delivery.paused.consequence.destinationsDetectionOff',
+ 'alerts.delivery.paused.consequence.overview',
+ 'alerts.delivery.paused.consequence.overviewDetectionOff',
'alerts.overview.snooze.description',
'alerts.overview.snooze.option.eightHours',
'alerts.overview.snooze.option.oneHour',
diff --git a/frontend-modern/src/pages/__tests__/Alerts.helpers.test.ts b/frontend-modern/src/pages/__tests__/Alerts.helpers.test.ts
index d72c5ada97..7a32be680c 100644
--- a/frontend-modern/src/pages/__tests__/Alerts.helpers.test.ts
+++ b/frontend-modern/src/pages/__tests__/Alerts.helpers.test.ts
@@ -578,7 +578,7 @@ describe('tab path helpers', () => {
);
expect(alertIncidentTimelineStateSource).toContain('AlertsAPI.getIncidentTimeline');
expect(alertIncidentTimelineStateSource).toContain('AlertsAPI.addIncidentNote');
- expect(alertOverviewTabSource).toContain('AlertOverviewStatsCards');
+ expect(alertOverviewActiveAlertsSectionSource).toContain('AlertOverviewStatsCards');
expect(alertOverviewTabSource).toContain('AlertOverviewActiveAlertsSection');
expect(alertOverviewTabSource).toContain('useAlertOverviewState');
expect(alertOverviewTabSource).toContain('useAlertIncidentTimelineState');
@@ -593,7 +593,8 @@ describe('tab path helpers', () => {
expect(alertOverviewStateSource).not.toContain('AlertsAPI.unacknowledge');
expect(alertOverviewStatsCardsSource).toContain('props.state.alertStats().acknowledged');
expect(alertOverviewStatsCardsSource).toContain('props.state.alertStats().total24h');
- expect(alertOverviewStatsCardsSource).toContain('props.state.alertStats().overrides');
+ // Override count is configuration, not alert status; it left the overview.
+ expect(alertOverviewStatsCardsSource).not.toContain('alertStats().overrides');
expect(alertOverviewActiveAlertsSectionSource).toContain('AlertOverviewAlertCard');
expect(alertOverviewActiveAlertsSectionSource).toContain('getAlertListEmptyState');
expect(alertOverviewAlertCardSource).toContain('getAlertOverviewCardPresentation');
diff --git a/frontend-modern/src/utils/__tests__/alertDestinationsPresentation.test.ts b/frontend-modern/src/utils/__tests__/alertDestinationsPresentation.test.ts
index 8cf26ffba5..ec04dbd576 100644
--- a/frontend-modern/src/utils/__tests__/alertDestinationsPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/alertDestinationsPresentation.test.ts
@@ -316,6 +316,16 @@ describe('alert destinations delivery paused copy', () => {
expect(getAlertDestinationsDeliveryPausedDescription('detection_off')).toContain(
'Alerts are switched off',
);
+ // With alerts off nothing new is detected, so no surface may claim it is.
+ expect(getAlertDestinationsDeliveryPausedDescription('detection_off')).not.toContain(
+ 'still detecting',
+ );
+ expect(getAlertDestinationsDeliveryPausedDescription('detection_off', 'overview')).toBe(
+ 'Alerts are switched off in the alert configuration. Pulse is not raising new alerts while they are switched off, so nobody is being notified.',
+ );
+ expect(getAlertDestinationsDeliveryPausedDescription('not_activated', 'overview')).toBe(
+ 'Notification delivery has not been turned on for this install yet. Pulse is still detecting the alerts below, but nobody is being notified about them.',
+ );
expect(getAlertDestinationsDeliveryPausedDescription('snoozed')).toContain('snoozed');
expect(getAlertDestinationsDeliveryPausedDescription('not_activated')).toContain(
'has not been turned on for this install yet',
diff --git a/frontend-modern/src/utils/__tests__/alertOverviewPresentation.test.ts b/frontend-modern/src/utils/__tests__/alertOverviewPresentation.test.ts
index 1c285dfe43..acbc4530c4 100644
--- a/frontend-modern/src/utils/__tests__/alertOverviewPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/alertOverviewPresentation.test.ts
@@ -40,6 +40,7 @@ import {
getAlertOverviewBulkAcknowledgeLabel,
getAlertOverviewBulkAcknowledgedNotification,
getAlertOverviewCardPresentation,
+ formatAlertOverviewStartedAgo,
getAlertOverviewEmptyState,
getAlertOverviewGroupAcknowledgeLabel,
getAlertOverviewGroupDisclosureLabel,
@@ -297,29 +298,30 @@ describe('alertOverviewPresentation', () => {
});
it('returns canonical active alert card presentation', () => {
+ const resourceClassName = 'text-sm font-semibold truncate text-base-content';
expect(getAlertOverviewCardPresentation('critical', false, false)).toEqual({
cardClassName:
- 'border rounded-md p-3 sm:p-4 transition-all border-red-300 dark:border-red-800 bg-red-50 dark:bg-red-900/25',
- iconClassName: 'mr-3 mt-0.5 transition-all text-red-600 dark:text-red-400',
- resourceClassName: 'text-sm font-medium truncate text-red-700 dark:text-red-400',
+ 'border border-l-4 rounded-md px-3 py-2.5 transition-all border-border border-l-red-500 dark:border-l-red-500 bg-surface',
+ iconClassName: 'mr-2.5 mt-0.5 shrink-0 transition-all text-red-600 dark:text-red-400',
+ resourceClassName,
});
expect(getAlertOverviewCardPresentation('warning', true, true)).toEqual({
cardClassName:
- 'border rounded-md p-3 sm:p-4 transition-all opacity-50 border-border bg-surface-alt',
- iconClassName: 'mr-3 mt-0.5 transition-all text-green-600 dark:text-green-400',
- resourceClassName: 'text-sm font-medium truncate text-yellow-700 dark:text-yellow-400',
+ 'border border-l-4 rounded-md px-3 py-2.5 transition-all opacity-50 border-border border-l-border bg-surface-alt',
+ iconClassName: 'mr-2.5 mt-0.5 shrink-0 transition-all text-green-600 dark:text-green-400',
+ resourceClassName,
});
expect(getAlertOverviewCardPresentation('info', false, false)).toEqual({
cardClassName:
- 'border rounded-md p-3 sm:p-4 transition-all border-blue-300 dark:border-blue-800 bg-blue-50 dark:bg-blue-900/25',
- iconClassName: 'mr-3 mt-0.5 transition-all text-blue-600 dark:text-blue-400',
- resourceClassName: 'text-sm font-medium truncate text-blue-700 dark:text-blue-400',
+ 'border border-l-4 rounded-md px-3 py-2.5 transition-all border-border border-l-blue-500 dark:border-l-blue-400 bg-surface',
+ iconClassName: 'mr-2.5 mt-0.5 shrink-0 transition-all text-blue-600 dark:text-blue-400',
+ resourceClassName,
});
expect(getAlertOverviewCardPresentation('notice', false, false)).toEqual({
cardClassName:
- 'border rounded-md p-3 sm:p-4 transition-all border-yellow-300 dark:border-yellow-800 bg-yellow-50 dark:bg-yellow-900/25',
- iconClassName: 'mr-3 mt-0.5 transition-all text-yellow-600 dark:text-yellow-400',
- resourceClassName: 'text-sm font-medium truncate text-yellow-700 dark:text-yellow-400',
+ 'border border-l-4 rounded-md px-3 py-2.5 transition-all border-border border-l-yellow-500 dark:border-l-yellow-400 bg-surface',
+ iconClassName: 'mr-2.5 mt-0.5 shrink-0 transition-all text-yellow-600 dark:text-yellow-400',
+ resourceClassName,
});
expect(getAlertOverviewAcknowledgedBadgeClass()).toBe(
'px-2 py-0.5 text-xs bg-yellow-200 dark:bg-yellow-800 text-yellow-800 dark:text-yellow-200 rounded-sm',
@@ -401,4 +403,18 @@ describe('alertOverviewPresentation', () => {
expect(getAlertTimelineHeading()).toBe('Vorfall');
expect(getAlertTimelineEventTypeLabel('alert_resolved')).toBe('Behoben');
});
+
+ it('says how long ago an alert started in the active locale and moves with the clock', () => {
+ const start = '2026-10-04T12:00:00Z';
+ const at = (minutes: number) => Date.parse(start) + minutes * 60_000;
+ expect(formatAlertOverviewStartedAgo(start, at(0))).toBe('this minute');
+ expect(formatAlertOverviewStartedAgo(start, at(10))).toBe('10 min. ago');
+ expect(formatAlertOverviewStartedAgo(start, at(11))).toBe('11 min. ago');
+ expect(formatAlertOverviewStartedAgo(start, at(180))).toBe('3 hr. ago');
+ expect(formatAlertOverviewStartedAgo(start, at(3 * 24 * 60))).toBe('3 days ago');
+ expect(formatAlertOverviewStartedAgo('not-a-date', at(5))).toBe('');
+ setActiveLocale('de');
+ expect(formatAlertOverviewStartedAgo(start, at(10))).toBe('vor 10 Min.');
+ setActiveLocale(DEFAULT_LOCALE);
+ });
});
diff --git a/frontend-modern/src/utils/alertDestinationsPresentation.ts b/frontend-modern/src/utils/alertDestinationsPresentation.ts
index 1fc3454103..64caa8b729 100644
--- a/frontend-modern/src/utils/alertDestinationsPresentation.ts
+++ b/frontend-modern/src/utils/alertDestinationsPresentation.ts
@@ -1,3 +1,4 @@
+import { t } from '@/i18n';
export const ALERT_DESTINATIONS_CONFIG_LOAD_ERROR =
'Unable to load notification settings. Your existing configuration could not be retrieved.';
export const ALERT_DESTINATIONS_WEBHOOK_LOAD_ERROR = 'Unable to load webhook settings.';
@@ -346,33 +347,47 @@ export function getAlertDeliveryLogFailureClassLabel(failureClass: string) {
return labels[failureClass] ?? labels.unknown;
}
-const ALERT_DESTINATIONS_DELIVERY_PAUSED_TITLE = 'Notifications are paused';
-const ALERT_DESTINATIONS_DELIVERY_PAUSED_ACTION = 'Turn on delivery';
-
export type AlertDestinationsDeliveryPausedReason = 'detection_off' | 'not_activated' | 'snoozed';
export function getAlertDestinationsDeliveryPausedTitle() {
- return ALERT_DESTINATIONS_DELIVERY_PAUSED_TITLE;
+ return t('alerts.delivery.paused.title');
}
export function getAlertDestinationsDeliveryPausedActionLabel() {
- return ALERT_DESTINATIONS_DELIVERY_PAUSED_ACTION;
+ return t('alerts.delivery.paused.action');
+}
+
+export function getAlertDestinationsDeliverySetupLinkLabel() {
+ return t('alerts.delivery.paused.setupLink');
}
-// Describes why nothing configured on this page will actually reach anyone.
-// The test-send caveat is deliberate: test messages bypass the delivery pause,
-// so a successful test is not evidence that live alerts are getting through.
+// Describes why nothing will reach anyone. On the destinations tab the
+// test-send caveat is deliberate: test messages bypass the delivery pause, so
+// a successful test is not evidence that live alerts are getting through. The
+// overview has no destinations below it; there the consequence is that nobody
+// is told about the alerts listed on the page. With alerts switched off Pulse
+// is not detecting anything new, so neither surface may claim it still is.
export function getAlertDestinationsDeliveryPausedDescription(
reason: AlertDestinationsDeliveryPausedReason,
+ surface: 'destinations' | 'overview' = 'destinations',
) {
+ const detectionOff = reason === 'detection_off';
const consequence =
- 'Pulse is still detecting alerts, but none of them will be sent to the destinations below. Test messages bypass the pause, so a successful test does not mean live alerts are getting through.';
-
- if (reason === 'detection_off') {
- return `Alerts are switched off in the alert configuration. ${consequence}`;
- }
- if (reason === 'snoozed') {
- return `Notification delivery is snoozed. ${consequence}`;
- }
- return `Notification delivery has not been turned on for this install yet. ${consequence}`;
+ surface === 'overview'
+ ? t(
+ detectionOff
+ ? 'alerts.delivery.paused.consequence.overviewDetectionOff'
+ : 'alerts.delivery.paused.consequence.overview',
+ )
+ : t(
+ detectionOff
+ ? 'alerts.delivery.paused.consequence.destinationsDetectionOff'
+ : 'alerts.delivery.paused.consequence.destinations',
+ );
+ const cause = detectionOff
+ ? t('alerts.delivery.paused.reason.detectionOff')
+ : reason === 'snoozed'
+ ? t('alerts.delivery.paused.reason.snoozed')
+ : t('alerts.delivery.paused.reason.notActivated');
+ return `${cause} ${consequence}`;
}
diff --git a/frontend-modern/src/utils/alertOverviewPresentation.ts b/frontend-modern/src/utils/alertOverviewPresentation.ts
index 8514cd497c..c165f6ca4d 100644
--- a/frontend-modern/src/utils/alertOverviewPresentation.ts
+++ b/frontend-modern/src/utils/alertOverviewPresentation.ts
@@ -1,4 +1,4 @@
-import { t } from '@/i18n';
+import { getActiveLocale, t } from '@/i18n';
import { getAllFilterOptionLabel } from '@/components/shared/filterOptionPresentation';
export const ALERTS_EMPTY_STATE = 'No active alerts';
@@ -184,6 +184,40 @@ export function getAlertOverviewTimelineActionLabel(isExpanded: boolean): string
: t('alerts.overview.action.timeline');
}
+export function getAlertOverviewMoreActionsLabel(isExpanded: boolean): string {
+ return isExpanded
+ ? t('alerts.overview.action.lessActions')
+ : t('alerts.overview.action.moreActions');
+}
+
+// How long ago an alert started, in the active locale ("10 min ago",
+// "vor 10 Min."). `now` comes from the overview's shared minute clock so the
+// text keeps moving while the page stays open.
+export function formatAlertOverviewStartedAgo(startTime: string, now: number): string {
+ const started = new Date(startTime).getTime();
+ if (Number.isNaN(started)) return '';
+ const seconds = Math.max(0, Math.round((now - started) / 1000));
+ const format = new Intl.RelativeTimeFormat(getActiveLocale(), {
+ numeric: 'auto',
+ style: 'short',
+ });
+ if (seconds < 60) return format.format(0, 'minute');
+ const minutes = Math.floor(seconds / 60);
+ if (minutes < 60) return format.format(-minutes, 'minute');
+ const hours = Math.floor(minutes / 60);
+ if (hours < 24) return format.format(-hours, 'hour');
+ return format.format(-Math.floor(hours / 24), 'day');
+}
+
+export function getAlertOverviewSeverityCountLabel(
+ level: 'critical' | 'warning',
+ count: number,
+): string {
+ return level === 'critical'
+ ? t('alerts.overview.summary.critical', { count })
+ : t('alerts.overview.summary.warning', { count });
+}
+
export function getAlertOverviewSnoozeLabel(): string {
return t('alerts.overview.action.snooze');
}
@@ -398,28 +432,31 @@ export function getAlertOverviewCardPresentation(
const isCritical = level === 'critical';
const isInformational = level === 'info';
const opacityClass = processing ? 'opacity-50' : acknowledged ? 'opacity-60' : '';
+ // Severity rides on a left edge, the icon and the badge rather than a fully
+ // tinted card, so a page of warnings stays scannable instead of one block
+ // of colour.
const stateClass = acknowledged
- ? 'border-border bg-surface-alt'
+ ? 'border-border border-l-border bg-surface-alt'
: isCritical
- ? 'border-red-300 dark:border-red-800 bg-red-50 dark:bg-red-900/25'
+ ? 'border-border border-l-red-500 dark:border-l-red-500 bg-surface'
: isInformational
- ? 'border-blue-300 dark:border-blue-800 bg-blue-50 dark:bg-blue-900/25'
- : 'border-yellow-300 dark:border-yellow-800 bg-yellow-50 dark:bg-yellow-900/25';
+ ? 'border-border border-l-blue-500 dark:border-l-blue-400 bg-surface'
+ : 'border-border border-l-yellow-500 dark:border-l-yellow-400 bg-surface';
const iconClassName = acknowledged
- ? 'mr-3 mt-0.5 transition-all text-green-600 dark:text-green-400'
+ ? 'mr-2.5 mt-0.5 shrink-0 transition-all text-green-600 dark:text-green-400'
: isCritical
- ? 'mr-3 mt-0.5 transition-all text-red-600 dark:text-red-400'
+ ? 'mr-2.5 mt-0.5 shrink-0 transition-all text-red-600 dark:text-red-400'
: isInformational
- ? 'mr-3 mt-0.5 transition-all text-blue-600 dark:text-blue-400'
- : 'mr-3 mt-0.5 transition-all text-yellow-600 dark:text-yellow-400';
- const resourceClassName = isCritical
- ? 'text-sm font-medium truncate text-red-700 dark:text-red-400'
- : isInformational
- ? 'text-sm font-medium truncate text-blue-700 dark:text-blue-400'
- : 'text-sm font-medium truncate text-yellow-700 dark:text-yellow-400';
+ ? 'mr-2.5 mt-0.5 shrink-0 transition-all text-blue-600 dark:text-blue-400'
+ : 'mr-2.5 mt-0.5 shrink-0 transition-all text-yellow-600 dark:text-yellow-400';
+ const resourceClassName = 'text-sm font-semibold truncate text-base-content';
return {
- cardClassName: ['border rounded-md p-3 sm:p-4 transition-all', opacityClass, stateClass]
+ cardClassName: [
+ 'border border-l-4 rounded-md px-3 py-2.5 transition-all',
+ opacityClass,
+ stateClass,
+ ]
.filter(Boolean)
.join(' '),
iconClassName,