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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
feat(infrastructure): add truenas recovery handoff
rcourtman823c429c03d3
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.mdindex 3650f8e368..7e0b627f70 100644--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md@@ -85,6 +85,7 @@ querying, and the operator-facing storage health presentation layer.23. Keep backend-native platform diagnostics on the adjacent AI/runtime and platform contracts. When `internal/api/` wires native TrueNAS app log reads for Assistant, storage and recovery may use those diagnostics during investigation, but they must not grow a parallel recovery-local log transport or diagnostic payload shape.24. Keep backend-native platform configuration reads on the adjacent AI/runtime and platform contracts. When `internal/api/` wires native TrueNAS app config for Assistant, storage and recovery may use that runtime shape during investigation, but they must not grow a parallel recovery-local config transport or provider-shaped configuration payload.25. Keep provider-backed poll cadence and settings-runtime health on the adjacent platform-connections contract. When shared `internal/api/` and poller wiring expose TrueNAS last-sync status, failure summaries, discovered contribution counts, or platform handoff links in settings, storage and recovery may consume the resulting datasets, apps, disks, and recovery artifacts but must not redefine those settings-runtime health semantics or connection-level handoffs in storage/recovery-local transport or page flows.+26. Keep cross-surface recovery handoffs on the shared route-helper contract. When infrastructure or other unified-resource consumers expose TrueNAS recovery links, they must reuse the canonical `frontend-modern/src/routing/resourceLinks.ts` recovery builder with owned `platform` and `node` queries instead of inventing drawer-local recovery URLs or treating PBS services as the only infrastructure-to-recovery path.## Forbidden Pathsdiff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.mdindex da9b9aed4e..8607c3fa3c 100644--- a/docs/release-control/v6/internal/subsystems/unified-resources.md+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md@@ -518,6 +518,12 @@ back to generic agent or Docker-only semantics when host telemetry is alsopresent. Runtime-local filters like `agent` or cluster context may still beadded as secondary scope, but the canonical platform query must remain thefirst-class route boundary for shared workload navigation.+That same routing contract now also owns recovery deep links for unified+resources. Infrastructure drawers and other cross-surface consumers must route+TrueNAS-backed top-level systems through canonical `/recovery` route state+there, using owned `platform` and `node` queries instead of rebuilding+drawer-local recovery links or assuming only PBS services can expose recovery+handoffs from infrastructure.That drawer shell now routes its canonical timeline filter, facet-bundle, andresource-intelligence state through`frontend-modern/src/components/Infrastructure/useResourceDetailDrawerHistoryState.ts`,diff --git a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.test.tsindex 2aa640c85d..c23ab5e367 100644--- a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.test.ts+++ b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.test.ts@@ -168,6 +168,12 @@ describe('resourceDetailDrawerOperationalModel', () => {compactLabel: 'Storage',ariaLabel: 'Open related storage for TrueNAS Main',},+ {+ href: '/recovery?platform=truenas&node=truenas-main',+ label: 'Open in Recovery',+ compactLabel: 'Recovery',+ ariaLabel: 'Open related recovery for TrueNAS Main',+ },]);});@@ -198,6 +204,12 @@ describe('resourceDetailDrawerOperationalModel', () => {compactLabel: 'Storage',ariaLabel: 'Open related storage for TrueNAS Main',},+ {+ href: '/recovery?platform=truenas&node=truenas-main',+ label: 'Open in Recovery',+ compactLabel: 'Recovery',+ ariaLabel: 'Open related recovery for TrueNAS Main',+ },]);});diff --git a/frontend-modern/src/components/Infrastructure/resourceDetailDrawerOperationalModel.ts b/frontend-modern/src/components/Infrastructure/resourceDetailDrawerOperationalModel.tsindex 05631e06a8..8a3a15638e 100644--- a/frontend-modern/src/components/Infrastructure/resourceDetailDrawerOperationalModel.ts+++ b/frontend-modern/src/components/Infrastructure/resourceDetailDrawerOperationalModel.ts@@ -2,7 +2,7 @@ import type { Resource } from '@/types/resource';import type { KubernetesMetricCapabilities, PlatformData } from './resourceDetailMappers';import { buildServiceDetailLinks, type ServiceDetailLink } from './serviceDetailLinks';import { buildWorkloadsHref } from './workloadsLink';-import { buildStorageHrefForResource } from '@/routing/resourceLinks';+import { buildRecoveryHrefForResource, buildStorageHrefForResource } from '@/routing/resourceLinks';export type ResourceDetailDrawerOperationalBadge = {label: string;@@ -219,6 +219,15 @@ export const buildRelatedLinks = (ariaLabel: `Open related storage for ${displayName}`,});}+ const recovery = buildRecoveryHrefForResource(resource);+ if (recovery) {+ links.push({+ href: recovery,+ label: 'Open in Recovery',+ compactLabel: 'Recovery',+ ariaLabel: `Open related recovery for ${displayName}`,+ });+ }links.push(...buildServiceDetailLinks(resource));const seen = new Set<string>();diff --git a/frontend-modern/src/routing/__tests__/resourceLinks.test.ts b/frontend-modern/src/routing/__tests__/resourceLinks.test.tsindex 10337e3e4f..a2d85f885e 100644--- a/frontend-modern/src/routing/__tests__/resourceLinks.test.ts+++ b/frontend-modern/src/routing/__tests__/resourceLinks.test.ts@@ -5,6 +5,7 @@ import {RECOVERY_QUERY_PARAMS,buildInfrastructureHrefForWorkload,buildRecoveryPath,+ buildRecoveryHrefForResource,buildInfrastructurePath,buildInfrastructureResourceHref,buildStorageHrefForResource,@@ -270,6 +271,41 @@ describe('resource link routing contract', () => {expect(href).toBe('/storage?source=truenas&node=truenas-main');});+ it('builds recovery deep links for top-level TrueNAS systems', () => {+ const href = buildRecoveryHrefForResource({+ id: 'truenas-main',+ type: 'truenas',+ name: 'truenas-main',+ displayName: 'TrueNAS Main',+ platformId: 'truenas-main',+ platformType: 'truenas',+ sourceType: 'hybrid',+ status: 'online',+ lastSeen: Date.now(),+ } as any);++ expect(href).toBe('/recovery?platform=truenas&node=truenas-main');+ });++ it('builds recovery deep links for hybrid agent resources with merged truenas sources', () => {+ const href = buildRecoveryHrefForResource({+ id: 'truenas-main',+ type: 'agent',+ name: 'truenas-main',+ displayName: 'TrueNAS Main',+ platformId: 'truenas-main',+ platformType: 'agent',+ sourceType: 'hybrid',+ status: 'online',+ lastSeen: Date.now(),+ platformData: {+ sources: ['agent', 'truenas'],+ },+ } as any);++ expect(href).toBe('/recovery?platform=truenas&node=truenas-main');+ });+it('canonicalizes legacy storage source aliases when parsing links', () => {expect(parseStorageLinkSearch('?source=pbs')).toMatchObject({ source: 'proxmox-pbs' });expect(parseStorageLinkSearch('?source=proxmox')).toMatchObject({ source: 'proxmox-pve' });diff --git a/frontend-modern/src/routing/resourceLinks.ts b/frontend-modern/src/routing/resourceLinks.tsindex c07a321a52..978ad6f503 100644--- a/frontend-modern/src/routing/resourceLinks.ts+++ b/frontend-modern/src/routing/resourceLinks.ts@@ -263,6 +263,24 @@ export const buildStorageHrefForResource = (resource: Resource): string | null =return null;};+export const buildRecoveryHrefForResource = (resource: Resource): string | null => {+ const mergedPlatform = Array.isArray(resource.platformData?.sources)+ ? resolvePlatformTypeFromSources(resource.platformData.sources)+ : undefined;+ const platform = normalizeSourcePlatformQueryValue(+ resource.storage?.platform || mergedPlatform || resource.platformType || resource.type,+ );++ if (platform === 'truenas' && (resource.type === 'truenas' || resource.type === 'agent')) {+ return buildRecoveryPath({+ platform: 'truenas',+ node: resource.id,+ });+ }++ return null;+};+export const parseStorageLinkSearch = (search: string) => {const params = new URLSearchParams(search);return {diff --git a/tests/integration/tests/23-truenas-infrastructure-storage-links.spec.ts b/tests/integration/tests/23-truenas-infrastructure-storage-links.spec.tsindex 2e87fd2e00..3484028c61 100644--- a/tests/integration/tests/23-truenas-infrastructure-storage-links.spec.ts+++ b/tests/integration/tests/23-truenas-infrastructure-storage-links.spec.ts@@ -10,7 +10,7 @@ type WorkerFixtures = {authStorageStatePath: string;};-const SCREENSHOT_PATH = '/tmp/truenas-infrastructure-storage-links.png';+const SCREENSHOT_PATH = '/tmp/truenas-infrastructure-storage-recovery-links.png';const test = base.extend<{}, WorkerFixtures>({storageState: async ({ authStorageStatePath }, use) => {@@ -35,10 +35,10 @@ const test = base.extend<{}, WorkerFixtures>({}, { scope: 'worker' }],});-test.describe('TrueNAS infrastructure storage links', () => {+test.describe('TrueNAS infrastructure storage and recovery links', () => {test.setTimeout(180_000);- test('surfaces canonical workloads and storage links for top-level TrueNAS systems', async ({+ test('surfaces canonical workloads, storage, and recovery links for top-level TrueNAS systems', async ({page,}) => {await page.route('**/api/resources**', async (route) => {@@ -139,6 +139,7 @@ test.describe('TrueNAS infrastructure storage links', () => {const workloadsLink = page.getByRole('link', { name: 'Open related workloads for TrueNAS Main' });const storageLink = page.getByRole('link', { name: 'Open related storage for TrueNAS Main' });+ const recoveryLink = page.getByRole('link', { name: 'Open related recovery for TrueNAS Main' });await expect(workloadsLink).toHaveAttribute('href',@@ -148,6 +149,10 @@ test.describe('TrueNAS infrastructure storage links', () => {'href','/storage?source=truenas&node=truenas-main',);+ await expect(recoveryLink).toHaveAttribute(+ 'href',+ '/recovery?platform=truenas&node=truenas-main',+ );await page.screenshot({ path: SCREENSHOT_PATH, fullPage: true });});