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(settings): treat truenas as platform-managed reporting

rcourtman0031105e43d6
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index abf63b3004..f5be31e993 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -255,6 +255,14 @@ and export audit reads alongside the enterprise audit surface. That read path
belongs to the API and unified-resource contracts, not to lifecycle ownership,
so the agent-install and registration lane stays focused on fleet continuity
instead of adopting execution-history persistence as a side effect.
+The connected-infrastructure reporting workspace also now treats API-backed
+platform surfaces as platform-connection-managed capabilities, not host-managed
+agent extensions. `frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx`,
+`InfrastructureActiveRowDetails.tsx`, and `useInfrastructureReportingState.tsx`
+must keep Proxmox, PBS, PMG, and TrueNAS on the shared Platform connections
+path, while only machine-installed agent, Docker, and Kubernetes surfaces
+participate in host stop-monitoring scope, uninstall commands, and upgrade
+actions.
Those unified audit list endpoints also clamp oversized `limit` requests to
the governed maximum, so audit history stays bounded even when callers ask
for arbitrarily large pages.
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index 69e2ceb897..1669917042 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -228,6 +228,17 @@ Own canonical runtime payload shapes between backend and frontend.
operators can receive the first success handoff without typing a hostname
or agent ID.
20. Keep the shared first-run install-token transport explicit on
+21. Keep connected-infrastructure surface vocabulary canonical across the
+ shared `/api/state` and reporting/install consumers: `frontend-modern/src/types/api.ts`
+ must treat `truenas` as a first-class connected-infrastructure surface kind,
+ and connected-infrastructure consumers such as
+ `frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx`
+ and
+ `frontend-modern/src/components/Settings/useInfrastructureReportingState.tsx`
+ must preserve the transport distinction between machine-managed surfaces
+ (`agent`, `docker`, `kubernetes`) and platform-connections-managed
+ surfaces (`proxmox`, `pbs`, `pmg`, `truenas`) instead of collapsing them
+ into one uninstall/stop-monitoring model.
`/api/security/tokens` as used by
`frontend-modern/src/components/Settings/useInfrastructureInstallState.tsx`:
once quick setup has produced the setup handoff credentials, the canonical
@@ -2062,3 +2073,13 @@ on its empty-list payload once AI is enabled, even when the first enablement
happens after process startup. A post-boot settings save may not leave that
surface on `503 Approval store not initialized` just because the direct AI
runtime had not previously started.
+That same shared infrastructure-settings API contract now also owns the
+connected-infrastructure distinction between machine-managed and
+platform-connections-managed reporting. `frontend-modern/src/types/api.ts`,
+`frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx`,
+and `frontend-modern/src/components/Settings/useInfrastructureReportingState.tsx`
+must treat `truenas` as a canonical connected-infrastructure surface kind
+alongside `proxmox`, `pbs`, and `pmg`, and the settings reporting/install
+surfaces must keep those platform-managed rows navigable back to platform
+connections instead of presenting host uninstall or stop-monitoring actions
+that only apply to `agent`, `docker`, and `kubernetes`.
diff --git a/docs/release-control/v6/internal/subsystems/monitoring.md b/docs/release-control/v6/internal/subsystems/monitoring.md
index 95c78a3cf4..3b5bfd1960 100644
--- a/docs/release-control/v6/internal/subsystems/monitoring.md
+++ b/docs/release-control/v6/internal/subsystems/monitoring.md
@@ -258,6 +258,15 @@ telemetry. `internal/truenas/client.go`, `internal/truenas/provider.go`, and
`/api/current` JSON-RPC websocket transport, project those readings onto the
canonical `app-container` metrics contract, and sync them into the existing
guest metrics-history/store path. Pulse must not add a TrueNAS-only charts
+lane for that telemetry.
+That same monitoring boundary now also owns connected-infrastructure
+projection for API-backed platforms. `internal/monitoring/connected_infrastructure.go`
+must project TrueNAS into the canonical connected-infrastructure surface list,
+carry TrueNAS hostname/version through the shared top-level system grouping,
+and preserve platform-managed surfaces such as `proxmox`, `pbs`, `pmg`, and
+`truenas` when host telemetry is ignored. Ignore/remove semantics on that
+surface remain machine-scoped and may only strip the local `agent`, `docker`,
+and `kubernetes` reporting surfaces from the grouped row.
path or treat API-backed app workloads as second-class compared with native
Docker reports.
That same boundary now also owns native host-history fallback for API-backed
diff --git a/frontend-modern/src/components/Settings/InfrastructureActiveRowDetails.tsx b/frontend-modern/src/components/Settings/InfrastructureActiveRowDetails.tsx
index 11f90fdc8d..75ee8f19c9 100644
--- a/frontend-modern/src/components/Settings/InfrastructureActiveRowDetails.tsx
+++ b/frontend-modern/src/components/Settings/InfrastructureActiveRowDetails.tsx
@@ -1,5 +1,6 @@
import type { Accessor, Component } from 'solid-js';
import { For, Show } from 'solid-js';
+import { useNavigate } from '@solidjs/router';
import { copyToClipboard } from '@/utils/clipboard';
import { formatAbsoluteTime, formatRelativeTime } from '@/utils/format';
import { notificationStore } from '@/stores/notifications';
@@ -13,7 +14,9 @@ import {
} from '@/utils/unifiedAgentInventoryPresentation';
import {
createSurfaceScopedRow,
+ getPlatformConnectionsPathForCapability,
getRowSurfaceBreakdown,
+ hasMachineInstallActions,
type UnifiedAgentRow,
} from './infrastructureOperationsModel';
import { useInfrastructureOperationsContext } from './useInfrastructureOperationsState';
@@ -26,6 +29,7 @@ export const InfrastructureActiveRowDetails: Component<InfrastructureActiveRowDe
props,
) => {
const state = useInfrastructureOperationsContext();
+ const navigate = useNavigate();
const row = () => props.rowAccessor();
const isKubernetes = () =>
row().capabilities.includes('kubernetes') && !row().capabilities.includes('agent');
@@ -36,6 +40,7 @@ export const InfrastructureActiveRowDetails: Component<InfrastructureActiveRowDe
resolvedAgentId() ? Boolean(state.pendingScopeUpdates()[resolvedAgentId()]) : false;
const agentName = () => row().displayName || row().hostname || row().name;
const surfaces = () => getRowSurfaceBreakdown(row());
+ const hasLocalMachineActions = () => hasMachineInstallActions(row()) || Boolean(row().isOutdatedBinary);
return (
<div id={`agent-details-${row().rowKey}`} class="flex h-full flex-col overflow-y-auto">
@@ -296,7 +301,28 @@ export const InfrastructureActiveRowDetails: Component<InfrastructureActiveRowDe
surface.key === 'agent' ||
surface.key === 'kubernetes'
}
- fallback={<span class="text-[11px] text-muted">Managed with host telemetry</span>}
+ fallback={
+ <Show
+ when={getPlatformConnectionsPathForCapability(surface.kind)}
+ fallback={
+ <span class="text-[11px] text-muted">Managed by this reporting item</span>
+ }
+ >
+ {(path) => (
+ <button
+ type="button"
+ data-row-action
+ onClick={(event) => {
+ event.stopPropagation();
+ navigate(path());
+ }}
+ class="inline-flex min-h-9 items-center rounded-md px-2.5 py-1.5 text-xs font-medium text-blue-600 hover:bg-blue-50 hover:text-blue-900 dark:text-blue-400 dark:hover:bg-blue-900 dark:hover:text-blue-300"
+ >
+ Open platform connections
+ </button>
+ )}
+ </Show>
+ }
>
<button
type="button"
@@ -323,49 +349,51 @@ export const InfrastructureActiveRowDetails: Component<InfrastructureActiveRowDe
</div>
</Show>
- <div class="rounded-lg border border-border bg-surface-alt px-4 py-4">
- <div class="text-xs font-semibold uppercase tracking-wide text-muted">Machine actions</div>
- <div class="mt-2 text-xs text-muted">Machine-level utilities.</div>
- <div class="mt-4 flex flex-col gap-2">
- <Show when={!isKubernetes()}>
- <button
- type="button"
- onClick={async () => {
- const success = await copyToClipboard(
- state.getPlatformUninstallCommand(row().upgradePlatform, row()),
- );
- if (success) {
- notificationStore.success(getUnifiedAgentClipboardCopySuccessMessage());
- } else {
- notificationStore.error(getUnifiedAgentClipboardCopyErrorMessage());
- }
- }}
- class="rounded-md border border-border px-3 py-2 text-left text-xs text-slate-600 hover:bg-surface hover:text-base-content"
- >
- Copy uninstall command
- </button>
- </Show>
- <Show when={row().isOutdatedBinary}>
- <button
- type="button"
- onClick={async () => {
- const success = await copyToClipboard(state.getUpgradeCommand(row()));
- if (success) {
- notificationStore.success(getUnifiedAgentClipboardCopySuccessMessage());
- } else {
- notificationStore.error(getUnifiedAgentClipboardCopyErrorMessage());
- }
- }}
- class="rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-left text-xs text-amber-700 hover:bg-amber-100 hover:text-amber-900 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-300 dark:hover:bg-amber-900/60 dark:hover:text-amber-200"
- >
- Copy upgrade command
- </button>
- </Show>
- <div class="rounded-md border border-blue-200 bg-blue-50 px-3 py-3 text-xs text-blue-900 dark:border-blue-800 dark:bg-blue-950/40 dark:text-blue-100">
- Use surface controls above to stop reporting without uninstalling.
+ <Show when={hasLocalMachineActions()}>
+ <div class="rounded-lg border border-border bg-surface-alt px-4 py-4">
+ <div class="text-xs font-semibold uppercase tracking-wide text-muted">Machine actions</div>
+ <div class="mt-2 text-xs text-muted">Machine-level utilities.</div>
+ <div class="mt-4 flex flex-col gap-2">
+ <Show when={!isKubernetes() && hasMachineInstallActions(row())}>
+ <button
+ type="button"
+ onClick={async () => {
+ const success = await copyToClipboard(
+ state.getPlatformUninstallCommand(row().upgradePlatform, row()),
+ );
+ if (success) {
+ notificationStore.success(getUnifiedAgentClipboardCopySuccessMessage());
+ } else {
+ notificationStore.error(getUnifiedAgentClipboardCopyErrorMessage());
+ }
+ }}
+ class="rounded-md border border-border px-3 py-2 text-left text-xs text-slate-600 hover:bg-surface hover:text-base-content"
+ >
+ Copy uninstall command
+ </button>
+ </Show>
+ <Show when={row().isOutdatedBinary}>
+ <button
+ type="button"
+ onClick={async () => {
+ const success = await copyToClipboard(state.getUpgradeCommand(row()));
+ if (success) {
+ notificationStore.success(getUnifiedAgentClipboardCopySuccessMessage());
+ } else {
+ notificationStore.error(getUnifiedAgentClipboardCopyErrorMessage());
+ }
+ }}
+ class="rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-left text-xs text-amber-700 hover:bg-amber-100 hover:text-amber-900 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-300 dark:hover:bg-amber-900/60 dark:hover:text-amber-200"
+ >
+ Copy upgrade command
+ </button>
+ </Show>
+ <div class="rounded-md border border-blue-200 bg-blue-50 px-3 py-3 text-xs text-blue-900 dark:border-blue-800 dark:bg-blue-950/40 dark:text-blue-100">
+ Use surface controls above to stop reporting without uninstalling.
+ </div>
</div>
</div>
- </div>
+ </Show>
</div>
</div>
);
diff --git a/frontend-modern/src/components/Settings/InfrastructureInventorySection.tsx b/frontend-modern/src/components/Settings/InfrastructureInventorySection.tsx
index 80268c728a..837b65f8b6 100644
--- a/frontend-modern/src/components/Settings/InfrastructureInventorySection.tsx
+++ b/frontend-modern/src/components/Settings/InfrastructureInventorySection.tsx
@@ -25,7 +25,7 @@ export const InfrastructureInventorySection: Component = () => {
<SettingsPanel
title="Reporting now"
- description="Hosts and runtimes currently checking in to Pulse."
+ description="Systems, platforms, and runtimes currently checking in to Pulse."
icon={<Users class="h-5 w-5" strokeWidth={2} />}
bodyClass="space-y-4"
>
@@ -33,7 +33,7 @@ export const InfrastructureInventorySection: Component = () => {
<p class="text-sm font-medium text-base-content">{state.reportingCoverageSummaryText()}</p>
<p class="mt-2 text-xs text-muted">
This workspace does not list every asset Pulse has discovered. It focuses on systems
- and runtimes that are actively checking in right now.
+ plus platform-integrated runtimes that are actively checking in right now.
</p>
</div>
@@ -138,6 +138,7 @@ export const InfrastructureInventorySection: Component = () => {
<option value="proxmox">Proxmox</option>
<option value="pbs">PBS</option>
<option value="pmg">PMG</option>
+ <option value="truenas">TrueNAS</option>
</select>
</div>
<div class="space-y-1">
diff --git a/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsController.test.tsx b/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsController.test.tsx
index 4d7f06b89e..384afa4f8d 100644
--- a/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsController.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsController.test.tsx
@@ -1039,7 +1039,9 @@ describe('InfrastructureOperationsController managed agents table', () => {
await waitFor(() => {
expect(screen.getAllByText('Reporting now').length).toBeGreaterThan(0);
});
- expect(screen.getByText(/Hosts and runtimes currently checking in to Pulse\./i)).toBeInTheDocument();
+ expect(
+ screen.getByText(/Systems, platforms, and runtimes currently checking in to Pulse\./i),
+ ).toBeInTheDocument();
expect(screen.getByText('Reporting surfaces')).toBeInTheDocument();
expect(screen.getAllByText('Test Server').length).toBeGreaterThan(0);
@@ -1222,11 +1224,61 @@ describe('InfrastructureOperationsController managed agents table', () => {
expect(details.getByText('Docker runtime ID')).toBeInTheDocument();
expect(details.getByText('Node ID')).toBeInTheDocument();
expect(details.getAllByText('delly-resource').length).toBeGreaterThan(0);
- expect(details.getByText('Managed with host telemetry')).toBeInTheDocument();
+ expect(
+ details.getByRole('button', { name: /Open platform connections/i }),
+ ).toBeInTheDocument();
expect(details.getAllByText('delly-agent').length).toBeGreaterThan(0);
expect(details.getAllByText('delly-docker').length).toBeGreaterThan(0);
});
+ it('routes api-backed truenas rows to platform connections instead of machine uninstall actions', async () => {
+ setupWithResources([], [
+ {
+ id: 'truenas-main',
+ name: 'Tower NAS',
+ displayName: 'Tower NAS',
+ hostname: 'truenas.local',
+ status: 'active',
+ healthStatus: 'online',
+ lastSeen: Date.now(),
+ version: '25.04.0',
+ upgradePlatform: 'linux',
+ surfaces: [
+ {
+ id: 'truenas:truenas.local',
+ kind: 'truenas',
+ label: 'TrueNAS data',
+ detail:
+ 'System, storage, app, and recovery telemetry polled through the configured TrueNAS connection.',
+ idLabel: 'Hostname',
+ idValue: 'truenas.local',
+ },
+ ],
+ },
+ ]);
+
+ await waitFor(() => {
+ expect(screen.getAllByText('Reporting now').length).toBeGreaterThan(0);
+ });
+
+ expect(screen.getByText(/1 TrueNAS system/i)).toBeInTheDocument();
+ fireEvent.click(screen.getByRole('button', { name: /details for Tower NAS/i }));
+
+ const detailsRow = document.getElementById('agent-details-agent-truenas-main');
+ expect(detailsRow).not.toBeNull();
+ const details = within(detailsRow as HTMLElement);
+
+ expect(details.queryByText('Machine actions')).not.toBeInTheDocument();
+ expect(details.queryByRole('button', { name: /Copy uninstall command/i })).not.toBeInTheDocument();
+
+ const openPlatformConnectionsButton = details.getByRole('button', {
+ name: /Open platform connections/i,
+ });
+ fireEvent.click(openPlatformConnectionsButton);
+
+ expect(navigateMock).toHaveBeenCalledWith('/settings/infrastructure/platforms/truenas');
+ });
+
it('distinguishes PBS coverage from Proxmox nodes on non-Proxmox hosts', async () => {
setupWithResources(
[
@@ -1579,7 +1631,7 @@ describe('InfrastructureOperationsController managed agents table', () => {
expect(screen.getByText('Stop monitoring?')).toBeInTheDocument();
expect(
- screen.getByText(/Host telemetry, Docker runtime data, and Proxmox data will stop in Pulse/i),
+ screen.getByText(/Host telemetry and Docker runtime data will stop in Pulse/i),
).toBeInTheDocument();
expect(screen.getByText('Pulse will stop these reporting surfaces')).toBeInTheDocument();
expect(screen.getAllByText('Host telemetry').length).toBeGreaterThan(0);
diff --git a/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx b/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx
index 16d6ee1ef7..ff8ed5079e 100644
--- a/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx
@@ -1,6 +1,8 @@
import { describe, expect, it } from 'vitest';
import type { ConnectedInfrastructureItem } from '@/types/api';
import {
+ getPlatformConnectionsPathForCapability,
+ hasMachineInstallActions,
getPowerShellInstallProfileEnvFromFlags,
getStopMonitoringScopeLabel,
rowFromConnectedInfrastructureItem,
@@ -91,7 +93,41 @@ describe('infrastructure operations model', () => {
],
};
- expect(getStopMonitoringScopeLabel(row)).toBe('Host telemetry, Docker runtime data, and PBS data');
+ expect(getStopMonitoringScopeLabel(row)).toBe('Host telemetry and Docker runtime data');
+ });
+
+ it('treats truenas surfaces as platform-managed items instead of machine installs', () => {
+ const item: ConnectedInfrastructureItem = {
+ id: 'truenas-main',
+ name: 'Tower NAS',
+ hostname: 'truenas.local',
+ status: 'active',
+ version: '25.04.0',
+ surfaces: [
+ {
+ id: 'truenas:truenas.local',
+ kind: 'truenas',
+ label: 'TrueNAS data',
+ detail:
+ 'System, storage, app, and recovery telemetry polled through the configured TrueNAS connection.',
+ idLabel: 'Hostname',
+ idValue: 'truenas.local',
+ },
+ ],
+ };
+
+ const row = rowFromConnectedInfrastructureItem(item, {
+ label: 'N/A',
+ detail: '',
+ category: 'na',
+ });
+
+ expect(row.capabilities).toEqual(['truenas']);
+ expect(row.installFlags).toEqual([]);
+ expect(hasMachineInstallActions(row)).toBe(false);
+ expect(getPlatformConnectionsPathForCapability('truenas')).toBe(
+ '/settings/infrastructure/platforms/truenas',
+ );
});
it('maps install-profile flags into PowerShell installer env assignments', () => {
diff --git a/frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx b/frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx
index c17bd2b52e..6d048f01c5 100644
--- a/frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx
+++ b/frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx
@@ -7,6 +7,10 @@ import {
getAgentCapabilityLabel,
type AgentCapability,
} from '@/utils/agentCapabilityPresentation';
+import {
+ buildPlatformConnectionsPath,
+ type PlatformConnectionsView,
+} from './platformConnectionsModel';
export const TOKEN_PLACEHOLDER = '<api-token>';
export const UNIFIED_AGENT_TELEMETRY_SURFACE = 'settings_unified_agents';
@@ -138,6 +142,8 @@ export const getCapabilitySurfaceLabel = (capability: AgentCapability) => {
return 'PBS data';
case 'pmg':
return 'PMG data';
+ case 'truenas':
+ return 'TrueNAS data';
default:
return getAgentCapabilityLabel(capability);
}
@@ -186,11 +192,35 @@ export const getStopMonitoringSurfaces = (row: UnifiedAgentRow) => {
if (!hostManagedStopApplies) {
return stopMonitoringSurfaces;
}
- return surfaces.filter((surface) =>
- ['agent', 'docker', 'kubernetes', 'proxmox', 'pbs', 'pmg'].includes(surface.kind),
- );
+ return surfaces.filter((surface) => ['agent', 'docker', 'kubernetes'].includes(surface.kind));
+};
+
+export const isPlatformConnectionsCapability = (capability: AgentCapability) =>
+ ['proxmox', 'pbs', 'pmg', 'truenas'].includes(capability);
+
+export const getPlatformConnectionsViewForCapability = (
+ capability: AgentCapability,
+): PlatformConnectionsView | null => {
+ switch (capability) {
+ case 'proxmox':
+ case 'pbs':
+ case 'pmg':
+ return 'proxmox';
+ case 'truenas':
+ return 'truenas';
+ default:
+ return null;
+ }
};
+export const getPlatformConnectionsPathForCapability = (capability: AgentCapability) => {
+ const view = getPlatformConnectionsViewForCapability(capability);
+ return view ? buildPlatformConnectionsPath(view) : null;
+};
+
+export const hasMachineInstallActions = (row: UnifiedAgentRow) =>
+ Boolean(row.agentActionId?.trim() || row.agentId?.trim());
+
export const getStopMonitoringScopeLabel = (row: UnifiedAgentRow) => {
const surfaceLabels = getStopMonitoringSurfaces(row).map((surface) => surface.label);
if (surfaceLabels.length === 0) {
@@ -229,9 +259,8 @@ export const createSurfaceScopedRow = (
if (surfaceKey === 'agent') {
const hostManagedCapabilities: AgentCapability[] = ['agent'];
- if (row.capabilities.includes('proxmox')) hostManagedCapabilities.push('proxmox');
- if (row.capabilities.includes('pbs')) hostManagedCapabilities.push('pbs');
- if (row.capabilities.includes('pmg')) hostManagedCapabilities.push('pmg');
+ if (row.capabilities.includes('docker')) hostManagedCapabilities.push('docker');
+ if (row.capabilities.includes('kubernetes')) hostManagedCapabilities.push('kubernetes');
return {
...row,
rowKey: `${row.rowKey}-agent-surface`,
@@ -239,7 +268,7 @@ export const createSurfaceScopedRow = (
dockerActionId: undefined,
kubernetesActionId: undefined,
surfaces: row.surfaces.filter((surface) =>
- ['agent', 'proxmox', 'pbs', 'pmg'].includes(surface.kind),
+ ['agent', 'docker', 'kubernetes'].includes(surface.kind),
),
};
}
@@ -413,6 +442,7 @@ const agentCapabilityFromSurfaceKind = (kind: ConnectedInfrastructureSurface['ki
case 'proxmox':
case 'pbs':
case 'pmg':
+ case 'truenas':
return kind;
default:
return 'agent';
diff --git a/frontend-modern/src/components/Settings/useInfrastructureReportingState.tsx b/frontend-modern/src/components/Settings/useInfrastructureReportingState.tsx
index 673dbaa1a1..953b60afb9 100644
--- a/frontend-modern/src/components/Settings/useInfrastructureReportingState.tsx
+++ b/frontend-modern/src/components/Settings/useInfrastructureReportingState.tsx
@@ -546,6 +546,7 @@ export const useInfrastructureReportingState = () => {
proxmox: active.filter((row) => row.capabilities.includes('proxmox')).length,
pbs: active.filter((row) => row.capabilities.includes('pbs')).length,
pmg: active.filter((row) => row.capabilities.includes('pmg')).length,
+ truenas: active.filter((row) => row.capabilities.includes('truenas')).length,
};
});
@@ -564,6 +565,9 @@ export const useInfrastructureReportingState = () => {
: null,
summary.pbs > 0 ? `${summary.pbs} PBS server${summary.pbs === 1 ? '' : 's'}` : null,
summary.pmg > 0 ? `${summary.pmg} PMG server${summary.pmg === 1 ? '' : 's'}` : null,
+ summary.truenas > 0
+ ? `${summary.truenas} TrueNAS system${summary.truenas === 1 ? '' : 's'}`
+ : null,
].filter((value): value is string => Boolean(value));
if (activeClauses.length === 0) {
diff --git a/frontend-modern/src/types/api.ts b/frontend-modern/src/types/api.ts
index 5fbba74e34..1a32886ef2 100644
--- a/frontend-modern/src/types/api.ts
+++ b/frontend-modern/src/types/api.ts
@@ -32,7 +32,7 @@ export interface State {
export interface ConnectedInfrastructureSurface {
id: string;
- kind: 'agent' | 'docker' | 'kubernetes' | 'proxmox' | 'pbs' | 'pmg';
+ kind: 'agent' | 'docker' | 'kubernetes' | 'proxmox' | 'pbs' | 'pmg' | 'truenas';
label: string;
detail?: string;
controlId?: string;
diff --git a/frontend-modern/src/utils/__tests__/agentCapabilityPresentation.test.ts b/frontend-modern/src/utils/__tests__/agentCapabilityPresentation.test.ts
index 9c97f5a809..509419e35d 100644
--- a/frontend-modern/src/utils/__tests__/agentCapabilityPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/agentCapabilityPresentation.test.ts
@@ -10,11 +10,13 @@ describe('agentCapabilityPresentation', () => {
expect(getAgentCapabilityLabel('docker')).toBe('Docker');
expect(getAgentCapabilityLabel('kubernetes')).toBe('Kubernetes');
expect(getAgentCapabilityLabel('proxmox')).toBe('Proxmox');
+ expect(getAgentCapabilityLabel('truenas')).toBe('TrueNAS');
});
it('uses canonical capability badge tones', () => {
expect(getAgentCapabilityBadgeClass('proxmox')).toContain('amber-100');
expect(getAgentCapabilityBadgeClass('kubernetes')).toContain('emerald-100');
expect(getAgentCapabilityBadgeClass('agent')).toContain('blue-100');
+ expect(getAgentCapabilityBadgeClass('truenas')).toContain('cyan-100');
});
});
diff --git a/frontend-modern/src/utils/agentCapabilityPresentation.ts b/frontend-modern/src/utils/agentCapabilityPresentation.ts
index cc51e02056..dcecdab44a 100644
--- a/frontend-modern/src/utils/agentCapabilityPresentation.ts
+++ b/frontend-modern/src/utils/agentCapabilityPresentation.ts
@@ -1,4 +1,11 @@
-export type AgentCapability = 'agent' | 'docker' | 'kubernetes' | 'proxmox' | 'pbs' | 'pmg';
+export type AgentCapability =
+ | 'agent'
+ | 'docker'
+ | 'kubernetes'
+ | 'proxmox'
+ | 'pbs'
+ | 'pmg'
+ | 'truenas';
export function getAgentCapabilityLabel(capability: AgentCapability): string {
switch (capability) {
@@ -14,6 +21,8 @@ export function getAgentCapabilityLabel(capability: AgentCapability): string {
return 'PBS';
case 'pmg':
return 'PMG';
+ case 'truenas':
+ return 'TrueNAS';
}
}
@@ -25,6 +34,8 @@ export function getAgentCapabilityBadgeClass(capability: AgentCapability): strin
return 'bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-300';
case 'pmg':
return 'bg-rose-100 text-rose-800 dark:bg-rose-900 dark:text-rose-300';
+ case 'truenas':
+ return 'bg-cyan-100 text-cyan-800 dark:bg-cyan-900 dark:text-cyan-300';
case 'kubernetes':
return 'bg-emerald-100 text-emerald-800 dark:bg-emerald-900 dark:text-emerald-300';
default:
diff --git a/internal/monitoring/canonical_guardrails_test.go b/internal/monitoring/canonical_guardrails_test.go
index ecff6f29c9..5fe3eaa5fa 100644
--- a/internal/monitoring/canonical_guardrails_test.go
+++ b/internal/monitoring/canonical_guardrails_test.go
@@ -79,6 +79,38 @@ func TestConnectedInfrastructureUsesSharedTopLevelSystemResolver(t *testing.T) {
}
}
+func TestConnectedInfrastructureKeepsPlatformConnectionsAndProjectsTrueNAS(t *testing.T) {
+ data, err := os.ReadFile("connected_infrastructure.go")
+ if err != nil {
+ t.Fatalf("failed to read connected_infrastructure.go: %v", err)
+ }
+ source := string(data)
+ requiredSnippets := []string{
+ `if agentSurface, ok := group.surfaces["agent"]; ok {`,
+ `if dockerSurface, ok := group.surfaces["docker"]; ok {`,
+ `if kubernetesSurface, ok := group.surfaces["kubernetes"]; ok {`,
+ `if surface, ok := connectedInfrastructureTrueNASSurface(resource); ok {`,
+ `Kind: "truenas",`,
+ `case "truenas":`,
+ }
+ for _, snippet := range requiredSnippets {
+ if !strings.Contains(source, snippet) {
+ t.Fatalf("connected_infrastructure.go must contain %q", snippet)
+ }
+ }
+
+ for _, forbidden := range []string{
+ `delete(group.surfaces, "proxmox")`,
+ `delete(group.surfaces, "pbs")`,
+ `delete(group.surfaces, "pmg")`,
+ `delete(group.surfaces, "truenas")`,
+ } {
+ if strings.Contains(source, forbidden) {
+ t.Fatalf("connected_infrastructure.go must not remove platform-managed surfaces with %q", forbidden)
+ }
+ }
+}
+
func TestLegacyMemorySourceAliasesRemainCanonicalized(t *testing.T) {
t.Parallel()
diff --git a/internal/monitoring/connected_infrastructure.go b/internal/monitoring/connected_infrastructure.go
index aa1334963e..580ba84b84 100644
--- a/internal/monitoring/connected_infrastructure.go
+++ b/internal/monitoring/connected_infrastructure.go
@@ -182,9 +182,6 @@ func applyConnectedInfrastructureIgnoreState(
if agentSurface, ok := group.surfaces["agent"]; ok {
if _, ignored := ignoredHostIDs[strings.TrimSpace(agentSurface.ControlID)]; ignored {
delete(group.surfaces, "agent")
- delete(group.surfaces, "proxmox")
- delete(group.surfaces, "pbs")
- delete(group.surfaces, "pmg")
}
}
@@ -225,6 +222,9 @@ func appendConnectedInfrastructureSurfaces(
if surface, ok := connectedInfrastructurePMGSurface(resource); ok {
addConnectedInfrastructureSurface(groups, resource, surface, resolver)
}
+ if surface, ok := connectedInfrastructureTrueNASSurface(resource); ok {
+ addConnectedInfrastructureSurface(groups, resource, surface, resolver)
+ }
}
func addConnectedInfrastructureSurface(
@@ -392,6 +392,7 @@ func connectedInfrastructureHostname(resource unifiedresources.Resource) string
connectedInfrastructureDockerHostname(resource),
connectedInfrastructurePBSHostname(resource),
connectedInfrastructurePMGHostname(resource),
+ connectedInfrastructureTrueNASHostname(resource),
connectedInfrastructureCanonicalHostname(resource),
strings.TrimSpace(resource.Name),
} {
@@ -431,6 +432,8 @@ func connectedInfrastructureVersion(resource unifiedresources.Resource) string {
return strings.TrimSpace(resource.PBS.Version)
case resource.PMG != nil && strings.TrimSpace(resource.PMG.Version) != "":
return strings.TrimSpace(resource.PMG.Version)
+ case resource.TrueNAS != nil && strings.TrimSpace(resource.TrueNAS.Version) != "":
+ return strings.TrimSpace(resource.TrueNAS.Version)
case resource.Proxmox != nil && strings.TrimSpace(resource.Proxmox.PVEVersion) != "":
return strings.TrimSpace(resource.Proxmox.PVEVersion)
default:
@@ -616,6 +619,29 @@ func connectedInfrastructurePMGSurface(
}, true
}
+func connectedInfrastructureTrueNASSurface(
+ resource unifiedresources.Resource,
+) (models.ConnectedInfrastructureSurfaceFrontend, bool) {
+ if resource.TrueNAS == nil {
+ return models.ConnectedInfrastructureSurfaceFrontend{}, false
+ }
+ hostname := strings.TrimSpace(resource.TrueNAS.Hostname)
+ if hostname == "" {
+ hostname = connectedInfrastructureCanonicalHostname(resource)
+ }
+ if hostname == "" {
+ hostname = resource.ID
+ }
+ return models.ConnectedInfrastructureSurfaceFrontend{
+ ID: "truenas:" + hostname,
+ Kind: "truenas",
+ Label: "TrueNAS data",
+ Detail: "System, storage, app, and recovery telemetry polled through the configured TrueNAS connection.",
+ IDLabel: "Hostname",
+ IDValue: hostname,
+ }, true
+}
+
func connectedInfrastructureSurfaceOrder(kind string) int {
switch kind {
case "agent":
@@ -630,6 +656,8 @@ func connectedInfrastructureSurfaceOrder(kind string) int {
return 4
case "pmg":
return 5
+ case "truenas":
+ return 6
default:
return 99
}
@@ -668,6 +696,13 @@ func connectedInfrastructurePMGHostname(resource unifiedresources.Resource) stri
return ""
}
+func connectedInfrastructureTrueNASHostname(resource unifiedresources.Resource) string {
+ if resource.TrueNAS != nil {
+ return strings.TrimSpace(resource.TrueNAS.Hostname)
+ }
+ return ""
+}
+
func connectedInfrastructureCanonicalHostname(resource unifiedresources.Resource) string {
if resource.Canonical != nil {
return strings.TrimSpace(resource.Canonical.Hostname)
diff --git a/internal/monitoring/connected_infrastructure_test.go b/internal/monitoring/connected_infrastructure_test.go
index 2e759971b8..9c7b4ff310 100644
--- a/internal/monitoring/connected_infrastructure_test.go
+++ b/internal/monitoring/connected_infrastructure_test.go
@@ -154,3 +154,102 @@ func TestBuildConnectedInfrastructure_UsesSharedTopLevelSystemGrouping(t *testin
t.Fatalf("expected PBS surface to attach to the shared top-level system group, got %q", item.ID)
}
}
+
+func TestBuildConnectedInfrastructure_KeepsPlatformConnectionsActiveWhenHostTelemetryIgnored(t *testing.T) {
+ now := time.Unix(1_700_000_000, 0)
+ items := buildConnectedInfrastructure([]unifiedresources.Resource{
+ {
+ ID: "tower-agent",
+ Name: "Tower Agent",
+ LastSeen: now,
+ Status: unifiedresources.StatusOnline,
+ Agent: &unifiedresources.AgentData{
+ AgentID: "tower-agent",
+ AgentVersion: "1.2.3",
+ Hostname: "tower.local",
+ },
+ Identity: unifiedresources.ResourceIdentity{
+ Hostnames: []string{"tower.local"},
+ },
+ },
+ {
+ ID: "tower-pbs",
+ Name: "Tower PBS",
+ LastSeen: now,
+ Status: unifiedresources.StatusOnline,
+ PBS: &unifiedresources.PBSData{
+ InstanceID: "pbs-1",
+ Hostname: "tower.local",
+ Version: "3.4.1",
+ },
+ },
+ }, models.StateSnapshot{
+ RemovedHostAgents: []models.RemovedHostAgent{
+ {ID: "tower-agent", Hostname: "tower.local", DisplayName: "Tower", RemovedAt: now},
+ },
+ })
+
+ if len(items) != 2 {
+ t.Fatalf("expected active platform item and ignored host item, got %d", len(items))
+ }
+
+ var active *models.ConnectedInfrastructureItemFrontend
+ var ignored *models.ConnectedInfrastructureItemFrontend
+ for i := range items {
+ item := &items[i]
+ switch item.Status {
+ case "active":
+ active = item
+ case "ignored":
+ ignored = item
+ }
+ }
+
+ if active == nil {
+ t.Fatal("expected active connected infrastructure item")
+ }
+ if ignored == nil {
+ t.Fatal("expected ignored connected infrastructure item")
+ }
+
+ if len(active.Surfaces) != 1 || active.Surfaces[0].Kind != "pbs" {
+ t.Fatalf("expected active platform surface to remain after host ignore, got %#v", active.Surfaces)
+ }
+ if len(ignored.Surfaces) != 1 || ignored.Surfaces[0].Kind != "agent" {
+ t.Fatalf("expected ignored agent surface, got %#v", ignored.Surfaces)
+ }
+}
+
+func TestBuildConnectedInfrastructure_ProjectsTrueNASSurface(t *testing.T) {
+ now := time.Unix(1_700_000_000, 0)
+ items := buildConnectedInfrastructure([]unifiedresources.Resource{
+ {
+ ID: "truenas-main",
+ Name: "Tower NAS",
+ LastSeen: now,
+ Status: unifiedresources.StatusOnline,
+ TrueNAS: &unifiedresources.TrueNASData{
+ Hostname: "truenas.local",
+ Version: "25.04.0",
+ },
+ },
+ }, models.StateSnapshot{})
+
+ if len(items) != 1 {
+ t.Fatalf("expected one connected infrastructure item, got %d", len(items))
+ }
+
+ item := items[0]
+ if item.Hostname != "truenas.local" {
+ t.Fatalf("expected truenas hostname to drive connected infrastructure hostname, got %q", item.Hostname)
+ }
+ if item.Version != "25.04.0" {
+ t.Fatalf("expected truenas version to drive connected infrastructure version, got %q", item.Version)
+ }
+ if len(item.Surfaces) != 1 {
+ t.Fatalf("expected one truenas surface, got %#v", item.Surfaces)
+ }
+ if item.Surfaces[0].Kind != "truenas" {
+ t.Fatalf("expected truenas surface kind, got %#v", item.Surfaces[0])
+ }
+}