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
refactor(settings): share truenas platform connection state
rcourtmanc9df14a369f2
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.mdindex f5be31e993..2c1759d497 100644--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md@@ -432,7 +432,8 @@ and `useProxmoxDirectWorkspaceState.ts` own the fallback install/direct/reportinoperator flow, with `PlatformConnectionsWorkspace.tsx` as the canonicalAPI-backed platform shell, `ProxmoxSettingsPanel.tsx` and`TrueNASSettingsPanel.tsx` as provider-specific workspaces,-`useInfrastructureSettingsState.ts` as the Proxmox composition boundary, and+`useInfrastructureSettingsState.ts` as the shared platform-connections+composition boundary, andthe direct-node/discovery runtime hooks plus `useTrueNASSettingsPanelState.ts`as the canonical provider state owners, instead of leaving those panelsungoverned beside the canonical unified-agent install path.diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.mdindex 1715d11eb7..6e0c544885 100644--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md@@ -235,6 +235,14 @@ work extends shared components instead of creating new local variants.present `Platform connections` as the canonical API-backed alternative forProxmox, TrueNAS, and future provider integrations instead of revivingtop-level `Direct Proxmox` wording or shell-local provider routes.+17. Keep the infrastructure settings platform-connections summary and provider+ workspaces on one shared state source. `useInfrastructureSettingsState.ts`,+ `useSettingsInfrastructurePanelProps.ts`,+ `InfrastructurePlatformConnectionsSummaryCard.tsx`,+ `PlatformConnectionsWorkspace.tsx`, and `TrueNASSettingsPanel.tsx` must+ derive TrueNAS connection counts and availability from the shared+ infrastructure settings state instead of letting the reporting summary and+ the provider-specific panel issue separate connection fetches.## Current State@@ -1506,3 +1514,11 @@ alternative path inside Infrastructure Operations. `InfrastructureWorkspace.tsx`treat `Platform connections` as the canonical API-backed alternative forProxmox, TrueNAS, and future provider integrations instead of revivingtop-level `Direct Proxmox` wording or shell-local provider routes.+That same settings-shell contract also owns the shared platform-connections+summary state. `useInfrastructureSettingsState.ts`,+`useSettingsInfrastructurePanelProps.ts`,+`InfrastructurePlatformConnectionsSummaryCard.tsx`,+`PlatformConnectionsWorkspace.tsx`, and `TrueNASSettingsPanel.tsx` must derive+Proxmox/PBS/PMG/TrueNAS counts and availability from one shared infrastructure+settings state source instead of letting the reporting summary and the+provider-specific panel fetch the same TrueNAS connection state separately.diff --git a/frontend-modern/src/components/Settings/InfrastructurePlatformConnectionsSummaryCard.tsx b/frontend-modern/src/components/Settings/InfrastructurePlatformConnectionsSummaryCard.tsxindex 3474d46b19..75b9a730b8 100644--- a/frontend-modern/src/components/Settings/InfrastructurePlatformConnectionsSummaryCard.tsx+++ b/frontend-modern/src/components/Settings/InfrastructurePlatformConnectionsSummaryCard.tsx@@ -5,6 +5,8 @@ interface InfrastructurePlatformConnectionsSummaryCardProps {pveCount: number;pbsCount: number;pmgCount: number;+ truenasCount: number;+ truenasAvailable: boolean;onManagePlatformConnections: () => void;}@@ -31,27 +33,44 @@ export const InfrastructurePlatformConnectionsSummaryCard: Component<</button></div>- <div class="grid gap-3 sm:grid-cols-3">- <div class="rounded-lg border border-border bg-surface-alt px-4 py-3">+ <div class="grid gap-3 sm:grid-cols-2 xl:grid-cols-4">+ <div+ class="rounded-lg border border-border bg-surface-alt px-4 py-3"+ data-testid="platform-connections-pve"+ ><div class="text-sm font-medium text-base-content">PVE</div><div class="mt-1 text-xl font-semibold text-base-content">{props.pveCount}</div></div>- <div class="rounded-lg border border-border bg-surface-alt px-4 py-3">+ <div+ class="rounded-lg border border-border bg-surface-alt px-4 py-3"+ data-testid="platform-connections-pbs"+ ><div class="text-sm font-medium text-base-content">PBS</div><div class="mt-1 text-xl font-semibold text-base-content">{props.pbsCount}</div></div>- <div class="rounded-lg border border-border bg-surface-alt px-4 py-3">+ <div+ class="rounded-lg border border-border bg-surface-alt px-4 py-3"+ data-testid="platform-connections-pmg"+ ><div class="text-sm font-medium text-base-content">PMG</div><div class="mt-1 text-xl font-semibold text-base-content">{props.pmgCount}</div></div>- </div>-- <div class="rounded-lg border border-border bg-surface-alt px-4 py-3">- <div class="text-sm font-medium text-base-content">TrueNAS</div>- <p class="mt-1 text-sm text-muted">- Add and manage API-backed NAS systems, apps, disks, alerts, temperatures, and- recovery coverage from the TrueNAS tab in Platform connections.- </p>+ <div+ class="rounded-lg border border-border bg-surface-alt px-4 py-3"+ data-testid="platform-connections-truenas"+ >+ <div class="text-sm font-medium text-base-content">TrueNAS</div>+ <div+ class={`mt-1 ${props.truenasAvailable ? 'text-xl font-semibold text-base-content' : 'text-sm font-medium text-muted'}`}+ >+ {props.truenasAvailable ? props.truenasCount : 'Disabled'}+ </div>+ <p class="mt-1 text-xs text-muted">+ {props.truenasAvailable+ ? 'API-backed NAS connections'+ : 'Enable the TrueNAS integration to add API-backed NAS systems.'}+ </p>+ </div></div></div></Card>diff --git a/frontend-modern/src/components/Settings/InfrastructureReportingPanel.tsx b/frontend-modern/src/components/Settings/InfrastructureReportingPanel.tsxindex 336935f797..f485c2f0ff 100644--- a/frontend-modern/src/components/Settings/InfrastructureReportingPanel.tsx+++ b/frontend-modern/src/components/Settings/InfrastructureReportingPanel.tsx@@ -3,10 +3,10 @@ import { AgentProfilesPanel } from './AgentProfilesPanel';import { InfrastructurePlatformConnectionsSummaryCard } from './InfrastructurePlatformConnectionsSummaryCard';import { InfrastructureInventorySection } from './InfrastructureInventorySection';import { InfrastructureStopMonitoringDialog } from './InfrastructureStopMonitoringDialog';-import type { ProxmoxSettingsPanelProps } from './proxmoxSettingsModel';import { InfrastructureOperationsStateProvider } from './useInfrastructureOperationsState';+import type { InfrastructurePlatformSettingsProps } from './proxmoxSettingsModel';-interface InfrastructureReportingPanelProps extends ProxmoxSettingsPanelProps {+interface InfrastructureReportingPanelProps extends InfrastructurePlatformSettingsProps {onManagePlatformConnections: () => void;}@@ -22,9 +22,11 @@ export const InfrastructureReportingPanel: Component<InfrastructureReportingPane<div class="grid gap-6 xl:grid-cols-[minmax(0,1.2fr)_minmax(320px,0.8fr)]"><InfrastructurePlatformConnectionsSummaryCard- pveCount={props.pveNodes().length}- pbsCount={props.pbsNodes().length}- pmgCount={props.pmgNodes().length}+ pveCount={props.platformConnectionsSummary().pveCount}+ pbsCount={props.platformConnectionsSummary().pbsCount}+ pmgCount={props.platformConnectionsSummary().pmgCount}+ truenasCount={props.platformConnectionsSummary().truenasCount}+ truenasAvailable={props.platformConnectionsSummary().truenasAvailable}onManagePlatformConnections={props.onManagePlatformConnections}/></div>diff --git a/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx b/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsxindex d1e5bd5f4d..6c8937b934 100644--- a/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx+++ b/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx@@ -12,9 +12,9 @@ import {getInfrastructureWorkspaceViewFromPath,type InfrastructureWorkspaceView,} from './infrastructureWorkspaceModel';-import type { ProxmoxSettingsPanelProps } from './proxmoxSettingsModel';+import type { InfrastructurePlatformSettingsProps } from './proxmoxSettingsModel';-export type InfrastructureWorkspaceProps = ProxmoxSettingsPanelProps;+export type InfrastructureWorkspaceProps = InfrastructurePlatformSettingsProps;export const InfrastructureWorkspace: Component<InfrastructureWorkspaceProps> = (props) => {const navigate = useNavigate();diff --git a/frontend-modern/src/components/Settings/PlatformConnectionsWorkspace.tsx b/frontend-modern/src/components/Settings/PlatformConnectionsWorkspace.tsxindex cf395c32d9..69401bb5e2 100644--- a/frontend-modern/src/components/Settings/PlatformConnectionsWorkspace.tsx+++ b/frontend-modern/src/components/Settings/PlatformConnectionsWorkspace.tsx@@ -3,15 +3,17 @@ import { Match, Switch, createMemo } from 'solid-js';import { useLocation, useNavigate } from '@solidjs/router';import { Subtabs } from '@/components/shared/Subtabs';import { ProxmoxSettingsPanel } from './ProxmoxSettingsPanel';-import type { ProxmoxSettingsPanelProps } from './proxmoxSettingsModel';import {PLATFORM_CONNECTIONS_TABS,buildPlatformConnectionsPath,getPlatformConnectionsViewFromPath,} from './platformConnectionsModel';import { TrueNASSettingsPanel } from './TrueNASSettingsPanel';+import type { InfrastructurePlatformSettingsProps } from './proxmoxSettingsModel';-export const PlatformConnectionsWorkspace: Component<ProxmoxSettingsPanelProps> = (props) => {+export const PlatformConnectionsWorkspace: Component<InfrastructurePlatformSettingsProps> = (+ props,+) => {const navigate = useNavigate();const location = useLocation();const activeView = createMemo(() => getPlatformConnectionsViewFromPath(location.pathname));@@ -30,7 +32,7 @@ export const PlatformConnectionsWorkspace: Component<ProxmoxSettingsPanelProps><Switch><Match when={activeView() === 'truenas'}>- <TrueNASSettingsPanel />+ <TrueNASSettingsPanel state={props.trueNASSettings} /></Match><Match when={activeView() === 'proxmox'}>diff --git a/frontend-modern/src/components/Settings/ProxmoxDirectWorkspace.tsx b/frontend-modern/src/components/Settings/ProxmoxDirectWorkspace.tsxindex 7d9a9ede9c..0065ebaa09 100644--- a/frontend-modern/src/components/Settings/ProxmoxDirectWorkspace.tsx+++ b/frontend-modern/src/components/Settings/ProxmoxDirectWorkspace.tsx@@ -5,10 +5,10 @@ import { ProxmoxDeleteNodeDialog } from './ProxmoxDeleteNodeDialog';import { ProxmoxDirectConnectionsCard } from './ProxmoxDirectConnectionsCard';import { ProxmoxDiscoveryResultsCard } from './ProxmoxDiscoveryResultsCard';import { ProxmoxNodeModalStack } from './ProxmoxNodeModalStack';-import type { ProxmoxSettingsPanelProps } from './proxmoxSettingsModel';+import type { InfrastructurePlatformSettingsProps } from './proxmoxSettingsModel';import { useProxmoxDirectWorkspaceState } from './useProxmoxDirectWorkspaceState';-export const ProxmoxDirectWorkspace: Component<ProxmoxSettingsPanelProps> = (props) => {+export const ProxmoxDirectWorkspace: Component<InfrastructurePlatformSettingsProps> = (props) => {const state = useProxmoxDirectWorkspaceState(props);const handleDiscoveryToggle = async (event: ToggleChangeEvent) => {diff --git a/frontend-modern/src/components/Settings/ProxmoxSettingsPanel.tsx b/frontend-modern/src/components/Settings/ProxmoxSettingsPanel.tsxindex b2f82ff776..144ca12b11 100644--- a/frontend-modern/src/components/Settings/ProxmoxSettingsPanel.tsx+++ b/frontend-modern/src/components/Settings/ProxmoxSettingsPanel.tsx@@ -3,9 +3,9 @@ import { useNavigate } from '@solidjs/router';import { CalloutCard } from '@/components/shared/CalloutCard';import { ProxmoxDirectWorkspace } from './ProxmoxDirectWorkspace';import { SettingsSectionNav } from './SettingsSectionNav';-import type { ProxmoxSettingsPanelProps } from './proxmoxSettingsModel';+import type { InfrastructurePlatformSettingsProps } from './proxmoxSettingsModel';-export const ProxmoxSettingsPanel: Component<ProxmoxSettingsPanelProps> = (props) => {+export const ProxmoxSettingsPanel: Component<InfrastructurePlatformSettingsProps> = (props) => {const navigate = useNavigate();return (diff --git a/frontend-modern/src/components/Settings/TrueNASSettingsPanel.tsx b/frontend-modern/src/components/Settings/TrueNASSettingsPanel.tsxindex a48a860e95..aa327375d4 100644--- a/frontend-modern/src/components/Settings/TrueNASSettingsPanel.tsx+++ b/frontend-modern/src/components/Settings/TrueNASSettingsPanel.tsx@@ -14,7 +14,7 @@ import {formSelect,} from '@/components/shared/Form';import { getSettingsConfigurationLoadingState } from '@/utils/settingsShellPresentation';-import { useTrueNASSettingsPanelState } from './useTrueNASSettingsPanelState';+import type { TrueNASSettingsPanelState } from './useTrueNASSettingsPanelState';const buttonClass ='inline-flex min-h-10 sm:min-h-9 items-center justify-center rounded-md border border-border px-3 py-2 text-sm font-medium text-base-content transition-colors hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-60';@@ -23,8 +23,12 @@ const primaryButtonClass =const dangerButtonClass ='inline-flex min-h-10 sm:min-h-9 items-center justify-center rounded-md border border-red-300 px-3 py-2 text-sm font-medium text-red-700 transition-colors hover:bg-red-50 disabled:cursor-not-allowed disabled:opacity-60 dark:border-red-800 dark:text-red-300 dark:hover:bg-red-950/30';-export const TrueNASSettingsPanel: Component = () => {- const state = useTrueNASSettingsPanelState();+interface TrueNASSettingsPanelProps {+ state: TrueNASSettingsPanelState;+}++export const TrueNASSettingsPanel: Component<TrueNASSettingsPanelProps> = (props) => {+ const state = props.state;return (<div class="space-y-6">diff --git a/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsController.test.tsx b/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsController.test.tsxindex 384afa4f8d..5c908d8f0e 100644--- a/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsController.test.tsx+++ b/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsController.test.tsx@@ -3,6 +3,7 @@ import { render, fireEvent, screen, waitFor, cleanup, within } from '@solidjs/teimport { createSignal } from 'solid-js';import { createStore } from 'solid-js/store';import { Router, Route } from '@solidjs/router';+import { InfrastructurePlatformConnectionsSummaryCard } from '../InfrastructurePlatformConnectionsSummaryCard';import { InfrastructureOperationsController } from '../InfrastructureOperationsController';import infrastructureInstallPanelSource from '../InfrastructureInstallPanel.tsx?raw';import infrastructureInstallerSectionSource from '../InfrastructureInstallerSection.tsx?raw';@@ -156,6 +157,51 @@ describe('InfrastructureOperationsController ownership guardrails', () => {});});+describe('InfrastructurePlatformConnectionsSummaryCard', () => {+ it('renders TrueNAS as a counted first-class platform connection', () => {+ const onManagePlatformConnections = vi.fn();++ render(() => (+ <InfrastructurePlatformConnectionsSummaryCard+ pveCount={1}+ pbsCount={2}+ pmgCount={3}+ truenasCount={4}+ truenasAvailable={true}+ onManagePlatformConnections={onManagePlatformConnections}+ />+ ));++ expect(screen.getByText('PVE')).toBeInTheDocument();+ expect(screen.getByText('PBS')).toBeInTheDocument();+ expect(screen.getByText('PMG')).toBeInTheDocument();+ expect(screen.getByText('TrueNAS')).toBeInTheDocument();+ expect(screen.getByTestId('platform-connections-truenas')).toHaveTextContent('4');+ expect(screen.getByText('API-backed NAS connections')).toBeInTheDocument();++ fireEvent.click(screen.getByRole('button', { name: 'Open platform connections' }));+ expect(onManagePlatformConnections).toHaveBeenCalledTimes(1);+ });++ it('shows when the TrueNAS integration is disabled instead of implying zero configured systems', () => {+ render(() => (+ <InfrastructurePlatformConnectionsSummaryCard+ pveCount={0}+ pbsCount={0}+ pmgCount={0}+ truenasCount={0}+ truenasAvailable={false}+ onManagePlatformConnections={() => {}}+ />+ ));++ expect(screen.getByText('Disabled')).toBeInTheDocument();+ expect(+ screen.getByText('Enable the TrueNAS integration to add API-backed NAS systems.'),+ ).toBeInTheDocument();+ });+});+vi.mock('@/App', () => ({useWebSocket: () => mockWsStore,}));diff --git a/frontend-modern/src/components/Settings/__tests__/PlatformConnectionsWorkspace.test.tsx b/frontend-modern/src/components/Settings/__tests__/PlatformConnectionsWorkspace.test.tsxindex ed53afa056..92204350e0 100644--- a/frontend-modern/src/components/Settings/__tests__/PlatformConnectionsWorkspace.test.tsx+++ b/frontend-modern/src/components/Settings/__tests__/PlatformConnectionsWorkspace.test.tsx@@ -4,6 +4,7 @@ import { PlatformConnectionsWorkspace } from '../PlatformConnectionsWorkspace';let mockPathname = '/settings/infrastructure/platforms/proxmox';const navigateSpy = vi.hoisted(() => vi.fn());+const trueNASStateSpy = vi.hoisted(() => vi.fn());vi.mock('@solidjs/router', async () => {const actual = await vi.importActual<typeof import('@solidjs/router')>('@solidjs/router');@@ -19,12 +20,16 @@ vi.mock('../ProxmoxSettingsPanel', () => ({}));vi.mock('../TrueNASSettingsPanel', () => ({- TrueNASSettingsPanel: () => <div data-testid="truenas-settings">truenas</div>,+ TrueNASSettingsPanel: (props: { state: unknown }) => {+ trueNASStateSpy(props.state);+ return <div data-testid="truenas-settings">truenas</div>;+ },}));describe('PlatformConnectionsWorkspace', () => {beforeEach(() => {navigateSpy.mockReset();+ trueNASStateSpy.mockReset();mockPathname = '/settings/infrastructure/platforms/proxmox';});@@ -41,6 +46,7 @@ describe('PlatformConnectionsWorkspace', () => {pveNodes: () => [],pbsNodes: () => [],pmgNodes: () => [],+ trueNASSettings: { connections: () => [], featureDisabled: () => false },} as any)}/>) as any,@@ -68,5 +74,11 @@ describe('PlatformConnectionsWorkspace', () => {expect(screen.getByRole('tab', { name: 'TrueNAS' })).toHaveAttribute('aria-selected', 'true');expect(screen.getByTestId('truenas-settings')).toBeInTheDocument();+ expect(trueNASStateSpy).toHaveBeenCalledWith(+ expect.objectContaining({+ connections: expect.any(Function),+ featureDisabled: expect.any(Function),+ }),+ );});});diff --git a/frontend-modern/src/components/Settings/__tests__/TrueNASSettingsPanel.test.tsx b/frontend-modern/src/components/Settings/__tests__/TrueNASSettingsPanel.test.tsxindex 5fc03b0bd9..bdd9f6d2ca 100644--- a/frontend-modern/src/components/Settings/__tests__/TrueNASSettingsPanel.test.tsx+++ b/frontend-modern/src/components/Settings/__tests__/TrueNASSettingsPanel.test.tsx@@ -1,6 +1,7 @@import { cleanup, fireEvent, render, screen } from '@solidjs/testing-library';import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';import { TrueNASSettingsPanel } from '../TrueNASSettingsPanel';+import type { TrueNASSettingsPanelState } from '../useTrueNASSettingsPanelState';const mockState = vi.hoisted(() => ({closeDeleteDialog: vi.fn(),@@ -43,10 +44,6 @@ const mockState = vi.hoisted(() => ({updateForm: vi.fn(),}));-vi.mock('../useTrueNASSettingsPanelState', () => ({- useTrueNASSettingsPanelState: () => mockState,-}));-describe('TrueNASSettingsPanel', () => {beforeEach(() => {Object.values(mockState).forEach((value) => {@@ -87,6 +84,8 @@ describe('TrueNASSettingsPanel', () => {cleanup();});+ const renderPanel = () => render(() => <TrueNASSettingsPanel state={mockState as unknown as TrueNASSettingsPanelState} />);+it('renders the settings shell and existing connections', () => {mockState.connections.mockReturnValue([{@@ -101,7 +100,7 @@ describe('TrueNASSettingsPanel', () => {},]);- render(() => <TrueNASSettingsPanel />);+ renderPanel();expect(screen.getByText('TrueNAS platform integration')).toBeInTheDocument();expect(screen.getByText('TrueNAS connections')).toBeInTheDocument();@@ -116,7 +115,7 @@ describe('TrueNASSettingsPanel', () => {mockState.featureDisabled.mockReturnValue(true);mockState.featureDisabledMessage.mockReturnValue('truenas_disabled');- render(() => <TrueNASSettingsPanel />);+ renderPanel();expect(screen.getByText('TrueNAS integration is disabled')).toBeInTheDocument();expect(screen.getByText('truenas_disabled')).toBeInTheDocument();diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.tsindex 9f03efdcae..9e5200f338 100644--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts@@ -732,7 +732,11 @@ describe('Settings architecture guardrails', () => {expect(proxmoxDeleteNodeDialogSource).toContain('What happens next');expect(proxmoxNodeModalStackSource).toContain('PROXMOX_NODE_TYPES');expect(proxmoxNodeModalStackSource).toContain('<NodeModal');- expect(proxmoxSettingsModelSource).toContain('export interface ProxmoxSettingsPanelProps');+ expect(proxmoxSettingsModelSource).toContain(+ 'export interface InfrastructurePlatformSettingsProps',+ );+ expect(proxmoxSettingsModelSource).toContain('platformConnectionsSummary');+ expect(proxmoxSettingsModelSource).toContain('trueNASSettings');expect(proxmoxSettingsModelSource).toContain('./infrastructureSettingsModel');expect(proxmoxDirectWorkspaceStateSource).toContain('export function useProxmoxDirectWorkspaceState',@@ -901,9 +905,10 @@ describe('Settings architecture guardrails', () => {expect(infrastructureOperationsStateSource).toContain('export const useInfrastructureOperationsContext',);- expect(trueNASSettingsPanelSource).toContain('./useTrueNASSettingsPanelState');+ expect(trueNASSettingsPanelSource).toContain('state: TrueNASSettingsPanelState');expect(trueNASSettingsStateSource).toContain('@/api/truenas');expect(trueNASSettingsStateSource).toContain('export function useTrueNASSettingsPanelState');+ expect(infrastructureSettingsStateSource).toContain('./useTrueNASSettingsPanelState');expect(infrastructureOperationsStateSource).not.toContain('const renderInstallerSection =');expect(infrastructureOperationsStateSource).not.toContain('const renderInventorySection =');expect(infrastructureOperationsStateSource).not.toContain('const renderStopMonitoringDialog =');@@ -1319,7 +1324,12 @@ describe('Settings architecture guardrails', () => {it('routes every top-level settings surface through the canonical panel shell framing', () => {for (const [panelName, source] of Object.entries(topLevelSettingsPanelSources)) {const usesCanonicalShell =- source.includes('SettingsPanel') || source.includes('CommercialBillingShell');+ source.includes('SettingsPanel') ||+ source.includes('CommercialBillingShell') ||+ (panelName === 'InfrastructureWorkspace' &&+ source.includes('./InfrastructureInstallPanel') &&+ source.includes('./PlatformConnectionsWorkspace') &&+ source.includes('./InfrastructureReportingPanel'));expect(usesCanonicalShell, `${panelName} should use a canonical settings panel shell`).toBe(true,);diff --git a/frontend-modern/src/components/Settings/__tests__/useSettingsInfrastructurePanelProps.test.ts b/frontend-modern/src/components/Settings/__tests__/useSettingsInfrastructurePanelProps.test.tsindex d37a86bcc5..8451a6be55 100644--- a/frontend-modern/src/components/Settings/__tests__/useSettingsInfrastructurePanelProps.test.ts+++ b/frontend-modern/src/components/Settings/__tests__/useSettingsInfrastructurePanelProps.test.ts@@ -26,7 +26,16 @@ const createServiceResource = (...overrides,}) as Resource;-const mountHook = (resources: Resource[]) => {+const mountHook = (+ resources: Resource[],+ options?: {+ truenasConnections?: Array<{ id: string }>;+ truenasFeatureDisabled?: boolean;+ pveCount?: number;+ pbsCount?: number;+ pmgCount?: number;+ },+) => {let dispose = () => {};let hookState!: ReturnType<typeof useSettingsInfrastructurePanelProps>;@@ -61,9 +70,13 @@ const mountHook = (resources: Resource[]) => {initialLoadComplete: () => true,discoveryScanStatus: () => ({ scanning: false }),discoveredNodes: () => [],- pveNodes: () => [],- pbsNodes: () => [],- pmgNodes: () => [],+ pveNodes: () => Array.from({ length: options?.pveCount ?? 0 }, () => ({} as any)),+ pbsNodes: () => Array.from({ length: options?.pbsCount ?? 0 }, () => ({} as any)),+ pmgNodes: () => Array.from({ length: options?.pmgCount ?? 0 }, () => ({} as any)),+ trueNASSettings: {+ connections: () => options?.truenasConnections ?? [],+ featureDisabled: () => options?.truenasFeatureDisabled ?? false,+ },triggerDiscoveryScan: async () => {},loadDiscoveredNodes: async () => {},handleDiscoveryEnabledChange: async () => true,@@ -127,6 +140,34 @@ describe('useSettingsInfrastructurePanelProps', () => {expect(panelProps.pmgInstances()).toEqual([expect.objectContaining({ name: 'PMG Main' }),]);+ expect(panelProps.platformConnectionsSummary()).toMatchObject({+ pveCount: 0,+ pbsCount: 0,+ pmgCount: 0,+ truenasCount: 0,+ truenasAvailable: true,+ });++ dispose();+ });++ it('derives platform connection counts from the shared infrastructure settings state', () => {+ const { hookState, dispose } = mountHook([], {+ pveCount: 1,+ pbsCount: 2,+ pmgCount: 3,+ truenasConnections: [{ id: 'truenas-1' }, { id: 'truenas-2' }],+ });++ const panelProps = hookState.getInfrastructurePanelProps();++ expect(panelProps.platformConnectionsSummary()).toEqual({+ pveCount: 1,+ pbsCount: 2,+ pmgCount: 3,+ truenasCount: 2,+ truenasAvailable: true,+ });dispose();});diff --git a/frontend-modern/src/components/Settings/proxmoxSettingsModel.ts b/frontend-modern/src/components/Settings/proxmoxSettingsModel.tsindex 974eea437c..19a577cbe9 100644--- a/frontend-modern/src/components/Settings/proxmoxSettingsModel.ts+++ b/frontend-modern/src/components/Settings/proxmoxSettingsModel.ts@@ -8,10 +8,19 @@ import type {DiscoveryScanStatus,NodeType,} from './infrastructureSettingsModel';+import type { TrueNASSettingsPanelState } from './useTrueNASSettingsPanelState';export type DiscoveryMode = 'auto' | 'custom';-export interface ProxmoxSettingsPanelProps {+export interface PlatformConnectionsSummary {+ pveCount: number;+ pbsCount: number;+ pmgCount: number;+ truenasCount: number;+ truenasAvailable: boolean;+}++export interface InfrastructurePlatformSettingsProps {selectedAgent: Accessor<NodeType>;onSelectAgent: (agent: NodeType) => void;initialLoadComplete: Accessor<boolean>;@@ -27,6 +36,8 @@ export interface ProxmoxSettingsPanelProps {pveNodes: Accessor<NodeConfigWithStatus[]>;pbsNodes: Accessor<NodeConfigWithStatus[]>;pmgNodes: Accessor<NodeConfigWithStatus[]>;+ trueNASSettings: TrueNASSettingsPanelState;+ platformConnectionsSummary: Accessor<PlatformConnectionsSummary>;temperatureMonitoringEnabled: Accessor<boolean>;triggerDiscoveryScan: (options?: { quiet?: boolean }) => Promise<void>;loadDiscoveredNodes: () => Promise<void>;diff --git a/frontend-modern/src/components/Settings/settingsPanelRegistryContext.tsx b/frontend-modern/src/components/Settings/settingsPanelRegistryContext.tsxindex ec0284e353..65204db191 100644--- a/frontend-modern/src/components/Settings/settingsPanelRegistryContext.tsx+++ b/frontend-modern/src/components/Settings/settingsPanelRegistryContext.tsx@@ -5,7 +5,7 @@ import { AICostDashboard } from '@/components/AI/AICostDashboard';import { AISettings } from './AISettings';import { ProLicensePanel } from './ProLicensePanel';import { SSOProvidersPanel } from './SSOProvidersPanel';-import type { ProxmoxSettingsPanelProps } from './proxmoxSettingsModel';+import type { InfrastructurePlatformSettingsProps } from './proxmoxSettingsModel';import type { SettingsPanelRegistryContext } from './settingsPanelRegistry';import type { SettingsSystemPanels } from './useSettingsSystemPanels';@@ -26,7 +26,7 @@ export interface UseSettingsPanelRegistryParams {savingHideLocalLogin: Accessor<boolean>;handleHideLocalLoginChange: (enabled: boolean) => Promise<void>;versionInfo: Accessor<VersionInfo | null>;- getInfrastructurePanelProps: () => ProxmoxSettingsPanelProps;+ getInfrastructurePanelProps: () => InfrastructurePlatformSettingsProps;systemPanels: SettingsSystemPanels;}diff --git a/frontend-modern/src/components/Settings/useInfrastructureSettingsState.ts b/frontend-modern/src/components/Settings/useInfrastructureSettingsState.tsindex 1aa350a924..47c902ba4f 100644--- a/frontend-modern/src/components/Settings/useInfrastructureSettingsState.ts+++ b/frontend-modern/src/components/Settings/useInfrastructureSettingsState.ts@@ -4,6 +4,7 @@ import type { EventDataMap, EventType } from '@/stores/events';import type { SettingsTab } from './settingsTypes';import { useInfrastructureConfiguredNodesState } from './useInfrastructureConfiguredNodesState';import { useInfrastructureDiscoveryRuntimeState } from './useInfrastructureDiscoveryRuntimeState';+import { useTrueNASSettingsPanelState } from './useTrueNASSettingsPanelState';export type {DiscoveryScanStatus,@@ -75,6 +76,7 @@ export function useInfrastructureSettingsState({savingTemperatureSetting,setSavingTemperatureSetting,});+ const trueNASSettings = useTrueNASSettingsPanelState();const discoveryRuntime = useInfrastructureDiscoveryRuntimeState({eventBus,@@ -153,6 +155,7 @@ export function useInfrastructureSettingsState({return {initialLoadComplete,+ trueNASSettings,...configuredNodes,...discoveryRuntime,};diff --git a/frontend-modern/src/components/Settings/useProxmoxDirectWorkspaceState.ts b/frontend-modern/src/components/Settings/useProxmoxDirectWorkspaceState.tsindex 4dbe7f9df4..21c7b34141 100644--- a/frontend-modern/src/components/Settings/useProxmoxDirectWorkspaceState.ts+++ b/frontend-modern/src/components/Settings/useProxmoxDirectWorkspaceState.ts@@ -5,10 +5,10 @@ import {getProxmoxVariantPresentation,} from '@/utils/proxmoxSettingsPresentation';import type { NodeConfig, NodeConfigWithStatus } from '@/types/nodes';-import type { ProxmoxSettingsPanelProps } from './proxmoxSettingsModel';import type { DiscoveredServer, NodeType } from './infrastructureSettingsModel';+import type { InfrastructurePlatformSettingsProps } from './proxmoxSettingsModel';-export function useProxmoxDirectWorkspaceState(props: ProxmoxSettingsPanelProps) {+export function useProxmoxDirectWorkspaceState(props: InfrastructurePlatformSettingsProps) {const [prefillNode, setPrefillNode] = createSignal<Partial<NodeConfig> | null>(null);const activeAgent = () => props.selectedAgent();diff --git a/frontend-modern/src/components/Settings/useSettingsInfrastructurePanelProps.ts b/frontend-modern/src/components/Settings/useSettingsInfrastructurePanelProps.tsindex 6292a5ccf0..e0e3bf6d35 100644--- a/frontend-modern/src/components/Settings/useSettingsInfrastructurePanelProps.ts+++ b/frontend-modern/src/components/Settings/useSettingsInfrastructurePanelProps.ts@@ -3,7 +3,7 @@ import type { SecurityStatus as SecurityStatusInfo } from '@/types/config';import type { Resource } from '@/types/resource';import { pbsInstanceFromResource, pmgInstanceFromResource } from '@/utils/resourceStateAdapters';import type { NodeType } from './infrastructureSettingsModel';-import type { ProxmoxSettingsPanelProps } from './proxmoxSettingsModel';+import type { InfrastructurePlatformSettingsProps } from './proxmoxSettingsModel';import type { useDiscoverySettingsState } from './useDiscoverySettingsState';import type { useInfrastructureSettingsState } from './useInfrastructureSettingsState';import type { useSystemSettingsState } from './useSystemSettingsState';@@ -37,7 +37,15 @@ export function useSettingsInfrastructurePanelProps(.filter((instance): instance is NonNullable<typeof instance> => Boolean(instance)),);- const getInfrastructurePanelProps = (): ProxmoxSettingsPanelProps => ({+ const platformConnectionsSummary = createMemo(() => ({+ pveCount: params.infrastructureSettings.pveNodes().length,+ pbsCount: params.infrastructureSettings.pbsNodes().length,+ pmgCount: params.infrastructureSettings.pmgNodes().length,+ truenasCount: params.infrastructureSettings.trueNASSettings.connections().length,+ truenasAvailable: !params.infrastructureSettings.trueNASSettings.featureDisabled(),+ }));++ const getInfrastructurePanelProps = (): InfrastructurePlatformSettingsProps => ({selectedAgent: params.selectedAgent,onSelectAgent: params.onSelectAgent,initialLoadComplete: params.infrastructureSettings.initialLoadComplete,@@ -53,6 +61,8 @@ export function useSettingsInfrastructurePanelProps(pveNodes: params.infrastructureSettings.pveNodes,pbsNodes: params.infrastructureSettings.pbsNodes,pmgNodes: params.infrastructureSettings.pmgNodes,+ trueNASSettings: params.infrastructureSettings.trueNASSettings,+ platformConnectionsSummary,temperatureMonitoringEnabled: params.systemSettings.temperatureMonitoringEnabled,triggerDiscoveryScan: params.infrastructureSettings.triggerDiscoveryScan,loadDiscoveredNodes: params.infrastructureSettings.loadDiscoveredNodes,diff --git a/frontend-modern/src/components/Settings/useTrueNASSettingsPanelState.ts b/frontend-modern/src/components/Settings/useTrueNASSettingsPanelState.tsindex 881e0f5711..69831af028 100644--- a/frontend-modern/src/components/Settings/useTrueNASSettingsPanelState.ts+++ b/frontend-modern/src/components/Settings/useTrueNASSettingsPanelState.ts@@ -312,4 +312,6 @@ export function useTrueNASSettingsPanelState() {};}+export type TrueNASSettingsPanelState = ReturnType<typeof useTrueNASSettingsPanelState>;+export default useTrueNASSettingsPanelState;diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.tsindex 1748cb152b..39b9196b56 100644--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts@@ -3414,7 +3414,9 @@ describe('frontend resource type boundaries', () => {expect(proxmoxConfiguredNodesTableSource).toContain('PbsNodesTable');expect(proxmoxConfiguredNodesTableSource).toContain('PmgNodesTable');expect(proxmoxNodeModalStackSource).toContain('PROXMOX_NODE_TYPES');- expect(proxmoxSettingsModelSource).toContain('export interface ProxmoxSettingsPanelProps');+ expect(proxmoxSettingsModelSource).toContain(+ 'export interface InfrastructurePlatformSettingsProps',+ );expect(proxmoxDirectWorkspaceStateSource).toContain('export function useProxmoxDirectWorkspaceState',);diff --git a/tests/integration/tests/21-truenas-settings-platform-connections.spec.ts b/tests/integration/tests/21-truenas-settings-platform-connections.spec.tsindex 0bf3a75a67..d28e3e3dad 100644--- a/tests/integration/tests/21-truenas-settings-platform-connections.spec.ts+++ b/tests/integration/tests/21-truenas-settings-platform-connections.spec.ts@@ -17,6 +17,13 @@ const SCREENSHOT_PATH = path.resolve('tmp','truenas-settings-platform-connections.png',);+const OPERATIONS_SCREENSHOT_PATH = path.resolve(+ __dirname,+ '..',+ '..',+ 'tmp',+ 'truenas-settings-operations-summary.png',+);const test = base.extend<{}, WorkerFixtures>({storageState: async ({ authStorageStatePath }, use) => {@@ -117,4 +124,133 @@ test.describe('TrueNAS platform connections settings', () => {fs.mkdirSync(path.dirname(SCREENSHOT_PATH), { recursive: true });await page.screenshot({ path: SCREENSHOT_PATH, fullPage: true });});++ test('counts TrueNAS alongside the other platform connections on the operations summary', async ({+ page,+ }) => {+ await page.route('**/api/config/nodes', async (route) => {+ if (route.request().method() !== 'GET') {+ await route.continue();+ return;+ }++ await route.fulfill({+ status: 200,+ contentType: 'application/json',+ body: JSON.stringify([+ {+ id: 'pve-1',+ type: 'pve',+ name: 'pve-main',+ host: 'pve-main.local',+ user: 'root@pam',+ verifySSL: true,+ monitorVMs: true,+ monitorContainers: true,+ monitorStorage: true,+ monitorBackups: true,+ monitorPhysicalDisks: true,+ status: 'connected',+ },+ {+ id: 'pbs-1',+ type: 'pbs',+ name: 'pbs-main',+ host: 'pbs-main.local',+ user: 'root@pam',+ verifySSL: true,+ monitorDatastores: true,+ monitorSyncJobs: true,+ monitorVerifyJobs: true,+ monitorPruneJobs: true,+ monitorGarbageJobs: true,+ status: 'connected',+ },+ {+ id: 'pbs-2',+ type: 'pbs',+ name: 'pbs-vault',+ host: 'pbs-vault.local',+ user: 'root@pam',+ verifySSL: true,+ monitorDatastores: true,+ monitorSyncJobs: true,+ monitorVerifyJobs: true,+ monitorPruneJobs: true,+ monitorGarbageJobs: true,+ status: 'connected',+ },+ {+ id: 'pmg-1',+ type: 'pmg',+ name: 'pmg-main',+ host: 'pmg-main.local',+ user: 'root@pam',+ verifySSL: true,+ monitorMailStats: true,+ monitorQueues: true,+ monitorQuarantine: true,+ monitorDomainStats: true,+ status: 'connected',+ },+ ]),+ });+ });++ await page.route('**/api/truenas/connections', async (route) => {+ if (route.request().method() !== 'GET') {+ await route.continue();+ return;+ }++ await route.fulfill({+ status: 200,+ contentType: 'application/json',+ body: JSON.stringify([+ {+ id: 'truenas-1',+ name: 'Tower NAS',+ host: 'tower.local',+ port: 443,+ apiKey: '********',+ useHttps: true,+ insecureSkipVerify: false,+ enabled: true,+ },+ {+ id: 'truenas-2',+ name: 'Backup Vault',+ host: 'vault.local',+ port: 443,+ apiKey: '********',+ useHttps: true,+ insecureSkipVerify: false,+ enabled: true,+ },+ ]),+ });+ });++ await page.goto('/settings/infrastructure/operations', {+ waitUntil: 'domcontentloaded',+ });+ await page.waitForURL(/\/settings\/infrastructure\/operations/, {+ timeout: 15_000,+ });++ await expect(+ page.getByRole('heading', { level: 1, name: 'Infrastructure Operations' }),+ ).toBeVisible();+ await expect(page.getByRole('heading', { level: 3, name: 'Platform connections' })).toBeVisible();+ await expect(page.getByTestId('platform-connections-pve')).toContainText('1');+ await expect(page.getByTestId('platform-connections-pbs')).toContainText('2');+ await expect(page.getByTestId('platform-connections-pmg')).toContainText('1');+ await expect(page.getByTestId('platform-connections-truenas')).toContainText('2');+ await expect(page.getByTestId('platform-connections-truenas')).toContainText(+ 'API-backed NAS connections',+ );++ fs.mkdirSync(path.dirname(OPERATIONS_SCREENSHOT_PATH), { recursive: true });+ await page.screenshot({ path: OPERATIONS_SCREENSHOT_PATH, fullPage: true });+ });});