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.

feat: add fleet health home

pulse-triage[bot]c25349504501
diff --git a/docs/API.md b/docs/API.md
index f887402612..f9c914dfb5 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -85,10 +85,33 @@ Returns a lightweight integration summary for external dashboards and checks. Re
"cpuUsagePercent": 12.5
}
],
+ "verdicts": {
+ "ok": 17,
+ "attention": 1,
+ "critical": 1,
+ "stale": 1,
+ "off": 2,
+ "unknown": 0
+ },
+ "attention": [
+ {
+ "id": "node-1",
+ "name": "PVE Node 1",
+ "type": "agent",
+ "platformType": "proxmox",
+ "verdict": "critical",
+ "topReason": { "code": "offline" }
+ }
+ ],
"lastUpdate": "2026-05-24T10:11:12Z"
}
```
+`verdicts` uses the canonical `ok`, `attention`, `critical`, `stale`, `off`,
+and `unknown` fleet-health vocabulary. `attention` is severity ordered and
+capped at 30 entries. Powered-off workloads are neutral (`off`), and stale or
+missing telemetry is never reported as `ok`.
+
### Simple Stats (HTML)
`GET /simple-stats`
Lightweight HTML status page for quick checks.
@@ -114,6 +137,11 @@ Query params:
Note: `GET /api/resources` is optimized for list views. Some large, platform-specific fields may be omitted from the list response and are only returned by `GET /api/resources/{id}`.
+Each list resource can include a backend-owned `health` envelope with a
+canonical `verdict` and stable `reasons` (`code` plus optional compact
+`detail`). Consumers should use this envelope for cross-platform posture
+instead of deriving health from provider-specific status strings.
+
Note: guest disk usage percentages use `-1` as an "unknown" sentinel — reported when a VM is stopped or its guest agent is unavailable, so there is no filesystem view to measure. Consumers should treat negative values as "no data", not as a percentage; the accompanying `diskStatusReason` field (e.g. `vm-stopped`, `agent-disabled`) says why.
Availability is an additive resource facet. `availability` is the compatibility
diff --git a/docs/release-control/v6/internal/HOME_STATUS_WALL_SPEC.md b/docs/release-control/v6/internal/HOME_STATUS_WALL_SPEC.md
index c6e9903970..7e76c1e37e 100644
--- a/docs/release-control/v6/internal/HOME_STATUS_WALL_SPEC.md
+++ b/docs/release-control/v6/internal/HOME_STATUS_WALL_SPEC.md
@@ -1,7 +1,7 @@
# Home Status Wall Spec
-Last updated: 2026-07-10
-Status: PLANNED
+Last updated: 2026-09-01
+Status: IMPLEMENTED (tab-reachable; default-route gate remains)
Owner of record: Richard (product decisions), implementing agent (execution)
Related evidence: GitHub issues #1478, #1433, #1460
@@ -139,12 +139,12 @@ additively — existing fields keep their names and types (external users may
already consume them):
- `verdicts`: object of counts `{ok, attention, critical, stale, off, unknown}`
-- `attention`: array (capped at 50, most severe first) of
+- `attention`: array (capped at 30, most severe first) of
`{id, name, type, platformType, verdict, topReason}`
Update `router_state_test.go` / `state_summary` tests accordingly. Payload
-target stays well under 5 KB for a 200-resource fleet; the `attention` cap
-guarantees boundedness.
+target stays well under 5 KB for a 200-resource fleet; implementation testing
+reduced the originally proposed cap from 50 to 30 to preserve that target.
Governance: this changes an API surface — update the api-contracts
subsystem notes honestly. As of 2026-07-10
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index 18962ed93e..3e7403f4d5 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -2737,11 +2737,14 @@ a new API state machine, queue contract, or verification-accounting field.
That same shared API contract also owns the external resource `type`, canonical display name, and cluster identity published through `/api/resources` and `/api/state`; the websocket/state hydrate path must not emit legacy aliases or raw store labels once the unified resource contract has normalized them.
Lightweight integration polling uses the same canonical read-state boundary:
`GET /api/state/summary` is an authenticated `monitoring:read` route that
- returns only aggregate counts, Docker host summaries, active-alert count,
- and `lastUpdate`. It must stay derived from the unified read state plus the
- alert snapshot, and must not expose `resources`, per-resource histories,
- raw provider payloads, command data, or child arrays from the full
- `/api/state` dashboard hydrate.
+ returns aggregate counts, Docker host summaries, active-alert count,
+ canonical verdict counts, a severity-ordered attention projection capped at
+ 30 resources, and `lastUpdate`. It must stay derived from the unified read
+ state plus the tenant-scoped alert snapshot, and must not expose full
+ resources, per-resource histories, raw provider payloads, command data, or
+ child arrays from the full `/api/state` hydrate. The same backend-owned
+ `health` envelope is additive on `/api/resources` and websocket resource
+ rows; frontend surfaces must not re-derive health from provider status.
Realtime `/api/state` and websocket `resources` snapshots must also collapse
transient split host identities before broadcast: a Proxmox-node row and a
host-agent row for the same machine must leave the API boundary as one
diff --git a/frontend-modern/public/docs/API.md b/frontend-modern/public/docs/API.md
index f887402612..f9c914dfb5 100644
--- a/frontend-modern/public/docs/API.md
+++ b/frontend-modern/public/docs/API.md
@@ -85,10 +85,33 @@ Returns a lightweight integration summary for external dashboards and checks. Re
"cpuUsagePercent": 12.5
}
],
+ "verdicts": {
+ "ok": 17,
+ "attention": 1,
+ "critical": 1,
+ "stale": 1,
+ "off": 2,
+ "unknown": 0
+ },
+ "attention": [
+ {
+ "id": "node-1",
+ "name": "PVE Node 1",
+ "type": "agent",
+ "platformType": "proxmox",
+ "verdict": "critical",
+ "topReason": { "code": "offline" }
+ }
+ ],
"lastUpdate": "2026-05-24T10:11:12Z"
}
```
+`verdicts` uses the canonical `ok`, `attention`, `critical`, `stale`, `off`,
+and `unknown` fleet-health vocabulary. `attention` is severity ordered and
+capped at 30 entries. Powered-off workloads are neutral (`off`), and stale or
+missing telemetry is never reported as `ok`.
+
### Simple Stats (HTML)
`GET /simple-stats`
Lightweight HTML status page for quick checks.
@@ -114,6 +137,11 @@ Query params:
Note: `GET /api/resources` is optimized for list views. Some large, platform-specific fields may be omitted from the list response and are only returned by `GET /api/resources/{id}`.
+Each list resource can include a backend-owned `health` envelope with a
+canonical `verdict` and stable `reasons` (`code` plus optional compact
+`detail`). Consumers should use this envelope for cross-platform posture
+instead of deriving health from provider-specific status strings.
+
Note: guest disk usage percentages use `-1` as an "unknown" sentinel — reported when a VM is stopped or its guest agent is unavailable, so there is no filesystem view to measure. Consumers should treat negative values as "no data", not as a percentage; the accompanying `diskStatusReason` field (e.g. `vm-stopped`, `agent-disabled`) says why.
Availability is an additive resource facet. `availability` is the compatibility
diff --git a/frontend-modern/src/App.tsx b/frontend-modern/src/App.tsx
index 501f450b1c..7ba3eff584 100644
--- a/frontend-modern/src/App.tsx
+++ b/frontend-modern/src/App.tsx
@@ -42,6 +42,7 @@ import { useKeyboardShortcuts } from './hooks/useKeyboardShortcuts';
import { useKioskMode } from '@/hooks/useKioskMode';
import {
DOCKER_PATH,
+ HOME_PATH,
KUBERNETES_PATH,
PATROL_PATH,
PROXMOX_PATH,
@@ -99,6 +100,7 @@ function isWorkspaceEntryRoutePath(pathname: string): boolean {
const AlertsPage = lazy(() =>
import('./pages/Alerts').then((module) => ({ default: module.Alerts })),
);
+const HomePage = lazy(() => import('./features/home/HomePageSurface'));
const ActionsPage = lazy(() => import('./pages/Actions'));
const SettingsPage = lazy(() => import('./components/Settings/Settings'));
const ProxmoxPage = lazy(() => import('./pages/Proxmox'));
@@ -631,6 +633,7 @@ function App() {
<Route path="/login" component={RuntimeHomePage} />
<Route path="/" component={RuntimeHomePage} />
<Route path="/infrastructure" component={RuntimeHomePage} />
+ <Route path={HOME_PATH} component={HomePage} />
<Route path={PROXMOX_PATH} component={ProxmoxPage} />
<Route path={`${PROXMOX_PATH}/*`} component={ProxmoxPage} />
<Route path={DOCKER_PATH} component={DockerPage} />
diff --git a/frontend-modern/src/AppLayout.tsx b/frontend-modern/src/AppLayout.tsx
index 2fae9e46d7..dc90d45560 100644
--- a/frontend-modern/src/AppLayout.tsx
+++ b/frontend-modern/src/AppLayout.tsx
@@ -8,6 +8,7 @@ import SettingsIcon from 'lucide-solid/icons/settings';
import Maximize2Icon from 'lucide-solid/icons/maximize-2';
import Minimize2Icon from 'lucide-solid/icons/minimize-2';
import SparklesIcon from 'lucide-solid/icons/sparkles';
+import HouseIcon from 'lucide-solid/icons/house';
import { getPlatformIcon } from '@/features/platformPage/platformIcon';
import {
MobileNavBar,
@@ -42,6 +43,7 @@ import { getActiveTabForPath } from '@/routing/navigation';
import { preloadRouteModule } from '@/routing/routePreload';
import {
DOCKER_PATH,
+ HOME_PATH,
KUBERNETES_PATH,
PROXMOX_PATH,
STANDALONE_PATH,
@@ -66,6 +68,7 @@ import { presentationPolicyHidesUpgradePrompts } from '@/stores/sessionPresentat
import { getAssistantPageContext } from '@/utils/assistantPageContext';
import type { AppConnectionStatus } from '@/useAppRuntimeState';
import { buildInfrastructureWorkspacePath } from '@/components/Settings/infrastructureWorkspaceModel';
+import { t } from '@/i18n';
const ROOT_PROXMOX_PATH = buildProxmoxPath();
const ROOT_DOCKER_PATH = buildDockerPath();
@@ -110,9 +113,11 @@ function resolvePrimaryNavigationRoute(tab: PrimaryTab, routeMemory: PrimaryRout
if (!tab.enabled) {
return tab.settingsRoute;
}
- const remembered = routeMemory[tab.id as PrimaryPlatformNavId];
- if (remembered && routeBelongsToPrimaryTab(remembered, tab.id as PrimaryPlatformNavId)) {
- return remembered;
+ if (isPrimaryPlatformNavId(tab.id)) {
+ const remembered = routeMemory[tab.id];
+ if (remembered && routeBelongsToPrimaryTab(remembered, tab.id)) {
+ return remembered;
+ }
}
return tab.route;
}
@@ -297,6 +302,7 @@ export function AppLayout(props: AppLayoutProps) {
// identify the current Pulse surface instead of every page reading
// as the bare app name.
const tabTitleByActive: Record<NonNullable<ReturnType<typeof getActiveTabForPath>>, string> = {
+ home: 'Home',
proxmox: 'Proxmox',
docker: 'Docker',
kubernetes: 'Kubernetes',
@@ -499,6 +505,17 @@ export function AppLayout(props: AppLayoutProps) {
const isVisible = (id: PrimaryTab['id']) =>
primaryPlatformNavigationIsVisible(visible, id as PrimaryPlatformNavId);
const allPrimaryTabs: PrimaryTab[] = [
+ {
+ id: 'home',
+ label: t('home.title'),
+ route: HOME_PATH,
+ settingsRoute: HOME_PATH,
+ tooltip: t('home.nav.tooltip'),
+ enabled: true,
+ live: true,
+ icon: HouseIcon,
+ alwaysShow: true,
+ },
{
id: 'proxmox',
label: 'Proxmox',
diff --git a/frontend-modern/src/__tests__/AppLayout.test.tsx b/frontend-modern/src/__tests__/AppLayout.test.tsx
index 821a963de7..5420d95070 100644
--- a/frontend-modern/src/__tests__/AppLayout.test.tsx
+++ b/frontend-modern/src/__tests__/AppLayout.test.tsx
@@ -291,7 +291,7 @@ describe('AppLayout navigation icons', () => {
within(infrastructureGroup as HTMLElement)
.getAllByRole('link')
.map((tab) => tab.getAttribute('aria-label')),
- ).toEqual(['Proxmox', 'Docker', 'vSphere', 'Machines']);
+ ).toEqual(['Home', 'Proxmox', 'Docker', 'vSphere', 'Machines']);
expect(
within(infrastructureGroup as HTMLElement).getByRole('link', { name: 'Machines' }),
).toBeTruthy();
@@ -313,14 +313,14 @@ describe('AppLayout navigation icons', () => {
const mobileNav = screen.getByRole('navigation', { name: 'Mobile navigation' });
fireEvent.click(
- within(mobileNav).getByRole('button', { name: 'Switch platform, current Proxmox' }),
+ within(mobileNav).getByRole('button', { name: 'Switch platform, current Home' }),
);
const platformMenu = screen.getByRole('menu', { name: 'Switch platform' });
expect(
within(platformMenu)
.getAllByRole('menuitem')
.map((item) => item.getAttribute('data-tab-id')),
- ).toEqual(['proxmox', 'docker', 'vmware', 'standalone']);
+ ).toEqual(['home', 'proxmox', 'docker', 'vmware', 'standalone']);
});
it('does not expose cached platform evidence before navigation admission resolves', () => {
@@ -340,7 +340,10 @@ describe('AppLayout navigation icons', () => {
const desktopNav = screen.getByRole('navigation', { name: 'Primary navigation' });
const infrastructureGroup = desktopNav.querySelector('[aria-label="Infrastructure"]');
expect(infrastructureGroup).toBeTruthy();
- expect(within(infrastructureGroup as HTMLElement).queryByRole('link')).toBeNull();
+ expect(
+ within(infrastructureGroup as HTMLElement).getByRole('link', { name: 'Home' }),
+ ).toHaveAttribute('href', '/home');
+ expect(within(infrastructureGroup as HTMLElement).getAllByRole('link')).toHaveLength(1);
});
it('restores the previous Proxmox route state when returning from another platform tab', async () => {
diff --git a/frontend-modern/src/components/shared/mobileNavBarModel.ts b/frontend-modern/src/components/shared/mobileNavBarModel.ts
index 1045a34a58..8e87990c1a 100644
--- a/frontend-modern/src/components/shared/mobileNavBarModel.ts
+++ b/frontend-modern/src/components/shared/mobileNavBarModel.ts
@@ -48,6 +48,7 @@ export type MobileNavBarLayout = {
};
const MOBILE_NAV_PRIMARY_PRIORITY = [
+ 'home',
'proxmox',
'docker',
'kubernetes',
diff --git a/frontend-modern/src/features/home/HomePageSurface.tsx b/frontend-modern/src/features/home/HomePageSurface.tsx
new file mode 100644
index 0000000000..95655c1f53
--- /dev/null
+++ b/frontend-modern/src/features/home/HomePageSurface.tsx
@@ -0,0 +1,289 @@
+import { A } from '@solidjs/router';
+import { For, Show, createMemo, createSignal } from 'solid-js';
+import ChevronDownIcon from 'lucide-solid/icons/chevron-down';
+import ChevronUpIcon from 'lucide-solid/icons/chevron-up';
+import RefreshCwIcon from 'lucide-solid/icons/refresh-cw';
+import { Button, ButtonLink } from '@/components/shared/Button';
+import { LoadingSpinner } from '@/components/shared/LoadingSpinner';
+import { PageHeader } from '@/components/shared/PageHeader';
+import { StatusDot } from '@/components/shared/StatusDot';
+import { useResources } from '@/hooks/useResources';
+import { getActiveLocale, t } from '@/i18n';
+import { buildInfrastructureWorkspacePath } from '@/components/Settings/infrastructureWorkspaceModel';
+import type { ResourceHealthReason, ResourceHealthVerdict } from '@/types/resource';
+import {
+ buildHomeAttentionTiles,
+ buildHomePosture,
+ buildHomeResourceGroups,
+ getHomeVerdictTone,
+ type HomePlatformKey,
+ type HomeResourceTile,
+} from './homePageModel';
+
+const VERDICT_CLASS: Record<ResourceHealthVerdict, string> = {
+ ok: 'border-emerald-300 bg-emerald-50 text-base-content dark:border-emerald-800 dark:bg-emerald-950/40',
+ attention:
+ 'border-amber-400 bg-amber-50 text-base-content dark:border-amber-700 dark:bg-amber-950/40',
+ critical: 'border-red-400 bg-red-50 text-base-content dark:border-red-800 dark:bg-red-950/40',
+ stale:
+ 'border-dashed border-slate-400 bg-slate-50 text-slate-800 dark:border-slate-600 dark:bg-slate-900/60 dark:text-slate-200',
+ off: 'border-border bg-surface text-muted',
+ unknown: 'border-dashed border-slate-400 bg-surface text-muted',
+};
+
+const platformLabel = (key: HomePlatformKey): string => {
+ switch (key) {
+ case 'proxmox':
+ return t('home.platform.proxmox');
+ case 'docker':
+ return t('home.platform.docker');
+ case 'kubernetes':
+ return t('home.platform.kubernetes');
+ case 'truenas':
+ return t('home.platform.truenas');
+ case 'vmware':
+ return t('home.platform.vmware');
+ case 'standalone':
+ return t('home.platform.standalone');
+ default:
+ return t('home.platform.other');
+ }
+};
+
+const verdictLabel = (verdict: ResourceHealthVerdict): string => {
+ switch (verdict) {
+ case 'ok':
+ return t('home.verdict.ok');
+ case 'attention':
+ return t('home.verdict.attention');
+ case 'critical':
+ return t('home.verdict.critical');
+ case 'stale':
+ return t('home.verdict.stale');
+ case 'off':
+ return t('home.verdict.off');
+ default:
+ return t('home.verdict.unknown');
+ }
+};
+
+const reasonLabel = (
+ reason: ResourceHealthReason | undefined,
+ verdict: ResourceHealthVerdict,
+): string => {
+ if (!reason) return verdictLabel(verdict);
+ const detail = reason.detail ? ` ${reason.detail}` : '';
+ switch (reason.code) {
+ case 'critical_alert':
+ return t('home.reason.criticalAlert', { detail });
+ case 'warning_alert':
+ return t('home.reason.warningAlert', { detail });
+ case 'availability_failed':
+ return t('home.reason.availabilityFailed');
+ case 'offline':
+ return t('home.reason.offline');
+ case 'backup_stale':
+ return t('home.reason.backupStale', { detail });
+ case 'telemetry_stale':
+ return t('home.reason.telemetryStale', { detail });
+ case 'telemetry_missing':
+ return t('home.reason.telemetryMissing');
+ case 'powered_off':
+ return t('home.reason.poweredOff');
+ case 'degraded':
+ return t('home.reason.degraded');
+ default:
+ return verdictLabel(verdict);
+ }
+};
+
+function ResourceTile(props: { tile: HomeResourceTile }) {
+ const reason = () => reasonLabel(props.tile.reason, props.tile.verdict);
+ return (
+ <A
+ href={props.tile.href}
+ class={`group flex min-h-20 flex-col justify-between rounded-lg border p-3 transition-colors hover:brightness-[0.98] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500 ${VERDICT_CLASS[props.tile.verdict]}`}
+ aria-label={t('home.tile.ariaLabel', {
+ name: props.tile.name,
+ status: verdictLabel(props.tile.verdict),
+ reason: reason(),
+ })}
+ >
+ <div class="flex min-w-0 items-start gap-2">
+ <StatusDot
+ variant={getHomeVerdictTone(props.tile.verdict)}
+ size="md"
+ class="mt-1.5"
+ ariaHidden
+ />
+ <span class="min-w-0 break-words text-sm font-semibold leading-5">{props.tile.name}</span>
+ </div>
+ <Show when={props.tile.verdict !== 'ok'}>
+ <span class="mt-2 pl-[18px] text-xs font-medium opacity-80">{reason()}</span>
+ </Show>
+ </A>
+ );
+}
+
+export default function HomePageSurface() {
+ const resources = useResources();
+ const [expandedGroups, setExpandedGroups] = createSignal<ReadonlySet<HomePlatformKey>>(new Set());
+ const posture = createMemo(() => buildHomePosture(resources.resources()));
+ const attentionTiles = createMemo(() => buildHomeAttentionTiles(resources.resources()));
+ const groups = createMemo(() => buildHomeResourceGroups(resources.resources(), expandedGroups()));
+ const lastUpdated = createMemo(() => {
+ const timestamp = resources
+ .resources()
+ .reduce((latest, resource) => Math.max(latest, resource.lastSeen || 0), 0);
+ if (!timestamp) return t('home.updated.unknown');
+ return new Intl.DateTimeFormat(getActiveLocale(), {
+ dateStyle: 'medium',
+ timeStyle: 'short',
+ }).format(timestamp);
+ });
+ const postureText = createMemo(() => {
+ const value = posture();
+ if (value.total > 0 && value.ok === value.total) {
+ return t('home.posture.allHealthy', { total: value.total, updated: lastUpdated() });
+ }
+ return t(
+ value.needsAttention === 1 ? 'home.posture.summary.singular' : 'home.posture.summary.plural',
+ {
+ attention: value.needsAttention,
+ healthy: value.ok,
+ total: value.total,
+ stale: value.stale,
+ unknown: value.unknown,
+ updated: lastUpdated(),
+ },
+ );
+ });
+ const toggleGroup = (key: HomePlatformKey) => {
+ setExpandedGroups((current) => {
+ const next = new Set(current);
+ if (next.has(key)) next.delete(key);
+ else next.add(key);
+ return next;
+ });
+ };
+
+ return (
+ <div class="space-y-6">
+ <PageHeader
+ title={t('home.title')}
+ description={t('home.description')}
+ descriptionVisibility="always"
+ actions={
+ <Button
+ variant="ghost"
+ size="sm"
+ aria-label={t('home.refresh.ariaLabel')}
+ isLoading={resources.loading()}
+ onClick={() => void resources.refetch()}
+ >
+ <RefreshCwIcon class="mr-2 h-4 w-4" aria-hidden="true" />
+ {t('home.refresh.label')}
+ </Button>
+ }
+ />
+
+ <Show when={resources.loading() && resources.resources().length === 0}>
+ <div
+ class="flex items-center gap-2 rounded-lg border border-border bg-surface p-4 text-sm text-muted"
+ role="status"
+ >
+ <LoadingSpinner size="sm" />
+ {t('home.loading')}
+ </div>
+ </Show>
+
+ <Show when={resources.error() && resources.resources().length === 0}>
+ <div
+ class="rounded-lg border border-red-300 bg-red-50 p-4 text-red-900 dark:border-red-800 dark:bg-red-950/40 dark:text-red-100"
+ role="alert"
+ >
+ <p class="font-semibold">{t('home.error.title')}</p>
+ <p class="mt-1 text-sm">{t('home.error.description')}</p>
+ <Button class="mt-3" size="sm" onClick={() => void resources.refetch()}>
+ {t('home.error.retry')}
+ </Button>
+ </div>
+ </Show>
+
+ <Show when={!resources.loading() && !resources.error() && resources.resources().length === 0}>
+ <section
+ class="rounded-xl border border-border bg-surface p-6 text-center"
+ aria-labelledby="home-empty-title"
+ >
+ <h2 id="home-empty-title" class="text-lg font-semibold">
+ {t('home.empty.title')}
+ </h2>
+ <p class="mx-auto mt-2 max-w-xl text-sm text-muted">{t('home.empty.description')}</p>
+ <ButtonLink class="mt-4" href={buildInfrastructureWorkspacePath()}>
+ {t('home.empty.action')}
+ </ButtonLink>
+ </section>
+ </Show>
+
+ <Show when={resources.resources().length > 0}>
+ <p
+ class="border-y border-border py-3 text-sm font-medium text-base-content"
+ role="status"
+ aria-live="polite"
+ >
+ {postureText()}
+ </p>
+
+ <Show when={attentionTiles().length > 0}>
+ <section class="space-y-3" aria-labelledby="home-attention-title">
+ <div>
+ <h2 id="home-attention-title" class="text-lg font-semibold">
+ {t('home.attention.title')}
+ </h2>
+ <p class="text-sm text-muted">{t('home.attention.description')}</p>
+ </div>
+ <div class="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
+ <For each={attentionTiles()}>{(tile) => <ResourceTile tile={tile} />}</For>
+ </div>
+ </section>
+ </Show>
+
+ <For each={groups()}>
+ {(group) => {
+ const expanded = () => expandedGroups().has(group.key);
+ return (
+ <section class="space-y-3" aria-labelledby={`home-group-${group.key}`}>
+ <div class="flex items-end justify-between gap-3">
+ <h2 id={`home-group-${group.key}`} class="text-lg font-semibold">
+ {platformLabel(group.key)}
+ </h2>
+ <Show when={group.hiddenCount > 0 || expanded()}>
+ <button
+ type="button"
+ onClick={() => toggleGroup(group.key)}
+ class="inline-flex min-h-11 items-center gap-1 rounded-md px-2 text-sm font-medium text-blue-600 hover:bg-surface-hover focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500 dark:text-blue-400"
+ aria-expanded={expanded()}
+ >
+ {expanded()
+ ? t('home.group.showLess')
+ : t('home.group.showAll', { count: group.hiddenCount })}
+ <Show
+ when={expanded()}
+ fallback={<ChevronDownIcon class="h-4 w-4" aria-hidden="true" />}
+ >
+ <ChevronUpIcon class="h-4 w-4" aria-hidden="true" />
+ </Show>
+ </button>
+ </Show>
+ </div>
+ <div class="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
+ <For each={group.tiles}>{(tile) => <ResourceTile tile={tile} />}</For>
+ </div>
+ </section>
+ );
+ }}
+ </For>
+ </Show>
+ </div>
+ );
+}
diff --git a/frontend-modern/src/features/home/__tests__/HomePageSurface.test.tsx b/frontend-modern/src/features/home/__tests__/HomePageSurface.test.tsx
new file mode 100644
index 0000000000..86054b8dc6
--- /dev/null
+++ b/frontend-modern/src/features/home/__tests__/HomePageSurface.test.tsx
@@ -0,0 +1,80 @@
+import { cleanup, render, screen } from '@solidjs/testing-library';
+import { Route, Router } from '@solidjs/router';
+import { afterEach, describe, expect, it, vi } from 'vitest';
+import type { Resource } from '@/types/resource';
+import HomePageSurface from '../HomePageSurface';
+
+const resourcesMock = vi.hoisted(() => vi.fn());
+
+vi.mock('@/hooks/useResources', () => ({
+ useResources: () => resourcesMock(),
+}));
+
+const resource = (overrides: Partial<Resource>): Resource => ({
+ id: 'host-1',
+ type: 'agent',
+ name: 'Host One',
+ displayName: 'Host One',
+ platformId: 'pve-1',
+ platformType: 'proxmox-pve',
+ sourceType: 'api',
+ status: 'online',
+ lastSeen: Date.now(),
+ health: { verdict: 'ok', reasons: [] },
+ ...overrides,
+});
+
+const renderHome = (items: Resource[]) => {
+ resourcesMock.mockReturnValue({
+ resources: () => items,
+ loading: () => false,
+ error: () => undefined,
+ refetch: vi.fn(async () => items),
+ });
+ window.history.replaceState({}, '', '/home');
+ return render(() => (
+ <Router>
+ <Route path="/home" component={HomePageSurface} />
+ </Router>
+ ));
+};
+
+describe('HomePageSurface', () => {
+ afterEach(() => {
+ cleanup();
+ resourcesMock.mockReset();
+ window.history.replaceState({}, '', '/');
+ });
+
+ it('presents attention before platform groups with descriptive resource links', () => {
+ renderHome([
+ resource({
+ id: 'critical-host',
+ name: 'Critical Host',
+ displayName: 'Critical Host',
+ health: { verdict: 'critical', reasons: [{ code: 'offline' }] },
+ }),
+ resource({ id: 'healthy-host', name: 'Healthy Host', displayName: 'Healthy Host' }),
+ ]);
+
+ expect(screen.getByRole('heading', { level: 1, name: 'Home' })).toBeInTheDocument();
+ expect(screen.getByRole('heading', { name: 'Needs attention' })).toBeInTheDocument();
+ expect(
+ screen.getByRole('link', { name: 'Critical Host: Critical. Offline' }),
+ ).toBeInTheDocument();
+ expect(
+ screen.getByRole('link', { name: 'Healthy Host: Healthy. Healthy' }),
+ ).toBeInTheDocument();
+ });
+
+ it('offers infrastructure onboarding rather than an unexplained blank page', () => {
+ renderHome([]);
+ expect(
+ screen.getByRole('heading', { name: 'Connect your first monitored system' }),
+ ).toBeInTheDocument();
+ expect(screen.getByRole('link', { name: 'Add infrastructure' })).toHaveAttribute(
+ 'href',
+ '/settings/infrastructure',
+ );
+ });
+});
diff --git a/frontend-modern/src/features/home/__tests__/homePageModel.test.ts b/frontend-modern/src/features/home/__tests__/homePageModel.test.ts
new file mode 100644
index 0000000000..46ee6b99e0
--- /dev/null
+++ b/frontend-modern/src/features/home/__tests__/homePageModel.test.ts
@@ -0,0 +1,99 @@
+import { describe, expect, it } from 'vitest';
+import type { Resource, ResourceHealthVerdict } from '@/types/resource';
+import {
+ HOME_HEALTHY_GROUP_LIMIT,
+ buildHomeAttentionTiles,
+ buildHomePosture,
+ buildHomeResourceGroups,
+ getHomeResourceHref,
+ getHomeVerdictTone,
+} from '../homePageModel';
+
+const resource = (
+ id: string,
+ verdict: ResourceHealthVerdict,
+ platformType: Resource['platformType'] = 'proxmox-pve',
+): Resource => ({
+ id,
+ type: 'vm',
+ name: id,
+ displayName: id,
+ platformId: 'platform-1',
+ platformType,
+ sourceType: 'api',
+ status: verdict === 'off' ? 'stopped' : 'online',
+ lastSeen: Date.now(),
+ health: { verdict, reasons: verdict === 'ok' ? [] : [{ code: `${verdict}_reason` }] },
+});
+
+describe('homePageModel', () => {
+ it('counts every canonical verdict without treating powered-off workloads as failures', () => {
+ const posture = buildHomePosture([
+ resource('ok', 'ok'),
+ resource('critical', 'critical'),
+ resource('attention', 'attention'),
+ resource('stale', 'stale'),
+ resource('off', 'off'),
+ resource('unknown', 'unknown'),
+ ]);
+ expect(posture).toMatchObject({
+ total: 6,
+ ok: 1,
+ critical: 1,
+ attention: 1,
+ stale: 1,
+ off: 1,
+ unknown: 1,
+ needsAttention: 2,
+ });
+ });
+
+ it('puts critical resources before attention resources and sorts names stably', () => {
+ const tiles = buildHomeAttentionTiles([
+ resource('z-warning', 'attention'),
+ resource('b-critical', 'critical'),
+ resource('a-critical', 'critical'),
+ ]);
+ expect(tiles.map((tile) => tile.name)).toEqual(['a-critical', 'b-critical', 'z-warning']);
+ });
+
+ it('never hides stale or unknown resources behind the healthy group cap', () => {
+ const resources = Array.from({ length: HOME_HEALTHY_GROUP_LIMIT + 5 }, (_, index) =>
+ resource(`healthy-${index}`, 'ok'),
+ );
+ resources.push(resource('stale-first', 'stale'), resource('unknown-second', 'unknown'));
+ const [group] = buildHomeResourceGroups(resources);
+ expect(group?.tiles.slice(0, 2).map((tile) => tile.name)).toEqual([
+ 'stale-first',
+ 'unknown-second',
+ ]);
+ expect(group?.hiddenCount).toBe(5);
+ });
+
+ it('groups resources in product navigation order and removes attention duplicates', () => {
+ const groups = buildHomeResourceGroups([
+ resource('vsphere', 'ok', 'vmware-vsphere'),
+ resource('docker', 'ok', 'docker'),
+ resource('urgent', 'critical', 'proxmox-pve'),
+ ]);
+ expect(groups.map((group) => group.key)).toEqual(['docker', 'vmware']);
+ });
+
+ it('uses the shared status tones for every canonical verdict', () => {
+ expect(
+ ['ok', 'attention', 'critical', 'stale', 'off', 'unknown'].map((verdict) =>
+ getHomeVerdictTone(verdict as ResourceHealthVerdict),
+ ),
+ ).toEqual(['success', 'warning', 'danger', 'muted', 'muted', 'muted']);
+ });
+
+ it('links workloads to valid existing platform surfaces', () => {
+ expect(getHomeResourceHref(resource('pve-vm', 'ok'))).toBe('/proxmox/overview?resource=pve-vm');
+ expect(getHomeResourceHref(resource('docker-container', 'ok', 'docker'))).toBe(
+ '/docker/overview',
+ );
+ expect(getHomeResourceHref(resource('vsphere-vm', 'ok', 'vmware-vsphere'))).toBe(
+ '/vmware/overview?resource=vsphere-vm',
+ );
+ });
+});
diff --git a/frontend-modern/src/features/home/homePageModel.ts b/frontend-modern/src/features/home/homePageModel.ts
new file mode 100644
index 0000000000..98ea99d9c7
--- /dev/null
+++ b/frontend-modern/src/features/home/homePageModel.ts
@@ -0,0 +1,232 @@
+import {
+ isStorage,
+ isWorkload,
+ type Resource,
+ type ResourceHealthReason,
+ type ResourceHealthVerdict,
+} from '@/types/resource';
+import type { StatusIndicatorVariant } from '@/utils/status';
+import {
+ buildDockerPath,
+ buildKubernetesPath,
+ buildProxmoxPath,
+ buildStandalonePath,
+ buildStorageRouteSearch,
+ buildTrueNASPath,
+ buildVmwarePath,
+ buildWorkloadsRouteSearch,
+} from '@/routing/resourceLinks';
+import { getPreferredInfrastructureDisplayName } from '@/utils/resourceIdentity';
+
+export const HOME_HEALTHY_GROUP_LIMIT = 60;
+
+export type HomePlatformKey =
+ 'proxmox' | 'docker' | 'kubernetes' | 'truenas' | 'vmware' | 'standalone' | 'other';
+
+export type HomeResourceTile = {
+ resource: Resource;
+ name: string;
+ verdict: ResourceHealthVerdict;
+ reason?: ResourceHealthReason;
+ href: string;
+};
+
+export type HomeResourceGroup = {
+ key: HomePlatformKey;
+ tiles: HomeResourceTile[];
+ hiddenCount: number;
+};
+
+export type HomePosture = Record<ResourceHealthVerdict, number> & {
+ total: number;
+ needsAttention: number;
+};
+
+const PLATFORM_ORDER: readonly HomePlatformKey[] = [
+ 'proxmox',
+ 'docker',
+ 'kubernetes',
+ 'truenas',
+ 'vmware',
+ 'standalone',
+ 'other',
+];
+
+const VERDICT_RANK: Record<ResourceHealthVerdict, number> = {
+ critical: 5,
+ attention: 4,
+ stale: 3,
+ unknown: 2,
+ off: 1,
+ ok: 0,
+};
+
+const KUBERNETES_WORKLOAD_TYPES = new Set([
+ 'k8s-deployment',
+ 'k8s-replicaset',
+ 'k8s-statefulset',
+ 'k8s-daemonset',
+ 'k8s-job',
+ 'k8s-cronjob',
+]);
+
+export function getHomeVerdictTone(verdict: ResourceHealthVerdict): StatusIndicatorVariant {
+ switch (verdict) {
+ case 'ok':
+ return 'success';
+ case 'critical':
+ return 'danger';
+ case 'attention':
+ return 'warning';
+ default:
+ return 'muted';
+ }
+}
+
+export function getHomePlatformKey(resource: Resource): HomePlatformKey {
+ const platform = String(resource.platformType || '').toLowerCase();
+ const sources = (resource.sources ?? []).map((source) => source.toLowerCase());
+ if (
+ platform.includes('proxmox') ||
+ sources.some((source) => ['proxmox', 'pbs', 'pmg'].includes(source))
+ )
+ return 'proxmox';
+ if (platform.includes('docker') || platform.includes('podman') || sources.includes('docker'))
+ return 'docker';
+ if (platform.includes('kubernetes') || sources.includes('kubernetes')) return 'kubernetes';
+ if (platform.includes('truenas') || sources.includes('truenas')) return 'truenas';
+ if (platform.includes('vmware') || platform.includes('vsphere') || sources.includes('vmware'))
+ return 'vmware';
+ if (
+ platform.includes('standalone') ||
+ platform.includes('availability') ||
+ sources.includes('agent') ||
+ sources.includes('availability')
+ )
+ return 'standalone';
+ return 'other';
+}
+
+export function getHomeResourceHref(resource: Resource): string {
+ const platform = getHomePlatformKey(resource);
+ const buildPlatformPath = (tab = 'overview') => {
+ switch (platform) {
+ case 'proxmox':
+ return buildProxmoxPath(tab);
+ case 'docker':
+ return buildDockerPath(tab);
+ case 'kubernetes':
+ return buildKubernetesPath(tab);
+ case 'truenas':
+ return buildTrueNASPath(tab);
+ case 'vmware':
+ return buildVmwarePath(tab);
+ case 'standalone':
+ return buildStandalonePath(tab === 'overview' ? 'machines' : tab);
+ default:
+ return '/alerts/overview';
+ }
+ };
+
+ if (isWorkload(resource) || KUBERNETES_WORKLOAD_TYPES.has(resource.type)) {
+ const search = buildWorkloadsRouteSearch({ resource: resource.id });
+ switch (platform) {
+ case 'proxmox':
+ return `${buildProxmoxPath('overview')}${search}`;
+ case 'kubernetes':
+ return `${buildKubernetesPath('workloads')}${search}`;
+ case 'truenas':
+ return buildTrueNASPath(resource.type === 'vm' ? 'vms' : 'apps');
+ case 'vmware':
+ return `${buildVmwarePath('overview')}${search}`;
+ case 'standalone':
+ return `${buildStandalonePath('machines')}${search}`;
+ case 'docker':
+ return buildDockerPath('overview');
+ default:
+ return '/alerts/overview';
+ }
+ }
+ if (isStorage(resource)) {
+ if (platform === 'standalone') return buildStandalonePath('machines');
+ if (platform === 'other') return '/alerts/overview';
+ return `${buildPlatformPath('storage')}${buildStorageRouteSearch({ resource: resource.id })}`;
+ }
+ if (resource.type === 'network-endpoint') {
+ return buildStandalonePath('availability');
+ }
+ return buildPlatformPath();
+}
+
+export function toHomeResourceTile(resource: Resource): HomeResourceTile {
+ const verdict = resource.health?.verdict ?? 'unknown';
+ return {
+ resource,
+ name: getPreferredInfrastructureDisplayName(resource),
+ verdict,
+ reason: resource.health?.reasons?.[0],
+ href: getHomeResourceHref(resource),
+ };
+}
+
+export function compareHomeTiles(left: HomeResourceTile, right: HomeResourceTile): number {
+ const verdictDifference = VERDICT_RANK[right.verdict] - VERDICT_RANK[left.verdict];
+ if (verdictDifference !== 0) return verdictDifference;
+ return left.name.localeCompare(right.name, undefined, { sensitivity: 'base', numeric: true });
+}
+
+export function buildHomePosture(resources: readonly Resource[]): HomePosture {
+ const posture: HomePosture = {
+ ok: 0,
+ attention: 0,
+ critical: 0,
+ stale: 0,
+ off: 0,
+ unknown: 0,
+ total: resources.length,
+ needsAttention: 0,
+ };
+ resources.forEach((resource) => {
+ const verdict = resource.health?.verdict ?? 'unknown';
+ posture[verdict] += 1;
+ if (verdict === 'critical' || verdict === 'attention') posture.needsAttention += 1;
+ });
+ return posture;
+}
+
+export function buildHomeAttentionTiles(resources: readonly Resource[]): HomeResourceTile[] {
+ return resources
+ .map(toHomeResourceTile)
+ .filter((tile) => tile.verdict === 'critical' || tile.verdict === 'attention')
+ .sort(compareHomeTiles);
+}
+
+export function buildHomeResourceGroups(
+ resources: readonly Resource[],
+ expandedGroups: ReadonlySet<HomePlatformKey> = new Set(),
+): HomeResourceGroup[] {
+ const grouped = new Map<HomePlatformKey, HomeResourceTile[]>();
+ resources.forEach((resource) => {
+ const tile = toHomeResourceTile(resource);
+ if (tile.verdict === 'critical' || tile.verdict === 'attention') return;
+ const key = getHomePlatformKey(resource);
+ grouped.set(key, [...(grouped.get(key) ?? []), tile]);
+ });
+
+ return PLATFORM_ORDER.flatMap((key) => {
+ const tiles = (grouped.get(key) ?? []).sort(compareHomeTiles);
+ if (tiles.length === 0) return [];
+ if (expandedGroups.has(key)) return [{ key, tiles, hiddenCount: 0 }];
+
+ const neverHidden = tiles.filter((tile) => tile.verdict !== 'ok' && tile.verdict !== 'off');
+ const calm = tiles.filter((tile) => tile.verdict === 'ok' || tile.verdict === 'off');
+ const visibleCalm = calm.slice(0, HOME_HEALTHY_GROUP_LIMIT);
+ return [
+ {
+ key,
+ tiles: [...neverHidden, ...visibleCalm],
+ hiddenCount: calm.length - visibleCalm.length,
+ },
+ ];
+ });
+}
diff --git a/frontend-modern/src/hooks/__tests__/useUnifiedResources.test.ts b/frontend-modern/src/hooks/__tests__/useUnifiedResources.test.ts
index c5c5e8bfec..74aba914e7 100644
--- a/frontend-modern/src/hooks/__tests__/useUnifiedResources.test.ts
+++ b/frontend-modern/src/hooks/__tests__/useUnifiedResources.test.ts
@@ -18,6 +18,7 @@ const v2Resource = {
status: 'online',
lastSeen: '2026-02-06T12:00:00Z',
sources: ['agent'],
+ health: { verdict: 'ok' as const, reasons: [] },
facetCounts: {
recentChanges: 1,
},
@@ -1139,6 +1140,7 @@ describe('useUnifiedResources', () => {
expect(result!.resources()[0]?.id).toBe(v2Resource.id);
expect(result!.resources()[0]?.displayName).toBe(v2Resource.name);
+ expect(result!.resources()[0]?.health).toEqual({ verdict: 'ok', reasons: [] });
dispose();
});
diff --git a/frontend-modern/src/hooks/useUnifiedResources.ts b/frontend-modern/src/hooks/useUnifiedResources.ts
index 53faac0f36..aace88c993 100644
--- a/frontend-modern/src/hooks/useUnifiedResources.ts
+++ b/frontend-modern/src/hooks/useUnifiedResources.ts
@@ -16,6 +16,7 @@ import type {
ResourceDiscoveryReadiness,
ResourceDiscoveryTarget,
ResourceDockerMeta,
+ ResourceHealth,
ResourceMetricsTarget,
ResourceAvailabilityMeta,
ResourcePBSMeta,
@@ -209,6 +210,7 @@ type APIResource = {
sources?: string[];
platformScopes?: string[];
sourceStatus?: Record<string, { status: string; lastSeen: string; error?: string }>;
+ health?: ResourceHealth;
identity?: {
machineId?: string;
hostnames?: string[];
@@ -836,6 +838,7 @@ const toResource = (v2: APIResource): Resource => {
parentName: v2.parentName,
clusterId: getExplicitResourceClusterName(v2),
status: resolveStatus(v2.status),
+ health: v2.health,
incidents: (v2.incidents || [])
.map((incident) => ({
provider: incident.provider,
diff --git a/frontend-modern/src/i18n/messages.de.ts b/frontend-modern/src/i18n/messages.de.ts
index c21f497cb3..dc92524f6c 100644
--- a/frontend-modern/src/i18n/messages.de.ts
+++ b/frontend-modern/src/i18n/messages.de.ts
@@ -1,6 +1,54 @@
import type { I18nCatalog } from './messages';
export const DE_MESSAGE_OVERRIDES = {
+ 'home.title': 'Start',
+ 'home.description': 'Bestaetigte Integritaet aller ueberwachten Ressourcen.',
+ 'home.nav.tooltip': 'Bestaetigten Zustand der gesamten Flotte anzeigen',
+ 'home.refresh.label': 'Aktualisieren',
+ 'home.refresh.ariaLabel': 'Flottenzustand aktualisieren',
+ 'home.loading': 'Flottenzustand wird geladen...',
+ 'home.error.title': 'Flottenzustand ist nicht verfuegbar',
+ 'home.error.description': 'Pulse konnte den aktuellen Ressourcenzustand nicht laden.',
+ 'home.error.retry': 'Erneut versuchen',
+ 'home.empty.title': 'Erstes ueberwachtes System verbinden',
+ 'home.empty.description':
+ 'Fuegen Sie eine Plattform-API, einen Pulse Agent oder eine Verfuegbarkeitspruefung hinzu, um den Ressourcenzustand zu bestaetigen.',
+ 'home.empty.action': 'Infrastruktur hinzufuegen',
+ 'home.updated.unknown': 'unbekannt',
+ 'home.posture.allHealthy':
+ 'Alle {total} Ressourcen als fehlerfrei bestaetigt · aktualisiert {updated}',
+ 'home.posture.summary.singular':
+ '1 Ressource erfordert Aufmerksamkeit · {healthy} von {total} als fehlerfrei bestaetigt · {stale} veraltet · {unknown} unbekannt · aktualisiert {updated}',
+ 'home.posture.summary.plural':
+ '{attention} Ressourcen erfordern Aufmerksamkeit · {healthy} von {total} als fehlerfrei bestaetigt · {stale} veraltet · {unknown} unbekannt · aktualisiert {updated}',
+ 'home.attention.title': 'Aufmerksamkeit erforderlich',
+ 'home.attention.description':
+ 'Kritische Ressourcen stehen zuerst. Oeffnen Sie eine Ressource zur Untersuchung.',
+ 'home.platform.proxmox': 'Proxmox',
+ 'home.platform.docker': 'Docker und Podman',
+ 'home.platform.kubernetes': 'Kubernetes',
+ 'home.platform.truenas': 'TrueNAS',
+ 'home.platform.vmware': 'vSphere',
+ 'home.platform.standalone': 'Maschinen und Pruefungen',
+ 'home.platform.other': 'Andere Ressourcen',
+ 'home.verdict.ok': 'Fehlerfrei',
+ 'home.verdict.attention': 'Aufmerksamkeit erforderlich',
+ 'home.verdict.critical': 'Kritisch',
+ 'home.verdict.stale': 'Veraltet',
+ 'home.verdict.off': 'Ausgeschaltet',
+ 'home.verdict.unknown': 'Unbekannt',
+ 'home.reason.criticalAlert': 'Kritische Warnung{detail}',
+ 'home.reason.warningAlert': 'Warnung{detail}',
+ 'home.reason.availabilityFailed': 'Verfuegbarkeitspruefung fehlgeschlagen',
+ 'home.reason.offline': 'Offline',
+ 'home.reason.backupStale': 'Sicherung veraltet{detail}',
+ 'home.reason.telemetryStale': 'Telemetrie veraltet{detail}',
+ 'home.reason.telemetryMissing': 'Telemetrie fehlt',
+ 'home.reason.poweredOff': 'Ausgeschaltet',
+ 'home.reason.degraded': 'Beeintraechtigt',
+ 'home.tile.ariaLabel': '{name}: {status}. {reason}',
+ 'home.group.showAll': 'Alle anzeigen ({count})',
+ 'home.group.showLess': 'Weniger anzeigen',
'pricing.handoff.description.afterLink': '.',
'pricing.handoff.description.beforeLink': 'Wenn die Weiterleitung nicht automatisch startet,',
'pricing.handoff.link.publicPricing': 'weiter zur oeffentlichen Preisseite',
diff --git a/frontend-modern/src/i18n/messages.es.ts b/frontend-modern/src/i18n/messages.es.ts
index 831df47cb9..9aaa3664e8 100644
--- a/frontend-modern/src/i18n/messages.es.ts
+++ b/frontend-modern/src/i18n/messages.es.ts
@@ -1,6 +1,54 @@
import type { I18nCatalog } from './messages';
export const ES_MESSAGE_OVERRIDES = {
+ 'home.title': 'Inicio',
+ 'home.description': 'Estado verificado de cada recurso monitorizado.',
+ 'home.nav.tooltip': 'Ver el estado verificado de toda la flota',
+ 'home.refresh.label': 'Actualizar',
+ 'home.refresh.ariaLabel': 'Actualizar estado de la flota',
+ 'home.loading': 'Cargando estado de la flota...',
+ 'home.error.title': 'El estado de la flota no esta disponible',
+ 'home.error.description': 'Pulse no pudo cargar el estado actual de los recursos.',
+ 'home.error.retry': 'Intentar de nuevo',
+ 'home.empty.title': 'Conecta tu primer sistema monitorizado',
+ 'home.empty.description':
+ 'Agrega una API de plataforma, Pulse Agent o una comprobacion de disponibilidad para comenzar a verificar los recursos.',
+ 'home.empty.action': 'Agregar infraestructura',
+ 'home.updated.unknown': 'desconocido',
+ 'home.posture.allHealthy':
+ 'Los {total} recursos tienen un estado saludable verificado · actualizado {updated}',
+ 'home.posture.summary.singular':
+ '1 necesita atencion · {healthy} de {total} con estado saludable verificado · {stale} obsoleto · {unknown} desconocido · actualizado {updated}',
+ 'home.posture.summary.plural':
+ '{attention} necesitan atencion · {healthy} de {total} con estado saludable verificado · {stale} obsoletos · {unknown} desconocidos · actualizado {updated}',
+ 'home.attention.title': 'Necesita atencion',
+ 'home.attention.description':
+ 'Los recursos criticos aparecen primero. Abre un recurso para investigarlo.',
+ 'home.platform.proxmox': 'Proxmox',
+ 'home.platform.docker': 'Docker y Podman',
+ 'home.platform.kubernetes': 'Kubernetes',
+ 'home.platform.truenas': 'TrueNAS',
+ 'home.platform.vmware': 'vSphere',
+ 'home.platform.standalone': 'Maquinas y comprobaciones',
+ 'home.platform.other': 'Otros recursos',
+ 'home.verdict.ok': 'Saludable',
+ 'home.verdict.attention': 'Necesita atencion',
+ 'home.verdict.critical': 'Critico',
+ 'home.verdict.stale': 'Obsoleto',
+ 'home.verdict.off': 'Apagado',
+ 'home.verdict.unknown': 'Desconocido',
+ 'home.reason.criticalAlert': 'Alerta critica{detail}',
+ 'home.reason.warningAlert': 'Alerta de advertencia{detail}',
+ 'home.reason.availabilityFailed': 'La comprobacion de disponibilidad fallo',
+ 'home.reason.offline': 'Sin conexion',
+ 'home.reason.backupStale': 'Copia de seguridad obsoleta{detail}',
+ 'home.reason.telemetryStale': 'Telemetria obsoleta{detail}',
+ 'home.reason.telemetryMissing': 'Falta telemetria',
+ 'home.reason.poweredOff': 'Apagado',
+ 'home.reason.degraded': 'Degradado',
+ 'home.tile.ariaLabel': '{name}: {status}. {reason}',
+ 'home.group.showAll': 'Mostrar todo ({count})',
+ 'home.group.showLess': 'Mostrar menos',
'pricing.handoff.description.afterLink': '.',
'pricing.handoff.description.beforeLink': 'Si la redireccion no comienza automaticamente,',
'pricing.handoff.link.publicPricing': 'continua al sitio publico de precios',
diff --git a/frontend-modern/src/i18n/messages.ts b/frontend-modern/src/i18n/messages.ts
index fb414e7fe4..9ac8b479cb 100644
--- a/frontend-modern/src/i18n/messages.ts
+++ b/frontend-modern/src/i18n/messages.ts
@@ -1,6 +1,52 @@
import type { SupportedLocale } from './locales';
export const EN_MESSAGES = {
+ 'home.title': 'Home',
+ 'home.description': 'Verified health across every monitored resource.',
+ 'home.nav.tooltip': 'See verified health across the whole fleet',
+ 'home.refresh.label': 'Refresh',
+ 'home.refresh.ariaLabel': 'Refresh fleet health',
+ 'home.loading': 'Loading fleet health...',
+ 'home.error.title': 'Fleet health is unavailable',
+ 'home.error.description': 'Pulse could not load the current resource state.',
+ 'home.error.retry': 'Try again',
+ 'home.empty.title': 'Connect your first monitored system',
+ 'home.empty.description':
+ 'Add a platform API, Pulse Agent, or availability check to start verifying resource health.',
+ 'home.empty.action': 'Add infrastructure',
+ 'home.updated.unknown': 'unknown',
+ 'home.posture.allHealthy': 'All {total} resources verified healthy · updated {updated}',
+ 'home.posture.summary.singular':
+ '1 needs attention · {healthy} of {total} verified healthy · {stale} stale · {unknown} unknown · updated {updated}',
+ 'home.posture.summary.plural':
+ '{attention} need attention · {healthy} of {total} verified healthy · {stale} stale · {unknown} unknown · updated {updated}',
+ 'home.attention.title': 'Needs attention',
+ 'home.attention.description': 'Critical resources appear first. Open a resource to investigate.',
+ 'home.platform.proxmox': 'Proxmox',
+ 'home.platform.docker': 'Docker and Podman',
+ 'home.platform.kubernetes': 'Kubernetes',
+ 'home.platform.truenas': 'TrueNAS',
+ 'home.platform.vmware': 'vSphere',
+ 'home.platform.standalone': 'Machines and checks',
+ 'home.platform.other': 'Other resources',
+ 'home.verdict.ok': 'Healthy',
+ 'home.verdict.attention': 'Needs attention',
+ 'home.verdict.critical': 'Critical',
+ 'home.verdict.stale': 'Stale',
+ 'home.verdict.off': 'Powered off',
+ 'home.verdict.unknown': 'Unknown',
+ 'home.reason.criticalAlert': 'Critical alert{detail}',
+ 'home.reason.warningAlert': 'Warning alert{detail}',
+ 'home.reason.availabilityFailed': 'Availability check failed',
+ 'home.reason.offline': 'Offline',
+ 'home.reason.backupStale': 'Backup stale{detail}',
+ 'home.reason.telemetryStale': 'Telemetry stale{detail}',
+ 'home.reason.telemetryMissing': 'Telemetry missing',
+ 'home.reason.poweredOff': 'Powered off',
+ 'home.reason.degraded': 'Degraded',
+ 'home.tile.ariaLabel': '{name}: {status}. {reason}',
+ 'home.group.showAll': 'Show all ({count})',
+ 'home.group.showLess': 'Show less',
'runtimeHome.openingWorkspace': 'Opening workspace...',
'pricing.handoff.description.afterLink': '.',
'pricing.handoff.description.beforeLink': 'If the handoff does not start automatically,',
diff --git a/frontend-modern/src/routing/__tests__/navigation.test.ts b/frontend-modern/src/routing/__tests__/navigation.test.ts
index 166265a5ef..751a719ef2 100644
--- a/frontend-modern/src/routing/__tests__/navigation.test.ts
+++ b/frontend-modern/src/routing/__tests__/navigation.test.ts
@@ -7,7 +7,7 @@ describe('navigation routing helpers', () => {
expect(getActiveTabForPath('/dashboard')).toBeNull();
expect(getActiveTabForPath('/dashboard/explore')).toBeNull();
expect(getActiveTabForPath('/explore')).toBeNull();
- expect(getActiveTabForPath('/home')).toBeNull();
+ expect(getActiveTabForPath('/home')).toBe('home');
expect(getActiveTabForPath('/standalone')).toBe('standalone');
expect(getActiveTabForPath('/standalone/machines')).toBe('standalone');
expect(getActiveTabForPath('/agents')).toBeNull();
diff --git a/frontend-modern/src/routing/navigation.ts b/frontend-modern/src/routing/navigation.ts
index a371e32bdd..a3183de943 100644
--- a/frontend-modern/src/routing/navigation.ts
+++ b/frontend-modern/src/routing/navigation.ts
@@ -1,5 +1,6 @@
import {
DOCKER_PATH,
+ HOME_PATH,
ACTIONS_PATH,
KUBERNETES_PATH,
PATROL_PATH,
@@ -10,6 +11,7 @@ import {
} from './resourceLinks';
export type AppTabId =
+ | 'home'
| 'standalone'
| 'proxmox'
| 'docker'
@@ -24,6 +26,7 @@ export type AppTabId =
export type ActiveAppTabId = AppTabId | null;
export function getActiveTabForPath(path: string): ActiveAppTabId {
+ if (path === HOME_PATH || path.startsWith(`${HOME_PATH}/`)) return 'home';
if (path.startsWith(PROXMOX_PATH)) return 'proxmox';
if (path.startsWith(DOCKER_PATH)) return 'docker';
if (path.startsWith(KUBERNETES_PATH)) return 'kubernetes';
diff --git a/frontend-modern/src/routing/resourceLinks.ts b/frontend-modern/src/routing/resourceLinks.ts
index d9e8e13101..8dd480f844 100644
--- a/frontend-modern/src/routing/resourceLinks.ts
+++ b/frontend-modern/src/routing/resourceLinks.ts
@@ -16,6 +16,7 @@ export const WORKLOADS_QUERY_PARAMS = {
summaryGroup: 'summaryGroup',
} as const;
+export const HOME_PATH = '/home';
export const STANDALONE_PATH = '/standalone';
export const STANDALONE_DEFAULT_TAB = 'machines';
export const STANDALONE_QUERY_PARAMS = {
diff --git a/frontend-modern/src/routing/routePreload.ts b/frontend-modern/src/routing/routePreload.ts
index 7c5a37b1c1..b91606d141 100644
--- a/frontend-modern/src/routing/routePreload.ts
+++ b/frontend-modern/src/routing/routePreload.ts
@@ -1,6 +1,7 @@
import {
ACTIONS_PATH,
DOCKER_PATH,
+ HOME_PATH,
KUBERNETES_PATH,
PATROL_PATH,
PROXMOX_PATH,
@@ -31,6 +32,11 @@ function normalizeRoute(route: string): string {
}
const ROUTE_PRELOADERS: readonly RoutePreloader[] = [
+ {
+ id: 'home',
+ matches: (route) => route === HOME_PATH,
+ preload: () => import('@/features/home/HomePageSurface').then(() => undefined),
+ },
{
id: 'proxmox',
matches: (route) => route === PROXMOX_PATH || route.startsWith(`${PROXMOX_PATH}/`),
diff --git a/frontend-modern/src/types/resource.ts b/frontend-modern/src/types/resource.ts
index 261dddc93b..0483b706ff 100644
--- a/frontend-modern/src/types/resource.ts
+++ b/frontend-modern/src/types/resource.ts
@@ -105,6 +105,18 @@ export type SourceType =
export type ResourceStatus =
'online' | 'offline' | 'running' | 'stopped' | 'degraded' | 'warning' | 'paused' | 'unknown';
+export type ResourceHealthVerdict = 'ok' | 'attention' | 'critical' | 'stale' | 'off' | 'unknown';
+
+export interface ResourceHealthReason {
+ code: string;
+ detail?: string;
+}
+
+export interface ResourceHealth {
+ verdict: ResourceHealthVerdict;
+ reasons: ResourceHealthReason[];
+}
+
// Metric value with optional limits
export interface ResourceMetric {
current: number; // Current value (percentage or bytes)
@@ -1622,6 +1634,7 @@ export interface Resource {
labels?: Record<string, string>;
customUrl?: string;
lastSeen: number; // Unix milliseconds
+ health?: ResourceHealth;
alerts?: ResourceAlert[];
incidents?: ResourceIncident[];
incidentCount?: number;
diff --git a/frontend-modern/src/utils/assistantPageContext.ts b/frontend-modern/src/utils/assistantPageContext.ts
index 525697cbe7..d3fcffe0fb 100644
--- a/frontend-modern/src/utils/assistantPageContext.ts
+++ b/frontend-modern/src/utils/assistantPageContext.ts
@@ -11,6 +11,7 @@ export interface AssistantPageContextPresentation {
}
const VIEW_LABELS: Record<Exclude<ActiveAppTabId, null>, string> = {
+ home: 'Home',
alerts: 'Alerts',
actions: 'Actions',
ai: 'Patrol',
diff --git a/internal/api/resourceapi/resources.go b/internal/api/resourceapi/resources.go
index 3a835608f1..505e2c0b8d 100644
--- a/internal/api/resourceapi/resources.go
+++ b/internal/api/resourceapi/resources.go
@@ -48,6 +48,12 @@ type TenantStateProvider interface {
UnifiedResourceSnapshotForTenant(orgID string) ([]unified.Resource, time.Time)
}
+// TenantResourceHealthAlertProvider is the optional tenant-safe alert slice
+// used to decorate resource responses with canonical fleet posture.
+type TenantResourceHealthAlertProvider interface {
+ ResourceHealthAlertsForTenant(orgID string) []unified.ResourceHealthAlert
+}
+
// UnifiedResourceSnapshotProvider supplies a canonical unified-resource seed
// and freshness marker for the default tenant.
type UnifiedResourceSnapshotProvider interface {
@@ -164,6 +170,7 @@ func (h *QueryService) HandleListResources(w http.ResponseWriter, r *http.Reques
// Flat copy so the per-request decorations below stay top-level writes
// on request-owned elements while nested data remains shared.
allResources := flatCopyResources(sharedResources)
+ allResources = unified.AttachResourceHealth(allResources, h.resourceHealthAlerts(orgID), time.Now().UTC())
h.applyActionAvailability(r.Context(), allResources)
resources := allResources
if unsupported := unsupportedResourceTypeFilterTokens(r.URL.Query().Get("type")); len(unsupported) > 0 {
@@ -206,6 +213,28 @@ func (h *QueryService) HandleListResources(w http.ResponseWriter, r *http.Reques
json.NewEncoder(w).Encode(response.NormalizeCollections())
}
+func (h *QueryService) resourceHealthAlerts(orgID string) []unified.ResourceHealthAlert {
+ if provider, ok := h.tenantStateProvider.(TenantResourceHealthAlertProvider); ok {
+ return provider.ResourceHealthAlertsForTenant(orgID)
+ }
+ if orgID != "" && orgID != "default" {
+ return nil
+ }
+ if h.stateProvider == nil {
+ return nil
+ }
+ snapshot := h.stateProvider.ReadSnapshot()
+ out := make([]unified.ResourceHealthAlert, 0, len(snapshot.ActiveAlerts))
+ for _, alert := range snapshot.ActiveAlerts {
+ out = append(out, unified.ResourceHealthAlert{
+ ResourceID: alert.ResourceID,
+ Level: alert.Level,
+ Type: alert.Type,
+ })
+ }
+ return out
+}
+
// HandleStorageSummary handles GET /api/resources/storage-summary.
func (h *QueryService) HandleStorageSummary(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodGet {
diff --git a/internal/api/resourceapi/resources_test.go b/internal/api/resourceapi/resources_test.go
index bab6e7f42d..50a59ddba2 100644
--- a/internal/api/resourceapi/resources_test.go
+++ b/internal/api/resourceapi/resources_test.go
@@ -42,6 +42,38 @@ func (p resourceUnifiedSeedProvider) UnifiedResourceSnapshot() ([]unified.Resour
return out, p.snapshot.LastUpdate
}
+func TestResourceListIncludesCanonicalHealthFromActiveAlerts(t *testing.T) {
+ now := time.Now().UTC()
+ h := NewQueryService(&config.Config{DataPath: t.TempDir()})
+ h.SetStateProvider(resourceUnifiedSeedProvider{
+ snapshot: models.StateSnapshot{
+ LastUpdate: now,
+ ActiveAlerts: []models.Alert{{ResourceID: "host-1", Level: "critical", Type: "offline"}},
+ },
+ resources: []unified.Resource{{
+ ID: "host-1", Name: "Host One", Type: unified.ResourceTypeAgent, Status: unified.StatusOnline,
+ LastSeen: now, Sources: []unified.DataSource{unified.SourceAgent},
+ }},
+ })
+
+ rec := httptest.NewRecorder()
+ req := httptest.NewRequest(http.MethodGet, "/api/resources", nil)
+ h.HandleListResources(rec, req)
+ if rec.Code != http.StatusOK {
+ t.Fatalf("status = %d, body=%s", rec.Code, rec.Body.String())
+ }
+ var response ResourcesResponse
+ if err := json.NewDecoder(rec.Body).Decode(&response); err != nil {
+ t.Fatalf("decode response: %v", err)
+ }
+ if len(response.Data) != 1 || response.Data[0].Health == nil {
+ t.Fatalf("missing resource health: %+v", response.Data)
+ }
+ if response.Data[0].Health.Verdict != unified.HealthCritical {
+ t.Fatalf("verdict = %q, want critical", response.Data[0].Health.Verdict)
+ }
+}
+
type mutableResourceUnifiedSeedProvider struct {
snapshot models.StateSnapshot
resources []unified.Resource
diff --git a/internal/api/router_helpers.go b/internal/api/router_helpers.go
index 6382d946bb..3bd61c017a 100644
--- a/internal/api/router_helpers.go
+++ b/internal/api/router_helpers.go
@@ -80,6 +80,26 @@ func (p *MultiTenantStateProvider) UnifiedResourceSnapshotForTenant(orgID string
return monitor.UnifiedResourceSnapshot()
}
+// ResourceHealthAlertsForTenant returns only the minimal alert facts needed by
+// the resource health projection, resolved from the same tenant monitor as the
+// resource seed.
+func (p *MultiTenantStateProvider) ResourceHealthAlertsForTenant(orgID string) []unifiedresources.ResourceHealthAlert {
+ monitor := p.monitorForTenant(orgID)
+ if monitor == nil {
+ return nil
+ }
+ active := monitor.ActiveAlertsSnapshot()
+ out := make([]unifiedresources.ResourceHealthAlert, 0, len(active))
+ for _, alert := range active {
+ out = append(out, unifiedresources.ResourceHealthAlert{
+ ResourceID: alert.ResourceID,
+ Level: alert.Level,
+ Type: alert.Type,
+ })
+ }
+ return out
+}
+
// SetMultiTenantMonitor updates the multi-tenant monitor manager.
// Used during reload.
func (r *Router) SetMultiTenantMonitor(mtm *monitoring.MultiTenantMonitor) {
diff --git a/internal/api/router_state_test.go b/internal/api/router_state_test.go
index 9526bd6973..2ff24521f9 100644
--- a/internal/api/router_state_test.go
+++ b/internal/api/router_state_test.go
@@ -2,6 +2,7 @@ package api
import (
"encoding/json"
+ "fmt"
"net/http"
"net/http/httptest"
"strings"
@@ -276,7 +277,7 @@ func TestBuildStateSummaryCountsSnapshotResources(t *testing.T) {
registry := unifiedresources.NewRegistry(nil)
registry.IngestSnapshot(snapshot)
- summary := buildStateSummary(registry, len(snapshot.ActiveAlerts), snapshot.LastUpdate)
+ summary := buildStateSummary(registry, registry.List(), snapshot.ActiveAlerts, snapshot.LastUpdate)
assert.Equal(t, 1, summary.ActiveAlerts)
assert.Equal(t, 2, summary.Nodes)
@@ -290,3 +291,28 @@ func TestBuildStateSummaryCountsSnapshotResources(t *testing.T) {
assert.Equal(t, 12.5, summary.DockerHosts[0].CPUUsagePercent)
}
}
+
+func TestSummarizeResourceHealthKeepsStaleVisibleAndCapsAttention(t *testing.T) {
+ resources := make([]unifiedresources.Resource, 0, 54)
+ resources = append(resources,
+ unifiedresources.Resource{ID: "critical", Name: "Critical", Type: unifiedresources.ResourceTypeAgent, Health: &unifiedresources.ResourceHealth{Verdict: unifiedresources.HealthCritical, Reasons: []unifiedresources.ResourceHealthReason{{Code: "offline"}}}},
+ unifiedresources.Resource{ID: "stale", Name: "Stale", Type: unifiedresources.ResourceTypeAgent, Health: &unifiedresources.ResourceHealth{Verdict: unifiedresources.HealthStale, Reasons: []unifiedresources.ResourceHealthReason{{Code: "telemetry_stale"}}}},
+ unifiedresources.Resource{ID: "healthy", Name: "Healthy", Type: unifiedresources.ResourceTypeAgent, Health: &unifiedresources.ResourceHealth{Verdict: unifiedresources.HealthOK, Reasons: []unifiedresources.ResourceHealthReason{}}},
+ unifiedresources.Resource{ID: "off", Name: "Off", Type: unifiedresources.ResourceTypeVM, Health: &unifiedresources.ResourceHealth{Verdict: unifiedresources.HealthOff, Reasons: []unifiedresources.ResourceHealthReason{{Code: "powered_off"}}}},
+ )
+ for i := 0; i < 50; i++ {
+ resources = append(resources, unifiedresources.Resource{
+ ID: fmt.Sprintf("unknown-%02d", i), Name: fmt.Sprintf("Unknown %02d", i), Type: unifiedresources.ResourceTypeAgent,
+ Health: &unifiedresources.ResourceHealth{Verdict: unifiedresources.HealthUnknown, Reasons: []unifiedresources.ResourceHealthReason{{Code: "telemetry_missing"}}},
+ })
+ }
+
+ counts, attention := summarizeResourceHealth(resources)
+ assert.Equal(t, stateSummaryVerdicts{OK: 1, Critical: 1, Stale: 1, Off: 1, Unknown: 50}, counts)
+ assert.Len(t, attention, stateSummaryAttentionLimit)
+ assert.Equal(t, "critical", attention[0].ID)
+ assert.Equal(t, "stale", attention[1].ID)
+ payload, err := json.Marshal(stateSummaryResponse{Verdicts: counts, Attention: attention})
+ assert.NoError(t, err)
+ assert.Less(t, len(payload), 5*1024)
+}
diff --git a/internal/api/state_summary.go b/internal/api/state_summary.go
index bcf5968168..9ebc7d1ffb 100644
--- a/internal/api/state_summary.go
+++ b/internal/api/state_summary.go
@@ -2,10 +2,12 @@ package api
import (
"net/http"
+ "sort"
"strings"
"time"
"github.com/rcourtman/pulse-go-rewrite/internal/config"
+ "github.com/rcourtman/pulse-go-rewrite/internal/models"
"github.com/rcourtman/pulse-go-rewrite/internal/unifiedresources"
"github.com/rcourtman/pulse-go-rewrite/internal/utils"
"github.com/rs/zerolog/log"
@@ -18,6 +20,26 @@ type stateSummaryResponse struct {
Containers int `json:"containers"`
DockerHosts []stateSummaryDockerHost `json:"dockerHosts"`
LastUpdate time.Time `json:"lastUpdate"`
+ Verdicts stateSummaryVerdicts `json:"verdicts"`
+ Attention []stateSummaryAttention `json:"attention"`
+}
+
+type stateSummaryVerdicts struct {
+ OK int `json:"ok"`
+ Attention int `json:"attention"`
+ Critical int `json:"critical"`
+ Stale int `json:"stale"`
+ Off int `json:"off"`
+ Unknown int `json:"unknown"`
+}
+
+type stateSummaryAttention struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+ Type unifiedresources.ResourceType `json:"type"`
+ PlatformType string `json:"platformType,omitempty"`
+ Verdict unifiedresources.ResourceHealthVerdict `json:"verdict"`
+ TopReason *unifiedresources.ResourceHealthReason `json:"topReason,omitempty"`
}
type stateSummaryDockerHost struct {
@@ -27,11 +49,29 @@ type stateSummaryDockerHost struct {
CPUUsagePercent float64 `json:"cpuUsagePercent"`
}
-func buildStateSummary(readState unifiedresources.ReadState, activeAlerts int, lastUpdate time.Time) stateSummaryResponse {
+// Keep the additive summary useful without allowing its attention list to
+// approach the size of the full resource response. Thirty representative
+// entries stay below the endpoint's 5 KiB target with ordinary identifiers.
+const stateSummaryAttentionLimit = 30
+
+func buildStateSummary(
+ readState unifiedresources.ReadState,
+ resources []unifiedresources.Resource,
+ activeAlerts []models.Alert,
+ lastUpdate time.Time,
+) stateSummaryResponse {
+ postureResources := unifiedresources.AttachResourceHealth(
+ resources,
+ stateSummaryHealthAlerts(activeAlerts),
+ time.Now().UTC(),
+ )
+ verdicts, attention := summarizeResourceHealth(postureResources)
if readState == nil {
return stateSummaryResponse{
- ActiveAlerts: activeAlerts,
+ ActiveAlerts: len(activeAlerts),
LastUpdate: lastUpdate,
+ Verdicts: verdicts,
+ Attention: attention,
}
}
@@ -61,13 +101,121 @@ func buildStateSummary(readState unifiedresources.ReadState, activeAlerts int, l
}
return stateSummaryResponse{
- ActiveAlerts: activeAlerts,
+ ActiveAlerts: len(activeAlerts),
Nodes: len(readState.Nodes()),
VMs: len(readState.VMs()),
Containers: len(readState.Containers()),
DockerHosts: dockerHosts,
LastUpdate: lastUpdate,
+ Verdicts: verdicts,
+ Attention: attention,
+ }
+}
+
+func stateSummaryHealthAlerts(active []models.Alert) []unifiedresources.ResourceHealthAlert {
+ out := make([]unifiedresources.ResourceHealthAlert, 0, len(active))
+ for _, alert := range active {
+ out = append(out, unifiedresources.ResourceHealthAlert{
+ ResourceID: alert.ResourceID,
+ Level: alert.Level,
+ Type: alert.Type,
+ })
+ }
+ return out
+}
+
+func summarizeResourceHealth(resources []unifiedresources.Resource) (stateSummaryVerdicts, []stateSummaryAttention) {
+ counts := stateSummaryVerdicts{}
+ attention := make([]stateSummaryAttention, 0)
+ for _, resource := range resources {
+ if resource.Health == nil {
+ continue
+ }
+ switch resource.Health.Verdict {
+ case unifiedresources.HealthOK:
+ counts.OK++
+ case unifiedresources.HealthAttention:
+ counts.Attention++
+ case unifiedresources.HealthCritical:
+ counts.Critical++
+ case unifiedresources.HealthStale:
+ counts.Stale++
+ case unifiedresources.HealthOff:
+ counts.Off++
+ case unifiedresources.HealthUnknown:
+ counts.Unknown++
+ }
+ if resource.Health.Verdict == unifiedresources.HealthOK || resource.Health.Verdict == unifiedresources.HealthOff {
+ continue
+ }
+ name := strings.TrimSpace(resource.Name)
+ if resource.Canonical != nil && strings.TrimSpace(resource.Canonical.DisplayName) != "" {
+ name = strings.TrimSpace(resource.Canonical.DisplayName)
+ }
+ entry := stateSummaryAttention{
+ ID: resource.ID, Name: name, Type: unifiedresources.ContractResourceType(resource),
+ PlatformType: stateSummaryPlatformType(resource), Verdict: resource.Health.Verdict,
+ }
+ if len(resource.Health.Reasons) > 0 {
+ reason := resource.Health.Reasons[0]
+ entry.TopReason = &reason
+ }
+ attention = append(attention, entry)
+ }
+ sort.SliceStable(attention, func(i, j int) bool {
+ left, right := summaryVerdictRank(attention[i].Verdict), summaryVerdictRank(attention[j].Verdict)
+ if left != right {
+ return left > right
+ }
+ return strings.ToLower(attention[i].Name) < strings.ToLower(attention[j].Name)
+ })
+ if len(attention) > stateSummaryAttentionLimit {
+ attention = attention[:stateSummaryAttentionLimit]
+ }
+ if attention == nil {
+ attention = []stateSummaryAttention{}
+ }
+ return counts, attention
+}
+
+func summaryVerdictRank(verdict unifiedresources.ResourceHealthVerdict) int {
+ switch verdict {
+ case unifiedresources.HealthCritical:
+ return 4
+ case unifiedresources.HealthAttention:
+ return 3
+ case unifiedresources.HealthStale:
+ return 2
+ case unifiedresources.HealthUnknown:
+ return 1
+ default:
+ return 0
+ }
+}
+
+func stateSummaryPlatformType(resource unifiedresources.Resource) string {
+ if resource.Proxmox != nil || resource.PBS != nil || resource.PMG != nil {
+ return "proxmox"
+ }
+ if resource.Docker != nil {
+ return "docker"
+ }
+ if resource.Kubernetes != nil {
+ return "kubernetes"
+ }
+ if resource.TrueNAS != nil {
+ return "truenas"
+ }
+ if resource.VMware != nil {
+ return "vmware"
+ }
+ if resource.Availability != nil {
+ return "availability"
+ }
+ if len(resource.Sources) > 0 {
+ return string(resource.Sources[0])
}
+ return "generic"
}
func (r *Router) handleStateSummary(w http.ResponseWriter, req *http.Request) {
@@ -100,7 +248,8 @@ func (r *Router) handleStateSummary(w http.ResponseWriter, req *http.Request) {
readState := monitor.GetUnifiedReadStateOrSnapshot()
snapshot := monitor.ReadSnapshot()
- if err := utils.WriteJSONResponse(w, buildStateSummary(readState, len(snapshot.ActiveAlerts), snapshot.LastUpdate)); err != nil {
+ resources, _ := monitor.UnifiedResourceSnapshot()
+ if err := utils.WriteJSONResponse(w, buildStateSummary(readState, resources, snapshot.ActiveAlerts, snapshot.LastUpdate)); err != nil {
log.Error().Err(err).Msg("Failed to encode state summary response")
writeErrorResponse(w, http.StatusInternalServerError, "encoding_error",
"Failed to encode state summary", nil)
diff --git a/internal/models/converters.go b/internal/models/converters.go
index e24316bfeb..da5c5b8824 100644
--- a/internal/models/converters.go
+++ b/internal/models/converters.go
@@ -1172,6 +1172,7 @@ type ResourceConvertInput struct {
Labels map[string]string
CustomURL string
LastSeenUnix int64
+ Health json.RawMessage
Alerts []ResourceAlertInput
IncidentCount int
IncidentCode string
@@ -1260,6 +1261,7 @@ func ConvertResourceToFrontend(input ResourceConvertInput) ResourceFrontend {
Labels: nil,
CustomURL: input.CustomURL,
LastSeen: input.LastSeenUnix,
+ Health: input.Health,
IncidentCount: input.IncidentCount,
IncidentCode: input.IncidentCode,
IncidentSeverity: input.IncidentSeverity,
diff --git a/internal/models/models_frontend.go b/internal/models/models_frontend.go
index 5a80483c2b..5eecd6ab75 100644
--- a/internal/models/models_frontend.go
+++ b/internal/models/models_frontend.go
@@ -1062,6 +1062,7 @@ type ResourceFrontend struct {
Labels map[string]string `json:"labels"`
CustomURL string `json:"customUrl,omitempty"`
LastSeen int64 `json:"lastSeen"` // Unix milliseconds
+ Health json.RawMessage `json:"health,omitempty"`
Alerts []ResourceAlertFrontend `json:"alerts"`
IncidentCount int `json:"incidentCount,omitempty"`
diff --git a/internal/monitoring/monitor.go b/internal/monitoring/monitor.go
index 83400734ae..5247f32e29 100644
--- a/internal/monitoring/monitor.go
+++ b/internal/monitoring/monitor.go
@@ -4247,6 +4247,11 @@ func (m *Monitor) buildBroadcastFrontendStateFromSnapshot(snapshot models.StateS
metricsTargetResolver := broadcastMetricsTargetResolver(unifiedView.readState)
broadcastResources := unifiedresources.CoalescePresentationHostResources(unifiedView.resources)
broadcastResources = m.applyPersistedMetadataToUnifiedResources(broadcastResources)
+ broadcastResources = unifiedresources.AttachResourceHealth(
+ broadcastResources,
+ resourceHealthAlerts(frontendState.ActiveAlerts),
+ time.Now().UTC(),
+ )
broadcastFrontendResources, broadcastCatalogs := convertResourcesForBroadcast(broadcastResources, metricsTargetResolver)
frontendState.Resources = broadcastFrontendResources
frontendState.CapabilityCatalog = broadcastCatalogs.capabilities
@@ -5699,13 +5704,34 @@ func (m *Monitor) getResourcesForBroadcast() []models.ResourceFrontend {
m.mu.RLock()
store := m.resourceStore
m.mu.RUnlock()
+ resourcesForBroadcast := m.applyPersistedMetadataToUnifiedResources(m.getUnifiedResourcesForBroadcast())
+ resourcesForBroadcast = unifiedresources.AttachResourceHealth(
+ resourcesForBroadcast,
+ resourceHealthAlerts(m.activeAlertsSnapshot()),
+ time.Now().UTC(),
+ )
resources, _ := convertResourcesForBroadcast(
- m.applyPersistedMetadataToUnifiedResources(m.getUnifiedResourcesForBroadcast()),
+ resourcesForBroadcast,
broadcastMetricsTargetResolver(store),
)
return resources
}
+func resourceHealthAlerts(active []models.Alert) []unifiedresources.ResourceHealthAlert {
+ if len(active) == 0 {
+ return nil
+ }
+ out := make([]unifiedresources.ResourceHealthAlert, 0, len(active))
+ for _, alert := range active {
+ out = append(out, unifiedresources.ResourceHealthAlert{
+ ResourceID: alert.ResourceID,
+ Level: alert.Level,
+ Type: alert.Type,
+ })
+ }
+ return out
+}
+
func (m *Monitor) applyPersistedMetadataToUnifiedResources(resources []unifiedresources.Resource) []unifiedresources.Resource {
if len(resources) == 0 || m == nil {
return resources
@@ -6090,6 +6116,7 @@ func monitorResourceToConvertInput(resource unifiedresources.Resource) models.Re
Labels: monitorLabels(resource),
CustomURL: strings.TrimSpace(resource.CustomURL),
LastSeenUnix: monitorLastSeenUnix(resource.LastSeen),
+ Health: monitorRawJSON(resource.Health),
IncidentCount: resource.IncidentCount,
IncidentCode: resource.IncidentCode,
IncidentSeverity: string(resource.IncidentSeverity),
diff --git a/internal/unifiedresources/health.go b/internal/unifiedresources/health.go
new file mode 100644
index 0000000000..ca20899f38
--- /dev/null
+++ b/internal/unifiedresources/health.go
@@ -0,0 +1,285 @@
+package unifiedresources
+
+import (
+ "fmt"
+ "sort"
+ "strings"
+ "time"
+)
+
+// ResourceHealthVerdict is the canonical fleet-posture vocabulary shared by
+// resource payloads and the lightweight state summary. It deliberately keeps
+// powered-off workloads separate from failures and stale data separate from a
+// verified all-clear.
+type ResourceHealthVerdict string
+
+const (
+ HealthOK ResourceHealthVerdict = "ok"
+ HealthAttention ResourceHealthVerdict = "attention"
+ HealthCritical ResourceHealthVerdict = "critical"
+ HealthStale ResourceHealthVerdict = "stale"
+ HealthOff ResourceHealthVerdict = "off"
+ HealthUnknown ResourceHealthVerdict = "unknown"
+)
+
+const resourceBackupStaleAfter = 7 * 24 * time.Hour
+
+type ResourceHealthReason struct {
+ Code string `json:"code"`
+ Detail string `json:"detail,omitempty"`
+}
+
+type ResourceHealth struct {
+ Verdict ResourceHealthVerdict `json:"verdict"`
+ Reasons []ResourceHealthReason `json:"reasons"`
+}
+
+// ResourceHealthAlert is the minimal alert contract needed to compute fleet
+// posture without coupling the unified-resource package to alert internals.
+type ResourceHealthAlert struct {
+ ResourceID string
+ Level string
+ Type string
+}
+
+// EvaluateResourceHealth returns one deterministic verdict. Precedence is
+// significant: live alert evidence wins over stale telemetry, while a stopped
+// workload is neutral only when no warning or critical evidence exists.
+func EvaluateResourceHealth(resource Resource, alerts []ResourceHealthAlert, now time.Time) ResourceHealth {
+ if now.IsZero() {
+ now = time.Now().UTC()
+ }
+
+ matchingAlerts := matchingResourceHealthAlerts(resource, alerts)
+ for _, alert := range matchingAlerts {
+ if strings.EqualFold(strings.TrimSpace(alert.Level), "critical") {
+ return healthWithReason(HealthCritical, "critical_alert", strings.TrimSpace(alert.Type))
+ }
+ }
+
+ if availabilityFailureConfirmed(resource) {
+ return healthWithReason(HealthCritical, "availability_failed", availabilityFailureDetail(resource))
+ }
+ if strings.EqualFold(strings.TrimSpace(string(resource.IncidentSeverity)), "critical") {
+ return healthWithReason(HealthCritical, firstNonEmptyHealthCode(resource.IncidentCode, "critical_incident"), "")
+ }
+ if isInfrastructureHealthResource(resource) && resourceIsOffline(resource) {
+ return healthWithReason(HealthCritical, "offline", "")
+ }
+
+ if len(matchingAlerts) > 0 {
+ return healthWithReason(HealthAttention, "warning_alert", strings.TrimSpace(matchingAlerts[0].Type))
+ }
+ if resource.IncidentSeverity != "" && !strings.EqualFold(strings.TrimSpace(string(resource.IncidentSeverity)), "none") {
+ return healthWithReason(HealthAttention, firstNonEmptyHealthCode(resource.IncidentCode, "resource_risk"), "")
+ }
+ if backupAge, stale := staleResourceBackup(resource, now); stale {
+ return healthWithReason(HealthAttention, "backup_stale", fmt.Sprintf("%dd", int(backupAge.Hours()/24)))
+ }
+
+ if resourceHasStaleSource(resource) {
+ return healthWithReason(HealthStale, "telemetry_stale", formatHealthAge(now.Sub(resource.LastSeen)))
+ }
+ if resourceHasUnknownSource(resource) && resource.LastSeen.IsZero() {
+ return healthWithReason(HealthUnknown, "telemetry_missing", "")
+ }
+ if isWorkloadHealthResource(resource) && resourceIsOff(resource) {
+ return healthWithReason(HealthOff, "powered_off", "")
+ }
+
+ switch strings.ToLower(strings.TrimSpace(string(resource.Status))) {
+ case "online", "running", "ready", "healthy", "available", "active", "up":
+ return ResourceHealth{Verdict: HealthOK, Reasons: []ResourceHealthReason{}}
+ case "warning", "degraded", "unhealthy", "pending":
+ return healthWithReason(HealthAttention, "degraded", "")
+ case "offline", "down", "failed", "error":
+ return healthWithReason(HealthCritical, "offline", "")
+ default:
+ return healthWithReason(HealthUnknown, "status_unknown", "")
+ }
+}
+
+// AttachResourceHealth returns a shallow copy with backend-owned health
+// envelopes. Callers can safely pass registry-backed slices without mutating
+// the canonical store.
+func AttachResourceHealth(resources []Resource, alerts []ResourceHealthAlert, now time.Time) []Resource {
+ if len(resources) == 0 {
+ return resources
+ }
+ out := make([]Resource, len(resources))
+ copy(out, resources)
+ for i := range out {
+ health := EvaluateResourceHealth(out[i], alerts, now)
+ out[i].Health = &health
+ }
+ return out
+}
+
+func healthWithReason(verdict ResourceHealthVerdict, code, detail string) ResourceHealth {
+ return ResourceHealth{
+ Verdict: verdict,
+ Reasons: []ResourceHealthReason{{Code: strings.TrimSpace(code), Detail: strings.TrimSpace(detail)}},
+ }
+}
+
+func matchingResourceHealthAlerts(resource Resource, alerts []ResourceHealthAlert) []ResourceHealthAlert {
+ ids := map[string]struct{}{}
+ add := func(value string) {
+ if normalized := strings.TrimSpace(value); normalized != "" {
+ ids[normalized] = struct{}{}
+ }
+ }
+ add(resource.ID)
+ for _, id := range resource.SupersededCanonicalIDs {
+ add(id)
+ }
+ if resource.Canonical != nil {
+ add(resource.Canonical.PrimaryID)
+ for _, id := range resource.Canonical.SupersededIDs {
+ add(id)
+ }
+ }
+ if resource.Proxmox != nil {
+ add(resource.Proxmox.SourceID)
+ }
+
+ matching := make([]ResourceHealthAlert, 0, 1)
+ for _, alert := range alerts {
+ if _, ok := ids[strings.TrimSpace(alert.ResourceID)]; ok && healthAlertSeverity(alert.Level) > 0 {
+ matching = append(matching, alert)
+ }
+ }
+ sort.SliceStable(matching, func(i, j int) bool {
+ return healthAlertSeverity(matching[i].Level) > healthAlertSeverity(matching[j].Level)
+ })
+ return matching
+}
+
+func healthAlertSeverity(level string) int {
+ switch strings.ToLower(strings.TrimSpace(level)) {
+ case "critical":
+ return 2
+ case "warning", "warn":
+ return 1
+ default:
+ return 0
+ }
+}
+
+func availabilityFailureConfirmed(resource Resource) bool {
+ if resource.Availability == nil || !resource.Availability.Enabled || resource.Availability.Available {
+ return false
+ }
+ threshold := resource.Availability.FailureThreshold
+ if threshold <= 0 {
+ threshold = 1
+ }
+ return resource.Availability.ConsecutiveFailures >= threshold
+}
+
+func availabilityFailureDetail(resource Resource) string {
+ if resource.Availability == nil {
+ return ""
+ }
+ // Keep operator/configured error text out of fleet summaries. The stable
+ // application failure code is enough for presentation and cannot contain a
+ // probed response body, credential, or customer hostname.
+ return strings.TrimSpace(resource.Availability.ApplicationFailureCode)
+}
+
+func firstNonEmptyHealthCode(values ...string) string {
+ for _, value := range values {
+ if trimmed := strings.TrimSpace(value); trimmed != "" {
+ return trimmed
+ }
+ }
+ return ""
+}
+
+func isWorkloadHealthResource(resource Resource) bool {
+ switch CanonicalResourceType(resource.Type) {
+ case ResourceTypeVM, ResourceTypeSystemContainer, ResourceTypeAppContainer, ResourceTypePod:
+ return true
+ default:
+ return false
+ }
+}
+
+func isInfrastructureHealthResource(resource Resource) bool {
+ switch CanonicalResourceType(resource.Type) {
+ case ResourceTypeAgent, ResourceTypePBS, ResourceTypePMG, ResourceTypeK8sCluster, ResourceTypeK8sNode:
+ return true
+ default:
+ return false
+ }
+}
+
+func resourceIsOffline(resource Resource) bool {
+ switch strings.ToLower(strings.TrimSpace(string(resource.Status))) {
+ case "offline", "down", "failed", "error":
+ return true
+ default:
+ return false
+ }
+}
+
+func resourceIsOff(resource Resource) bool {
+ if resource.Proxmox != nil {
+ switch strings.ToLower(strings.TrimSpace(resource.Proxmox.RuntimeStatus)) {
+ case "stopped", "offline", "off", "halted", "paused", "suspended":
+ return true
+ }
+ }
+ switch strings.ToLower(strings.TrimSpace(string(resource.Status))) {
+ case "stopped", "offline", "off", "halted", "paused", "suspended":
+ return true
+ default:
+ return false
+ }
+}
+
+func staleResourceBackup(resource Resource, now time.Time) (time.Duration, bool) {
+ if resource.Proxmox == nil || resource.Proxmox.LastBackup.IsZero() {
+ return 0, false
+ }
+ resourceType := CanonicalResourceType(resource.Type)
+ if resourceType != ResourceTypeVM && resourceType != ResourceTypeSystemContainer {
+ return 0, false
+ }
+ age := now.Sub(resource.Proxmox.LastBackup)
+ return age, age > resourceBackupStaleAfter
+}
+
+func resourceHasStaleSource(resource Resource) bool {
+ for _, source := range resource.SourceStatus {
+ if strings.EqualFold(strings.TrimSpace(source.Status), "stale") {
+ return true
+ }
+ }
+ return false
+}
+
+func resourceHasUnknownSource(resource Resource) bool {
+ if len(resource.SourceStatus) == 0 {
+ return false
+ }
+ for _, source := range resource.SourceStatus {
+ if strings.EqualFold(strings.TrimSpace(source.Status), "unknown") {
+ return true
+ }
+ }
+ return false
+}
+
+func formatHealthAge(age time.Duration) string {
+ if age <= 0 {
+ return ""
+ }
+ if age >= 24*time.Hour {
+ return fmt.Sprintf("%dd", int(age.Hours()/24))
+ }
+ if age >= time.Hour {
+ return fmt.Sprintf("%dh", int(age.Hours()))
+ }
+ return fmt.Sprintf("%dm", int(age.Minutes()))
+}
diff --git a/internal/unifiedresources/health_test.go b/internal/unifiedresources/health_test.go
new file mode 100644
index 0000000000..3898a94a69
--- /dev/null
+++ b/internal/unifiedresources/health_test.go
@@ -0,0 +1,103 @@
+package unifiedresources
+
+import (
+ "testing"
+ "time"
+)
+
+func TestEvaluateResourceHealthPrecedenceAndVerdicts(t *testing.T) {
+ now := time.Date(2026, 8, 31, 20, 0, 0, 0, time.UTC)
+ staleStatus := map[DataSource]SourceStatus{
+ SourceAgent: {Status: "stale", LastSeen: now.Add(-10 * time.Minute)},
+ }
+ tests := []struct {
+ name string
+ resource Resource
+ alerts []ResourceHealthAlert
+ want ResourceHealthVerdict
+ code string
+ }{
+ {
+ name: "critical alert wins over stale telemetry",
+ resource: Resource{ID: "vm-1", Type: ResourceTypeVM, Status: StatusOnline, LastSeen: now.Add(-10 * time.Minute), SourceStatus: staleStatus},
+ alerts: []ResourceHealthAlert{{ResourceID: "vm-1", Level: "critical", Type: "cpu"}},
+ want: HealthCritical, code: "critical_alert",
+ },
+ {
+ name: "warning alert wins over powered off workload",
+ resource: Resource{ID: "vm-2", Type: ResourceTypeVM, Status: StatusOffline, Proxmox: &ProxmoxData{RuntimeStatus: "stopped"}},
+ alerts: []ResourceHealthAlert{{ResourceID: "vm-2", Level: "warning", Type: "backup"}},
+ want: HealthAttention, code: "warning_alert",
+ },
+ {
+ name: "confirmed availability failure is critical",
+ resource: Resource{ID: "check-1", Type: ResourceTypeNetworkEndpoint, Status: StatusOnline, Availability: &AvailabilityData{Enabled: true, Available: false, ConsecutiveFailures: 3, FailureThreshold: 3}},
+ want: HealthCritical, code: "availability_failed",
+ },
+ {
+ name: "offline infrastructure is critical",
+ resource: Resource{ID: "host-1", Type: ResourceTypeAgent, Status: StatusOffline},
+ want: HealthCritical, code: "offline",
+ },
+ {
+ name: "old recorded backup needs attention",
+ resource: Resource{ID: "vm-3", Type: ResourceTypeVM, Status: StatusOnline, Proxmox: &ProxmoxData{RuntimeStatus: "running", LastBackup: now.Add(-9 * 24 * time.Hour)}},
+ want: HealthAttention, code: "backup_stale",
+ },
+ {
+ name: "stale telemetry is explicit",
+ resource: Resource{ID: "host-2", Type: ResourceTypeAgent, Status: StatusWarning, LastSeen: now.Add(-10 * time.Minute), SourceStatus: staleStatus},
+ want: HealthStale, code: "telemetry_stale",
+ },
+ {
+ name: "powered off workload is neutral",
+ resource: Resource{ID: "vm-4", Type: ResourceTypeVM, Status: StatusOffline, Proxmox: &ProxmoxData{RuntimeStatus: "stopped"}},
+ want: HealthOff, code: "powered_off",
+ },
+ {
+ name: "healthy resource is verified",
+ resource: Resource{ID: "host-3", Type: ResourceTypeAgent, Status: StatusOnline, LastSeen: now},
+ want: HealthOK,
+ },
+ {
+ name: "informational alert does not invent attention",
+ resource: Resource{ID: "host-info", Type: ResourceTypeAgent, Status: StatusOnline, LastSeen: now},
+ alerts: []ResourceHealthAlert{{ResourceID: "host-info", Level: "info", Type: "notice"}},
+ want: HealthOK,
+ },
+ {
+ name: "missing telemetry is unknown",
+ resource: Resource{ID: "host-4", Type: ResourceTypeAgent, Status: StatusUnknown, SourceStatus: map[DataSource]SourceStatus{SourceAgent: {Status: "unknown"}}},
+ want: HealthUnknown, code: "telemetry_missing",
+ },
+ }
+
+ for _, test := range tests {
+ t.Run(test.name, func(t *testing.T) {
+ got := EvaluateResourceHealth(test.resource, test.alerts, now)
+ if got.Verdict != test.want {
+ t.Fatalf("verdict = %q, want %q (%+v)", got.Verdict, test.want, got)
+ }
+ if test.code == "" {
+ if len(got.Reasons) != 0 {
+ t.Fatalf("healthy verdict has reasons: %+v", got.Reasons)
+ }
+ return
+ }
+ if len(got.Reasons) == 0 || got.Reasons[0].Code != test.code {
+ t.Fatalf("reason = %+v, want code %q", got.Reasons, test.code)
+ }
+ })
+ }
+}
+
+func TestEvaluateResourceHealthMatchesCanonicalAliases(t *testing.T) {
+ resource := Resource{
+ ID: "current", Type: ResourceTypeVM, Status: StatusOnline,
+ Canonical: &CanonicalIdentity{PrimaryID: "primary", SupersededIDs: []string{"old"}},
+ }
+ got := EvaluateResourceHealth(resource, []ResourceHealthAlert{{ResourceID: "old", Level: "critical"}}, time.Now())
+ if got.Verdict != HealthCritical {
+ t.Fatalf("alias alert verdict = %q, want critical", got.Verdict)
+ }
+}
diff --git a/internal/unifiedresources/types.go b/internal/unifiedresources/types.go
index 2f0f22bac7..826c508e5c 100644
--- a/internal/unifiedresources/types.go
+++ b/internal/unifiedresources/types.go
@@ -13,13 +13,14 @@ import (
// Resource represents a unified resource aggregated across multiple data sources.
type Resource struct {
- ID string `json:"id"`
- Type ResourceType `json:"type"`
- Technology string `json:"technology,omitempty"`
- Name string `json:"name"`
- Status ResourceStatus `json:"status"`
- LastSeen time.Time `json:"lastSeen"`
- UpdatedAt time.Time `json:"updatedAt,omitempty"`
+ ID string `json:"id"`
+ Type ResourceType `json:"type"`
+ Technology string `json:"technology,omitempty"`
+ Name string `json:"name"`
+ Status ResourceStatus `json:"status"`
+ LastSeen time.Time `json:"lastSeen"`
+ UpdatedAt time.Time `json:"updatedAt,omitempty"`
+ Health *ResourceHealth `json:"health,omitempty"`
DiscoveryTarget *DiscoveryTarget `json:"discoveryTarget,omitempty"`
DiscoveryReadiness *ResourceDiscoveryReadiness `json:"discoveryReadiness,omitempty"`
diff --git a/tests/integration/tests/83-product-trust-accessibility.spec.ts b/tests/integration/tests/83-product-trust-accessibility.spec.ts
index ca1fdd668c..fdb063bac4 100644
--- a/tests/integration/tests/83-product-trust-accessibility.spec.ts
+++ b/tests/integration/tests/83-product-trust-accessibility.spec.ts
@@ -145,6 +145,120 @@ test("Actions remains named, directly reachable, keyboard accessible, and free o
});
});
+test("Home status wall is readable and motionless across desktop and phone widths", async ({
+ page,
+}, testInfo) => {
+ const lastSeen = "2026-08-31T22:30:00Z";
+ const resource = (
+ id: string,
+ name: string,
+ type: string,
+ sources: string[],
+ verdict: string,
+ reason?: { code: string; detail?: string },
+ ) => ({
+ id,
+ name,
+ type,
+ sources,
+ status:
+ verdict === "off"
+ ? "stopped"
+ : verdict === "critical"
+ ? "offline"
+ : "online",
+ lastSeen,
+ health: { verdict, reasons: reason ? [reason] : [] },
+ });
+ const resources = [
+ resource("node-down", "PVE node down", "agent", ["proxmox"], "critical", {
+ code: "offline",
+ }),
+ resource("vm-warning", "Billing VM", "vm", ["proxmox"], "attention", {
+ code: "warning_alert",
+ detail: "memory",
+ }),
+ resource("agent-stale", "Remote agent", "agent", ["agent"], "stale", {
+ code: "telemetry_stale",
+ detail: "12m",
+ }),
+ resource(
+ "container-off",
+ "Batch worker",
+ "app-container",
+ ["docker"],
+ "off",
+ {
+ code: "powered_off",
+ },
+ ),
+ resource(
+ "check-down",
+ "Customer portal",
+ "network-endpoint",
+ ["availability"],
+ "critical",
+ { code: "availability_failed" },
+ ),
+ ...Array.from({ length: 65 }, (_, index) =>
+ resource(
+ `healthy-${index + 1}`,
+ `Healthy VM ${index + 1}`,
+ "vm",
+ ["proxmox"],
+ "ok",
+ ),
+ ),
+ ];
+ await page.route("**/api/resources?*", (route) =>
+ route.fulfill({
+ status: 200,
+ contentType: "application/json",
+ body: JSON.stringify({
+ data: resources,
+ meta: { totalPages: 1 },
+ aggregations: { total: resources.length },
+ }),
+ }),
+ );
+ await page.emulateMedia({ reducedMotion: "reduce" });
+ await page.goto("/home", { waitUntil: "domcontentloaded" });
+ await expect(
+ page.getByRole("heading", { level: 1, name: "Home" }),
+ ).toBeVisible();
+ await expect(
+ page.getByRole("status").filter({ hasText: "3 need attention" }),
+ ).toBeVisible();
+ await expect(
+ page.getByRole("link", { name: /PVE node down: Critical/ }),
+ ).toBeVisible();
+ const showAll = page.getByRole("button", { name: "Show all (5)" });
+ await expect(showAll).toBeVisible();
+ await showAll.click();
+ await expect(page.getByRole("button", { name: "Show less" })).toBeVisible();
+
+ expect(await scanForWcagViolations(page)).toEqual([]);
+ expect(await scanForUnexpectedReducedMotion(page)).toEqual([]);
+ await testInfo.attach("home-desktop", {
+ body: await page.screenshot({ fullPage: true }),
+ contentType: "image/png",
+ });
+
+ await page.setViewportSize({ width: 390, height: 844 });
+ expect(await scanForWcagViolations(page)).toEqual([]);
+ expect(
+ await page.evaluate(
+ () =>
+ document.documentElement.scrollWidth >
+ document.documentElement.clientWidth,
+ ),
+ ).toBeFalsy();
+ await testInfo.attach("home-phone", {
+ body: await page.screenshot({ fullPage: true }),
+ contentType: "image/png",
+ });
+});
+
test("representative authenticated surfaces have no automatically detectable WCAG A/AA violations", async ({
page,
}) => {