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(truenas): surface platform connections workflow

rcourtmanfa7afc47def4
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index ed011fd16e..7b61cc2cb9 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -142,8 +142,10 @@ management, and fleet control surfaces.
5. Keep first-session lifecycle handoff explicit: the live setup completion
surface in `frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx`
must route the primary CTA into `/settings/infrastructure/install`, frame
- that route as the first-host install step, and present Direct Proxmox as
- the named alternative rather than leaving post-setup next actions implicit.
+ that route as the first-host install step, and present `Platform
+ connections` as the named API-backed alternative for Proxmox, TrueNAS, and
+ future provider integrations rather than leaving post-setup next actions
+ implicit.
6. Keep `frontend-modern/src/components/Settings/InfrastructureInstallerSection.tsx`
oriented around the first monitored host. Install-token generation,
governed command copy, and install instructions belong to the canonical
@@ -422,9 +424,10 @@ prefill assembly.
That same infrastructure workspace boundary now also owns the first-run
handoff copy for new operators. `InfrastructureWorkspace.tsx` must tell a new
Pulse user to start with `Install on a host` to add the first monitored
-system, while still presenting `Direct Proxmox` as the explicit alternative
-path instead of leaving first-session install guidance implicit in generic
-settings-shell prose.
+system, while still presenting `Platform connections` as the explicit
+API-backed alternative path instead of leaving first-session install guidance
+implicit in generic settings-shell prose or retreating to one provider's name
+as the primary alternative.
When that infrastructure workspace needs to redirect operators to the Pulse Pro
surface for billing, monitored-system limits, or license status, it must
consume the settings-owned referral copy from
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index 5e75194941..eb794b2edb 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -529,6 +529,13 @@ export history endpoints live in `internal/api/activity_audit_handlers.go` and
`internal/api/router_routes_licensing.go`, and the contract tests now pin their
response shapes so the execution trail remains queryable through the governed
API surface rather than only through the underlying store.
+The infrastructure platform-connections contract now also owns TrueNAS
+connection CRUD under `internal/api/truenas_handlers.go` and
+`internal/api/router_routes_registration.go`. `/api/truenas/connections`
+must stay the canonical API-backed platform boundary for listing, creating,
+updating, deleting, and testing TrueNAS integrations, and `PUT` updates must
+preserve masked secrets (`********`) instead of clearing stored API keys or
+passwords when operators edit non-secret fields from the settings surface.
The monitored-system ledger contract now also carries a canonical grouping
explanation payload. `/api/license/monitored-system-ledger` must expose the
shared monitored-system explanation summary, sanitized grouping reasons, and
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 756094917b..240a55b781 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -228,6 +228,12 @@ work extends shared components instead of creating new local variants.
“IPs are never seen,” the summary copy in
`GeneralSettingsPanel.tsx` must state those facts plainly instead of
reverting to a stronger but inaccurate shorthand.
+16. Keep infrastructure settings-shell API alternatives on the shared shell
+ contract. `InfrastructureWorkspace.tsx`, `settingsHeaderMeta.ts`,
+ `settingsNavigationModel.ts`, and shared empty-state/setup guidance must
+ present `Platform connections` as the canonical API-backed alternative for
+ Proxmox, TrueNAS, and future provider integrations instead of reviving
+ top-level `Direct Proxmox` wording or shell-local provider routes.
## Current State
@@ -1066,6 +1072,10 @@ That same summary shell should also surface verification scope from the
owning run-history contract. Operators should be able to see, inside the same
summary surface, whether Patrol recently completed a full verification pass or
whether recent activity was limited to scoped/erroring patrol runs.
+When the same governed run-history contract shows a recent full patrol plus
+same-day scoped follow-up work, that summary shell should also carry a compact
+activity-mix explanation rather than forcing operators to infer why Patrol
+looked busy from a separate activity strip alone.
That same shell rule also owns Patrol recency labels. Shared Patrol header and
status-shell surfaces must keep `Last full patrol` tied only to the full-sweep
transport fact and use `Last activity` for scoped or verification work instead
@@ -1472,3 +1482,10 @@ reference cases, and
`frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts`
locks that direct-root contract so single-surface pages do not quietly regain
redundant outer spacing chrome.
+The same shared settings-shell boundary now also owns the API-backed
+alternative path inside Infrastructure Operations. `InfrastructureWorkspace.tsx`,
+`settingsHeaderMeta.ts`, `settingsNavigationModel.ts`,
+`dashboardEmptyStatePresentation.ts`, and adjacent setup guidance must treat
+`Platform connections` as the canonical API-backed alternative for Proxmox,
+TrueNAS, and future provider integrations instead of reviving top-level
+`Direct Proxmox` wording or shell-local provider routes.
diff --git a/docs/release-control/v6/internal/subsystems/monitoring.md b/docs/release-control/v6/internal/subsystems/monitoring.md
index 33e4259c46..1b83854203 100644
--- a/docs/release-control/v6/internal/subsystems/monitoring.md
+++ b/docs/release-control/v6/internal/subsystems/monitoring.md
@@ -33,6 +33,7 @@ truth for live infrastructure data.
9. `internal/monitoring/connected_infrastructure.go`
10. `internal/monitoring/reload.go`
11. `docker-entrypoint.sh`
+12. `internal/monitoring/truenas_poller.go`
## Shared Boundaries
@@ -214,3 +215,8 @@ Proxmox `rootfs` bytes because dataset-level `rootfs` can materially
under-report ZFS-backed node capacity and usage. Proxmox `rootfs` and `/nodes`
disk values remain fallback sources only when no linked host disk truth is
available.
+TrueNAS monitoring ownership now also includes provider rebind semantics in
+`internal/monitoring/truenas_poller.go`. When a stored TrueNAS connection's
+host, auth, TLS, or fingerprint settings change, the poller must replace the
+live provider instance instead of keeping stale connection state in memory
+until the process restarts.
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 4d811435ea..78ee2c448f 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -79,6 +79,7 @@ querying, and the operator-facing storage health presentation layer.
18. Preserve the dedicated backend-owned `relay:mobile:access` capability and its governed backward-compatible route inventory plus the shared helper call sites around it, so storage- and recovery-adjacent transport surfaces do not treat the mobile relay credential as a general AI scope bundle.
19. Preserve shipped local security-doc guidance in shared `internal/api/` config/setup helpers so storage- and recovery-adjacent transport surfaces do not reintroduce GitHub `main` security links when the running build already serves its own local security documentation route.
20. Keep shared `internal/api/` Patrol transport and alert-trigger edits feature-isolated: Patrol-specific recency fields, callback fan-out, or alert-bridge wiring changes must not leak into recovery queries, storage links, or recovery-adjacent install/setup flows unless this contract changes in the same slice.
+21. Keep provider-backed recovery onboarding on the adjacent platform-connections contract. When `internal/api/` grows or changes TrueNAS connection CRUD, masked-secret preservation, or similar provider setup flows, storage and recovery may consume the resulting recovery points but must not absorb that connection-management ownership into storage/recovery-local handlers or page flows.
## Forbidden Paths
@@ -1511,3 +1512,8 @@ connection-validation reads, so hosted recovery/support flows that hand a
paired device back into onboarding do not need to escalate the mobile token to
the broader settings-read privilege just to fetch the canonical bootstrap
payload.
+That same adjacent `internal/api/` boundary also owns provider-backed recovery
+onboarding. Storage and recovery may consume resulting TrueNAS snapshots and
+replication points, but connection CRUD, masked-secret preservation on update,
+and platform polling setup must stay on the adjacent platform-connections
+contract instead of being rebuilt as storage/recovery-local connection flows.
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 2b301e1a7c..613c299ada 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -149,8 +149,10 @@ assembly branch.
when inventory is empty, `frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx`
and `frontend-modern/src/utils/infrastructureEmptyStatePresentation.ts`
must send operators directly to `/settings/infrastructure/install`, name
- first-host install as the default next step, and keep Direct Proxmox as the
- explicit alternative instead of regressing to generic settings-root CTAs.
+ first-host install as the default next step, and keep `Platform connections`
+ as the explicit API-backed alternative for Proxmox, TrueNAS, and future
+ provider-backed platforms instead of regressing to generic settings-root
+ CTAs or provider-specific one-off routes.
## Current State
diff --git a/frontend-modern/src/api/__tests__/truenas.test.ts b/frontend-modern/src/api/__tests__/truenas.test.ts
new file mode 100644
index 0000000000..f91fb72f72
--- /dev/null
+++ b/frontend-modern/src/api/__tests__/truenas.test.ts
@@ -0,0 +1,140 @@
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+import { apiFetchJSON } from '@/utils/apiClient';
+import { TrueNASAPI, isRedactedTrueNASSecret } from '@/api/truenas';
+
+vi.mock('@/utils/apiClient', () => ({
+ apiFetchJSON: vi.fn(),
+}));
+
+describe('TrueNASAPI', () => {
+ beforeEach(() => {
+ vi.clearAllMocks();
+ });
+
+ it('normalizes listed connections from the API contract', async () => {
+ vi.mocked(apiFetchJSON).mockResolvedValueOnce([
+ {
+ id: ' conn-1 ',
+ name: ' tower ',
+ host: ' truenas.local ',
+ port: 443,
+ apiKey: ' ******** ',
+ useHttps: true,
+ insecureSkipVerify: false,
+ enabled: true,
+ },
+ ]);
+
+ await expect(TrueNASAPI.listConnections()).resolves.toEqual([
+ {
+ id: 'conn-1',
+ name: 'tower',
+ host: 'truenas.local',
+ port: 443,
+ apiKey: '********',
+ username: undefined,
+ password: undefined,
+ useHttps: true,
+ insecureSkipVerify: false,
+ fingerprint: undefined,
+ enabled: true,
+ pollIntervalSeconds: undefined,
+ },
+ ]);
+ });
+
+ it('creates, updates, deletes, and tests connections through canonical routes', async () => {
+ vi.mocked(apiFetchJSON)
+ .mockResolvedValueOnce({
+ id: 'conn-1',
+ name: 'tower',
+ host: 'truenas.local',
+ useHttps: true,
+ insecureSkipVerify: false,
+ enabled: true,
+ })
+ .mockResolvedValueOnce({
+ id: 'conn-1',
+ name: 'tower',
+ host: 'truenas.local',
+ useHttps: false,
+ insecureSkipVerify: true,
+ enabled: false,
+ })
+ .mockResolvedValueOnce({ success: true, id: 'conn-1' })
+ .mockResolvedValueOnce({ success: true });
+
+ await TrueNASAPI.createConnection({
+ name: 'tower',
+ host: 'truenas.local',
+ apiKey: 'secret',
+ useHttps: true,
+ enabled: true,
+ });
+ await TrueNASAPI.updateConnection('conn/1', {
+ host: 'truenas.local',
+ username: 'admin',
+ password: '********',
+ useHttps: false,
+ insecureSkipVerify: true,
+ enabled: false,
+ });
+ await TrueNASAPI.deleteConnection('conn/1');
+ await expect(
+ TrueNASAPI.testConnection({
+ host: 'truenas.local',
+ apiKey: 'secret',
+ }),
+ ).resolves.toEqual({ success: true });
+
+ expect(apiFetchJSON).toHaveBeenNthCalledWith(
+ 1,
+ '/api/truenas/connections',
+ expect.objectContaining({
+ method: 'POST',
+ body: JSON.stringify({
+ name: 'tower',
+ host: 'truenas.local',
+ apiKey: 'secret',
+ useHttps: true,
+ enabled: true,
+ }),
+ }),
+ );
+ expect(apiFetchJSON).toHaveBeenNthCalledWith(
+ 2,
+ '/api/truenas/connections/conn%2F1',
+ expect.objectContaining({
+ method: 'PUT',
+ body: JSON.stringify({
+ host: 'truenas.local',
+ username: 'admin',
+ password: '********',
+ useHttps: false,
+ insecureSkipVerify: true,
+ enabled: false,
+ }),
+ }),
+ );
+ expect(apiFetchJSON).toHaveBeenNthCalledWith(
+ 3,
+ '/api/truenas/connections/conn%2F1',
+ expect.objectContaining({ method: 'DELETE' }),
+ );
+ expect(apiFetchJSON).toHaveBeenNthCalledWith(
+ 4,
+ '/api/truenas/connections/test',
+ expect.objectContaining({
+ method: 'POST',
+ body: JSON.stringify({ host: 'truenas.local', apiKey: 'secret' }),
+ }),
+ );
+ });
+
+ it('recognizes the masked-secret placeholder used for update preservation', () => {
+ expect(isRedactedTrueNASSecret('********')).toBe(true);
+ expect(isRedactedTrueNASSecret(' ******** ')).toBe(true);
+ expect(isRedactedTrueNASSecret('secret')).toBe(false);
+ expect(isRedactedTrueNASSecret(undefined)).toBe(false);
+ });
+});
diff --git a/frontend-modern/src/api/truenas.ts b/frontend-modern/src/api/truenas.ts
new file mode 100644
index 0000000000..5e72b161d3
--- /dev/null
+++ b/frontend-modern/src/api/truenas.ts
@@ -0,0 +1,132 @@
+import { apiFetchJSON } from '@/utils/apiClient';
+import {
+ arrayOrUndefined,
+ finiteNumberOrUndefined,
+ optionalTrimmedString,
+ strictBoolean,
+ trimmedString,
+} from './responseUtils';
+
+const TRUE_NAS_CONNECTIONS_PATH = '/api/truenas/connections';
+
+const REDACTED_SECRET = '********';
+
+type RawTrueNASConnection = Partial<TrueNASConnection>;
+
+export interface TrueNASConnection {
+ id: string;
+ name: string;
+ host: string;
+ port?: number;
+ apiKey?: string;
+ username?: string;
+ password?: string;
+ useHttps: boolean;
+ insecureSkipVerify: boolean;
+ fingerprint?: string;
+ enabled: boolean;
+ pollIntervalSeconds?: number;
+}
+
+export interface TrueNASConnectionInput {
+ name?: string;
+ host: string;
+ port?: number;
+ apiKey?: string;
+ username?: string;
+ password?: string;
+ useHttps?: boolean;
+ insecureSkipVerify?: boolean;
+ fingerprint?: string;
+ enabled?: boolean;
+ pollIntervalSeconds?: number;
+}
+
+export interface TrueNASConnectionTestResult {
+ success: boolean;
+}
+
+const normalizeTrueNASConnection = (connection: RawTrueNASConnection): TrueNASConnection => ({
+ id: trimmedString(connection.id),
+ name: optionalTrimmedString(connection.name) ?? '',
+ host: trimmedString(connection.host),
+ port: finiteNumberOrUndefined(connection.port),
+ apiKey: optionalTrimmedString(connection.apiKey),
+ username: optionalTrimmedString(connection.username),
+ password: optionalTrimmedString(connection.password),
+ useHttps: strictBoolean(connection.useHttps),
+ insecureSkipVerify: strictBoolean(connection.insecureSkipVerify),
+ fingerprint: optionalTrimmedString(connection.fingerprint),
+ enabled: strictBoolean(connection.enabled),
+ pollIntervalSeconds: finiteNumberOrUndefined(connection.pollIntervalSeconds),
+});
+
+const serializeTrueNASConnectionInput = (input: TrueNASConnectionInput) => ({
+ ...(input.name !== undefined ? { name: input.name } : {}),
+ host: input.host,
+ ...(input.port !== undefined ? { port: input.port } : {}),
+ ...(input.apiKey !== undefined ? { apiKey: input.apiKey } : {}),
+ ...(input.username !== undefined ? { username: input.username } : {}),
+ ...(input.password !== undefined ? { password: input.password } : {}),
+ ...(input.useHttps !== undefined ? { useHttps: input.useHttps } : {}),
+ ...(input.insecureSkipVerify !== undefined
+ ? { insecureSkipVerify: input.insecureSkipVerify }
+ : {}),
+ ...(input.fingerprint !== undefined ? { fingerprint: input.fingerprint } : {}),
+ ...(input.enabled !== undefined ? { enabled: input.enabled } : {}),
+ ...(input.pollIntervalSeconds !== undefined
+ ? { pollIntervalSeconds: input.pollIntervalSeconds }
+ : {}),
+});
+
+export const isRedactedTrueNASSecret = (value: string | null | undefined) =>
+ (value || '').trim() === REDACTED_SECRET;
+
+export class TrueNASAPI {
+ static async listConnections(): Promise<TrueNASConnection[]> {
+ const response = await apiFetchJSON<RawTrueNASConnection[]>(TRUE_NAS_CONNECTIONS_PATH);
+ const list = arrayOrUndefined<RawTrueNASConnection>(response) ?? [];
+ return list.map(normalizeTrueNASConnection);
+ }
+
+ static async createConnection(input: TrueNASConnectionInput): Promise<TrueNASConnection> {
+ const response = await apiFetchJSON<RawTrueNASConnection>(TRUE_NAS_CONNECTIONS_PATH, {
+ method: 'POST',
+ body: JSON.stringify(serializeTrueNASConnectionInput(input)),
+ });
+ return normalizeTrueNASConnection(response);
+ }
+
+ static async updateConnection(
+ id: string,
+ input: TrueNASConnectionInput,
+ ): Promise<TrueNASConnection> {
+ const response = await apiFetchJSON<RawTrueNASConnection>(
+ `${TRUE_NAS_CONNECTIONS_PATH}/${encodeURIComponent(id)}`,
+ {
+ method: 'PUT',
+ body: JSON.stringify(serializeTrueNASConnectionInput(input)),
+ },
+ );
+ return normalizeTrueNASConnection(response);
+ }
+
+ static async deleteConnection(id: string): Promise<{ success: boolean; id: string }> {
+ return apiFetchJSON(`${TRUE_NAS_CONNECTIONS_PATH}/${encodeURIComponent(id)}`, {
+ method: 'DELETE',
+ });
+ }
+
+ static async testConnection(input: TrueNASConnectionInput): Promise<TrueNASConnectionTestResult> {
+ const response = await apiFetchJSON<Partial<TrueNASConnectionTestResult>>(
+ `${TRUE_NAS_CONNECTIONS_PATH}/test`,
+ {
+ method: 'POST',
+ body: JSON.stringify(serializeTrueNASConnectionInput(input)),
+ },
+ );
+ return {
+ success: strictBoolean(response.success),
+ };
+ }
+}
diff --git a/frontend-modern/src/components/Dashboard/__tests__/DashboardStateCards.test.tsx b/frontend-modern/src/components/Dashboard/__tests__/DashboardStateCards.test.tsx
index 0bfca14b92..8f5c582d37 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/DashboardStateCards.test.tsx
+++ b/frontend-modern/src/components/Dashboard/__tests__/DashboardStateCards.test.tsx
@@ -22,7 +22,7 @@ describe('DashboardStateCards', () => {
dashboardInfrastructureEmptyState={() => ({
title: 'No infrastructure hosts connected',
description:
- 'To start using Pulse, first add your infrastructure in Settings → Infrastructure → Install on a host. If you want to connect Proxmox directly instead, use Settings → Infrastructure → Direct Proxmox.',
+ 'To start using Pulse, first add your infrastructure in Settings → Infrastructure → Install on a host. If you want an API-backed platform integration instead, use Settings → Infrastructure → Platform connections.',
actionLabel: 'Open infrastructure setup',
})}
dashboardLoadingState={() => ({
diff --git a/frontend-modern/src/components/Settings/InfrastructureDirectConnectionsSummaryCard.tsx b/frontend-modern/src/components/Settings/InfrastructureDirectConnectionsSummaryCard.tsx
index e5830e77a8..fe32003850 100644
--- a/frontend-modern/src/components/Settings/InfrastructureDirectConnectionsSummaryCard.tsx
+++ b/frontend-modern/src/components/Settings/InfrastructureDirectConnectionsSummaryCard.tsx
@@ -18,7 +18,8 @@ export const InfrastructureDirectConnectionsSummaryCard: Component<
<div>
<h3 class="text-base font-semibold text-base-content">Direct Proxmox connections</h3>
<p class="text-sm text-muted">
- Review fallback direct coverage separately from agent-managed hosts.
+ Review fallback Proxmox coverage separately from agent-managed hosts, then open the
+ shared platform-connections workspace for Proxmox and TrueNAS integrations.
</p>
</div>
<button
@@ -26,7 +27,7 @@ export const InfrastructureDirectConnectionsSummaryCard: Component<
onClick={props.onManageDirectConnections}
class="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"
>
- Manage direct connections
+ Open platform connections
</button>
</div>
diff --git a/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx b/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx
index 47b90089ef..add48cb2c1 100644
--- a/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx
+++ b/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx
@@ -5,7 +5,7 @@ import { Subtabs } from '@/components/shared/Subtabs';
import { SELF_HOSTED_PRO_BILLING_PRESENTATION } from './selfHostedBillingPresentation';
import { InfrastructureInstallPanel } from './InfrastructureInstallPanel';
import { InfrastructureReportingPanel } from './InfrastructureReportingPanel';
-import { ProxmoxSettingsPanel } from './ProxmoxSettingsPanel';
+import { PlatformConnectionsWorkspace } from './PlatformConnectionsWorkspace';
import {
INFRASTRUCTURE_WORKSPACE_TABS,
buildInfrastructureWorkspacePath,
@@ -21,7 +21,7 @@ export const InfrastructureWorkspace: Component<InfrastructureWorkspaceProps> =
const location = useLocation();
const activeView = createMemo(() => getInfrastructureWorkspaceViewFromPath(location.pathname));
const installPath = createMemo(() => buildInfrastructureWorkspacePath('install'));
- const directPath = createMemo(() => buildInfrastructureWorkspacePath('direct'));
+ const platformsPath = createMemo(() => buildInfrastructureWorkspacePath('platforms'));
const openView = (view: InfrastructureWorkspaceView) =>
navigate(buildInfrastructureWorkspacePath(view));
@@ -34,16 +34,16 @@ export const InfrastructureWorkspace: Component<InfrastructureWorkspaceProps> =
<h3 class="text-base font-semibold text-base-content">Connect your first system</h3>
<p class="text-sm text-muted">
Start with Install on a host to connect the first machine you want Pulse to monitor.
- If you already know you want a direct integration instead, go straight to Direct
- Proxmox.
+ If you already know you want an API-backed platform integration instead, go straight
+ to Platform connections.
</p>
</div>
<div class="grid gap-3 lg:grid-cols-3">
<div class="rounded-md border border-border bg-surface px-4 py-3">
<p class="text-xs font-semibold uppercase tracking-wide text-muted">1. Choose path</p>
<p class="mt-1 text-sm text-base-content">
- Install Pulse on a host first, or use Direct Proxmox if that is the system you are
- connecting.
+ Install Pulse on a host first, or open Platform connections for systems Pulse
+ should poll through their own APIs.
</p>
</div>
<div class="rounded-md border border-border bg-surface px-4 py-3">
@@ -51,8 +51,8 @@ export const InfrastructureWorkspace: Component<InfrastructureWorkspaceProps> =
2. Generate access
</p>
<p class="mt-1 text-sm text-base-content">
- Create the install token Pulse expects for the first monitored host, then copy the
- generated command.
+ Create the install token Pulse expects for the first monitored host, or add the API
+ credentials Pulse should store for platform-backed systems.
</p>
</div>
<div class="rounded-md border border-border bg-surface px-4 py-3">
@@ -79,14 +79,16 @@ export const InfrastructureWorkspace: Component<InfrastructureWorkspaceProps> =
</button>
<button
type="button"
- onClick={() => navigate(directPath())}
+ onClick={() => navigate(platformsPath())}
class={`inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors ${
- activeView() === 'direct'
+ activeView() === 'platforms'
? 'bg-emerald-600 text-white'
: 'border border-border bg-surface text-base-content hover:bg-surface-hover'
}`}
>
- {activeView() === 'direct' ? 'Direct Proxmox selected' : 'Open Direct Proxmox'}
+ {activeView() === 'platforms'
+ ? 'Platform connections selected'
+ : 'Open Platform connections'}
</button>
</div>
<p class="text-sm text-muted">
@@ -112,14 +114,14 @@ export const InfrastructureWorkspace: Component<InfrastructureWorkspaceProps> =
<InfrastructureInstallPanel />
</Match>
- <Match when={activeView() === 'direct'}>
- <ProxmoxSettingsPanel {...props} embedded />
+ <Match when={activeView() === 'platforms'}>
+ <PlatformConnectionsWorkspace {...props} />
</Match>
<Match when={activeView() === 'inventory'}>
<InfrastructureReportingPanel
{...props}
- onManageDirectConnections={() => openView('direct')}
+ onManageDirectConnections={() => openView('platforms')}
/>
</Match>
</Switch>
diff --git a/frontend-modern/src/components/Settings/PlatformConnectionsWorkspace.tsx b/frontend-modern/src/components/Settings/PlatformConnectionsWorkspace.tsx
new file mode 100644
index 0000000000..cf395c32d9
--- /dev/null
+++ b/frontend-modern/src/components/Settings/PlatformConnectionsWorkspace.tsx
@@ -0,0 +1,44 @@
+import type { Component } from 'solid-js';
+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';
+
+export const PlatformConnectionsWorkspace: Component<ProxmoxSettingsPanelProps> = (props) => {
+ const navigate = useNavigate();
+ const location = useLocation();
+ const activeView = createMemo(() => getPlatformConnectionsViewFromPath(location.pathname));
+
+ return (
+ <div class="space-y-6">
+ <Subtabs
+ value={activeView()}
+ onChange={(value) => navigate(buildPlatformConnectionsPath(value as 'proxmox' | 'truenas'))}
+ ariaLabel="Platform connections"
+ tabs={PLATFORM_CONNECTIONS_TABS.map((tab) => ({
+ value: tab.id,
+ label: tab.label,
+ }))}
+ />
+
+ <Switch>
+ <Match when={activeView() === 'truenas'}>
+ <TrueNASSettingsPanel />
+ </Match>
+
+ <Match when={activeView() === 'proxmox'}>
+ <ProxmoxSettingsPanel {...props} embedded />
+ </Match>
+ </Switch>
+ </div>
+ );
+};
+
+export default PlatformConnectionsWorkspace;
diff --git a/frontend-modern/src/components/Settings/TrueNASSettingsPanel.tsx b/frontend-modern/src/components/Settings/TrueNASSettingsPanel.tsx
new file mode 100644
index 0000000000..dbcfc253d8
--- /dev/null
+++ b/frontend-modern/src/components/Settings/TrueNASSettingsPanel.tsx
@@ -0,0 +1,441 @@
+import type { Component } from 'solid-js';
+import { For, Show } from 'solid-js';
+import Database from 'lucide-solid/icons/database';
+import ShieldAlert from 'lucide-solid/icons/shield-alert';
+import { CalloutCard } from '@/components/shared/CalloutCard';
+import { Card } from '@/components/shared/Card';
+import { Dialog } from '@/components/shared/Dialog';
+import {
+ formCheckbox,
+ formControl,
+ formField,
+ formHelpText,
+ formLabel,
+ formSelect,
+} from '@/components/shared/Form';
+import { getSettingsConfigurationLoadingState } from '@/utils/settingsShellPresentation';
+import { useTrueNASSettingsPanelState } 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';
+const primaryButtonClass =
+ 'inline-flex min-h-10 sm:min-h-9 items-center justify-center rounded-md bg-blue-600 px-3 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:opacity-60';
+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();
+
+ return (
+ <div class="space-y-6">
+ <CalloutCard
+ tone="info"
+ title="TrueNAS platform integration"
+ description={
+ <>
+ <p>
+ Connect TrueNAS through its API so Pulse can ingest pools, datasets, disks, alerts,
+ and recovery artifacts as a first-class platform instead of treating the NAS like a
+ generic host.
+ </p>
+ <p class="mt-2">
+ Use the unified agent on TrueNAS only as optional augmentation later if there is
+ extra host telemetry the API cannot provide.
+ </p>
+ </>
+ }
+ icon={<Database class="h-5 w-5" />}
+ />
+
+ <Show when={state.featureDisabled()}>
+ <CalloutCard
+ tone="warning"
+ title="TrueNAS integration is disabled"
+ description={
+ <>
+ <p>{state.featureDisabledMessage() || 'TrueNAS integration is not enabled.'}</p>
+ <p class="mt-2">
+ Enable <code>PULSE_ENABLE_TRUENAS=true</code> on the Pulse server and restart the
+ service before adding TrueNAS connections.
+ </p>
+ </>
+ }
+ icon={<ShieldAlert class="h-5 w-5" />}
+ />
+ </Show>
+
+ <Show when={!state.featureDisabled()}>
+ <Card padding="lg" class="rounded-xl border border-border shadow-sm">
+ <div class="space-y-4">
+ <div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
+ <div class="space-y-1">
+ <h3 class="text-base font-semibold text-base-content">TrueNAS connections</h3>
+ <p class="text-sm text-muted">
+ Manage the API-backed TrueNAS systems Pulse should poll and normalize into the
+ unified resource model.
+ </p>
+ </div>
+ <div class="flex items-center gap-2">
+ <button
+ type="button"
+ class={buttonClass}
+ onClick={() => void state.loadConnections()}
+ disabled={state.loading()}
+ >
+ Refresh
+ </button>
+ <button
+ type="button"
+ class={primaryButtonClass}
+ onClick={state.openCreateDialog}
+ >
+ Add TrueNAS connection
+ </button>
+ </div>
+ </div>
+
+ <Show when={state.loading()}>
+ <div class="flex items-center justify-center rounded-md border border-dashed border-border bg-surface-alt py-12 text-sm text-muted">
+ {getSettingsConfigurationLoadingState().text}
+ </div>
+ </Show>
+
+ <Show when={!state.loading() && state.loadingError()}>
+ <CalloutCard
+ tone="danger"
+ title="Failed to load TrueNAS connections"
+ description={
+ <>
+ <p>{state.loadingError()}</p>
+ <button
+ type="button"
+ class={`mt-3 ${buttonClass}`}
+ onClick={() => void state.loadConnections()}
+ >
+ Retry
+ </button>
+ </>
+ }
+ />
+ </Show>
+
+ <Show when={!state.loading() && !state.loadingError() && state.connections().length === 0}>
+ <div class="rounded-lg border border-dashed border-border bg-surface-alt px-6 py-12 text-center">
+ <p class="text-base font-medium text-base-content">No TrueNAS connections yet</p>
+ <p class="mt-1 text-sm text-muted">
+ Add the first TrueNAS API endpoint Pulse should poll.
+ </p>
+ </div>
+ </Show>
+
+ <Show when={!state.loading() && !state.loadingError() && state.connections().length > 0}>
+ <div class="space-y-3">
+ <For each={state.connections()}>
+ {(connection) => (
+ <div class="rounded-lg border border-border bg-surface-alt px-4 py-4">
+ <div class="flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between">
+ <div class="space-y-2">
+ <div class="flex flex-wrap items-center gap-2">
+ <h4 class="text-sm font-semibold text-base-content">
+ {connection.name || connection.host}
+ </h4>
+ <span
+ class={`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${
+ connection.enabled
+ ? 'bg-emerald-50 text-emerald-700 dark:bg-emerald-950/40 dark:text-emerald-300'
+ : 'bg-surface text-muted'
+ }`}
+ >
+ {connection.enabled ? 'Enabled' : 'Disabled'}
+ </span>
+ </div>
+ <p class="text-sm text-muted">
+ {connection.host}
+ {connection.port ? `:${connection.port}` : ''}
+ </p>
+ <div class="flex flex-wrap items-center gap-2 text-xs text-muted">
+ <span>{connection.apiKey ? 'API key auth' : 'Username/password auth'}</span>
+ <span aria-hidden="true">•</span>
+ <span>{connection.useHttps ? 'HTTPS' : 'HTTP'}</span>
+ <Show when={connection.insecureSkipVerify}>
+ <>
+ <span aria-hidden="true">•</span>
+ <span>Skip TLS verification</span>
+ </>
+ </Show>
+ </div>
+ </div>
+
+ <div class="flex flex-wrap items-center gap-2">
+ <button
+ type="button"
+ class={buttonClass}
+ onClick={() => void state.testSavedConnection(connection)}
+ disabled={state.testing()}
+ >
+ Test
+ </button>
+ <button
+ type="button"
+ class={buttonClass}
+ onClick={() => state.openEditDialog(connection)}
+ >
+ Edit
+ </button>
+ <button
+ type="button"
+ class={dangerButtonClass}
+ onClick={() => state.openDeleteDialog(connection)}
+ >
+ Delete
+ </button>
+ </div>
+ </div>
+ </div>
+ )}
+ </For>
+ </div>
+ </Show>
+ </div>
+ </Card>
+ </Show>
+
+ <Dialog
+ isOpen={state.dialogOpen()}
+ onClose={state.closeDialog}
+ ariaLabel={state.editingConnection() ? 'Edit TrueNAS connection' : 'Add TrueNAS connection'}
+ panelClass="w-full max-w-2xl"
+ >
+ <div class="space-y-6 p-6">
+ <div class="space-y-1">
+ <h3 class="text-lg font-semibold text-base-content">
+ {state.editingConnection() ? 'Edit TrueNAS connection' : 'Add TrueNAS connection'}
+ </h3>
+ <p class="text-sm text-muted">
+ Configure the API endpoint Pulse should poll for this TrueNAS system.
+ </p>
+ </div>
+
+ <div class="grid gap-4 sm:grid-cols-2">
+ <label class={formField}>
+ <span class={formLabel}>Name</span>
+ <input
+ class={formControl}
+ value={state.form().name}
+ onInput={(event) => state.updateForm({ name: event.currentTarget.value })}
+ placeholder="tower"
+ />
+ </label>
+ <label class={formField}>
+ <span class={formLabel}>Host</span>
+ <input
+ class={formControl}
+ value={state.form().host}
+ onInput={(event) => state.updateForm({ host: event.currentTarget.value })}
+ placeholder="truenas.local"
+ />
+ </label>
+ <label class={formField}>
+ <span class={formLabel}>Port</span>
+ <input
+ class={formControl}
+ inputMode="numeric"
+ value={state.form().port}
+ onInput={(event) => state.updateForm({ port: event.currentTarget.value })}
+ placeholder={state.form().useHttps ? '443' : '80'}
+ />
+ </label>
+ <label class={formField}>
+ <span class={formLabel}>Authentication</span>
+ <select
+ class={formSelect}
+ value={state.form().authMode}
+ onChange={(event) =>
+ state.updateForm({
+ authMode: event.currentTarget.value as 'apiKey' | 'userpass',
+ apiKey: '',
+ password: '',
+ })
+ }
+ >
+ <option value="apiKey">API key</option>
+ <option value="userpass">Username and password</option>
+ </select>
+ </label>
+ </div>
+
+ <Show when={state.form().authMode === 'apiKey'}>
+ <label class={formField}>
+ <span class={formLabel}>API key</span>
+ <input
+ class={formControl}
+ type="password"
+ value={state.form().apiKey}
+ onInput={(event) => state.updateForm({ apiKey: event.currentTarget.value })}
+ placeholder={
+ state.form().hasStoredApiKey ? 'Saved API key retained unless replaced' : ''
+ }
+ />
+ <Show when={state.form().hasStoredApiKey}>
+ <span class={formHelpText}>
+ Leave this blank to keep the saved API key.
+ </span>
+ </Show>
+ </label>
+ </Show>
+
+ <Show when={state.form().authMode === 'userpass'}>
+ <div class="grid gap-4 sm:grid-cols-2">
+ <label class={formField}>
+ <span class={formLabel}>Username</span>
+ <input
+ class={formControl}
+ value={state.form().username}
+ onInput={(event) => state.updateForm({ username: event.currentTarget.value })}
+ placeholder="admin"
+ />
+ </label>
+ <label class={formField}>
+ <span class={formLabel}>Password</span>
+ <input
+ class={formControl}
+ type="password"
+ value={state.form().password}
+ onInput={(event) => state.updateForm({ password: event.currentTarget.value })}
+ placeholder={
+ state.form().hasStoredPassword ? 'Saved password retained unless replaced' : ''
+ }
+ />
+ <Show when={state.form().hasStoredPassword}>
+ <span class={formHelpText}>
+ Leave this blank to keep the saved password.
+ </span>
+ </Show>
+ </label>
+ </div>
+ </Show>
+
+ <div class="grid gap-4 sm:grid-cols-2">
+ <label class={formField}>
+ <span class={formLabel}>TLS fingerprint</span>
+ <input
+ class={formControl}
+ value={state.form().fingerprint}
+ onInput={(event) => state.updateForm({ fingerprint: event.currentTarget.value })}
+ placeholder="Optional SHA256 fingerprint"
+ />
+ <span class={formHelpText}>
+ Optional certificate pin for HTTPS connections.
+ </span>
+ </label>
+ <div class="space-y-3 rounded-md border border-border bg-surface-alt px-4 py-3">
+ <label class="flex items-center gap-3">
+ <input
+ type="checkbox"
+ class={formCheckbox}
+ checked={state.form().useHttps}
+ onChange={(event) => state.updateForm({ useHttps: event.currentTarget.checked })}
+ />
+ <span class="text-sm text-base-content">Use HTTPS</span>
+ </label>
+ <label class="flex items-center gap-3">
+ <input
+ type="checkbox"
+ class={formCheckbox}
+ checked={state.form().insecureSkipVerify}
+ onChange={(event) =>
+ state.updateForm({ insecureSkipVerify: event.currentTarget.checked })
+ }
+ />
+ <span class="text-sm text-base-content">Skip TLS verification</span>
+ </label>
+ <label class="flex items-center gap-3">
+ <input
+ type="checkbox"
+ class={formCheckbox}
+ checked={state.form().enabled}
+ onChange={(event) => state.updateForm({ enabled: event.currentTarget.checked })}
+ />
+ <span class="text-sm text-base-content">Enable polling immediately</span>
+ </label>
+ </div>
+ </div>
+
+ <div class="flex flex-col-reverse gap-2 sm:flex-row sm:justify-end">
+ <button
+ type="button"
+ class={buttonClass}
+ onClick={state.closeDialog}
+ disabled={state.saving() || state.testing()}
+ >
+ Cancel
+ </button>
+ <button
+ type="button"
+ class={buttonClass}
+ onClick={() => void state.testCurrentForm()}
+ disabled={state.saving() || state.testing()}
+ >
+ {state.testing() ? 'Testing…' : 'Test connection'}
+ </button>
+ <button
+ type="button"
+ class={primaryButtonClass}
+ onClick={() => void state.saveCurrentForm()}
+ disabled={state.saving() || state.testing()}
+ >
+ {state.saving()
+ ? state.editingConnection()
+ ? 'Saving…'
+ : 'Adding…'
+ : state.editingConnection()
+ ? 'Save connection'
+ : 'Add connection'}
+ </button>
+ </div>
+ </div>
+ </Dialog>
+
+ <Dialog
+ isOpen={state.deleteDialogOpen()}
+ onClose={state.closeDeleteDialog}
+ ariaLabel="Delete TrueNAS connection"
+ panelClass="w-full max-w-lg"
+ >
+ <div class="space-y-5 p-6">
+ <div class="space-y-1">
+ <h3 class="text-lg font-semibold text-base-content">Delete TrueNAS connection</h3>
+ <p class="text-sm text-muted">
+ Remove{' '}
+ <span class="font-medium text-base-content">
+ {state.pendingDeleteConnection()?.name || state.pendingDeleteConnection()?.host}
+ </span>{' '}
+ from the configured TrueNAS API integrations.
+ </p>
+ </div>
+
+ <div class="flex flex-col-reverse gap-2 sm:flex-row sm:justify-end">
+ <button
+ type="button"
+ class={buttonClass}
+ onClick={state.closeDeleteDialog}
+ disabled={state.deleting()}
+ >
+ Cancel
+ </button>
+ <button
+ type="button"
+ class={dangerButtonClass}
+ onClick={() => void state.deletePendingConnection()}
+ disabled={state.deleting()}
+ >
+ {state.deleting() ? 'Deleting…' : 'Delete connection'}
+ </button>
+ </div>
+ </div>
+ </Dialog>
+ </div>
+ );
+};
+
+export default TrueNASSettingsPanel;
diff --git a/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsController.test.tsx b/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsController.test.tsx
index 665769ed67..156194a076 100644
--- a/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsController.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsController.test.tsx
@@ -118,6 +118,13 @@ describe('InfrastructureOperationsController ownership guardrails', () => {
expect(infrastructureOperationsStateSource).not.toContain('renderStopMonitoringDialog');
expect(infrastructureInstallStateSource).toContain('export const useInfrastructureInstallState');
expect(infrastructureInstallStateSource).toContain('MonitoringAPI.getState()');
+ expect(infrastructureInstallStateSource).toContain('./platformConnectionsModel');
+ expect(infrastructureInstallStateSource).toContain(
+ "navigate(buildPlatformConnectionsPath('proxmox'))",
+ );
+ expect(infrastructureInstallStateSource).not.toContain(
+ "navigate('/settings/infrastructure/proxmox')",
+ );
expect(infrastructureReportingStateSource).toContain(
'export const useInfrastructureReportingState',
);
diff --git a/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx b/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx
index 08de833e2b..745d7f81f8 100644
--- a/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx
@@ -23,8 +23,8 @@ vi.mock('../InfrastructureReportingPanel', () => ({
InfrastructureReportingPanel: () => <div data-testid="agent-profiles">profiles</div>,
}));
-vi.mock('../ProxmoxSettingsPanel', () => ({
- ProxmoxSettingsPanel: () => <div data-testid="proxmox-settings">direct</div>,
+vi.mock('../PlatformConnectionsWorkspace', () => ({
+ PlatformConnectionsWorkspace: () => <div data-testid="platform-connections">platforms</div>,
}));
describe('InfrastructureWorkspace', () => {
@@ -59,7 +59,7 @@ describe('InfrastructureWorkspace', () => {
expect(screen.getByText('Connect your first system')).toBeInTheDocument();
expect(
screen.getByText(
- 'Start with Install on a host to connect the first machine you want Pulse to monitor. If you already know you want a direct integration instead, go straight to Direct Proxmox.',
+ 'Start with Install on a host to connect the first machine you want Pulse to monitor. If you already know you want an API-backed platform integration instead, go straight to Platform connections.',
),
).toBeInTheDocument();
expect(screen.getByText('1. Choose path')).toBeInTheDocument();
@@ -72,7 +72,7 @@ describe('InfrastructureWorkspace', () => {
'aria-selected',
'true',
);
- expect(screen.getByRole('tab', { name: 'Direct Proxmox' })).toHaveAttribute(
+ expect(screen.getByRole('tab', { name: 'Platform connections' })).toHaveAttribute(
'aria-selected',
'false',
);
@@ -83,23 +83,23 @@ describe('InfrastructureWorkspace', () => {
expect(screen.getByTestId('unified-agents')).toBeInTheDocument();
});
- it('uses the shared subtabs to switch to direct proxmox', () => {
+ it('uses the shared subtabs to switch to platform connections', () => {
renderWorkspace();
- fireEvent.click(screen.getByRole('tab', { name: 'Direct Proxmox' }));
+ fireEvent.click(screen.getByRole('tab', { name: 'Platform connections' }));
- expect(navigateSpy).toHaveBeenCalledWith('/settings/infrastructure/proxmox');
+ expect(navigateSpy).toHaveBeenCalledWith('/settings/infrastructure/platforms');
});
- it('renders the direct workspace from the router pathname', () => {
- mockPathname = '/settings/infrastructure/proxmox';
+ it('renders the platform workspace from the router pathname', () => {
+ mockPathname = '/settings/infrastructure/platforms';
renderWorkspace();
- expect(screen.getByRole('tab', { name: 'Direct Proxmox' })).toHaveAttribute(
+ expect(screen.getByRole('tab', { name: 'Platform connections' })).toHaveAttribute(
'aria-selected',
'true',
);
- expect(screen.getByTestId('proxmox-settings')).toBeInTheDocument();
+ expect(screen.getByTestId('platform-connections')).toBeInTheDocument();
});
it('keeps the reporting route available for established operators', () => {
@@ -113,18 +113,18 @@ describe('InfrastructureWorkspace', () => {
expect(screen.getByTestId('agent-profiles')).toBeInTheDocument();
});
- it('uses the guided workspace actions to open install and direct paths', () => {
+ it('uses the guided workspace actions to open install and platform paths', () => {
renderWorkspace();
fireEvent.click(screen.getByRole('button', { name: 'Install on a host selected' }));
- fireEvent.click(screen.getByRole('button', { name: 'Open Direct Proxmox' }));
+ fireEvent.click(screen.getByRole('button', { name: 'Open Platform connections' }));
expect(navigateSpy).toHaveBeenNthCalledWith(1, '/settings/infrastructure/install');
- expect(navigateSpy).toHaveBeenNthCalledWith(2, '/settings/infrastructure/proxmox');
+ expect(navigateSpy).toHaveBeenNthCalledWith(2, '/settings/infrastructure/platforms');
});
- it('returns to the base settings route when switching away from direct proxmox', () => {
- mockPathname = '/settings/infrastructure/proxmox';
+ it('returns to the base settings route when switching away from platform connections', () => {
+ mockPathname = '/settings/infrastructure/platforms';
renderWorkspace();
fireEvent.click(screen.getByRole('tab', { name: 'Install on a host' }));
diff --git a/frontend-modern/src/components/Settings/__tests__/PlatformConnectionsWorkspace.test.tsx b/frontend-modern/src/components/Settings/__tests__/PlatformConnectionsWorkspace.test.tsx
new file mode 100644
index 0000000000..ed53afa056
--- /dev/null
+++ b/frontend-modern/src/components/Settings/__tests__/PlatformConnectionsWorkspace.test.tsx
@@ -0,0 +1,72 @@
+import { cleanup, fireEvent, render, screen } from '@solidjs/testing-library';
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
+import { PlatformConnectionsWorkspace } from '../PlatformConnectionsWorkspace';
+
+let mockPathname = '/settings/infrastructure/platforms/proxmox';
+const navigateSpy = vi.hoisted(() => vi.fn());
+
+vi.mock('@solidjs/router', async () => {
+ const actual = await vi.importActual<typeof import('@solidjs/router')>('@solidjs/router');
+ return {
+ ...actual,
+ useLocation: () => ({ pathname: mockPathname }),
+ useNavigate: () => navigateSpy,
+ };
+});
+
+vi.mock('../ProxmoxSettingsPanel', () => ({
+ ProxmoxSettingsPanel: () => <div data-testid="proxmox-settings">proxmox</div>,
+}));
+
+vi.mock('../TrueNASSettingsPanel', () => ({
+ TrueNASSettingsPanel: () => <div data-testid="truenas-settings">truenas</div>,
+}));
+
+describe('PlatformConnectionsWorkspace', () => {
+ beforeEach(() => {
+ navigateSpy.mockReset();
+ mockPathname = '/settings/infrastructure/platforms/proxmox';
+ });
+
+ afterEach(() => {
+ cleanup();
+ });
+
+ const renderWorkspace = () =>
+ render(
+ () =>
+ (
+ <PlatformConnectionsWorkspace
+ {...({
+ pveNodes: () => [],
+ pbsNodes: () => [],
+ pmgNodes: () => [],
+ } as any)}
+ />
+ ) as any,
+ );
+
+ it('renders the Proxmox workspace by default', () => {
+ renderWorkspace();
+
+ expect(screen.getByRole('tab', { name: 'Proxmox' })).toHaveAttribute('aria-selected', 'true');
+ expect(screen.getByRole('tab', { name: 'TrueNAS' })).toHaveAttribute('aria-selected', 'false');
+ expect(screen.getByTestId('proxmox-settings')).toBeInTheDocument();
+ });
+
+ it('navigates to the canonical TrueNAS route from the shared subtabs', () => {
+ renderWorkspace();
+
+ fireEvent.click(screen.getByRole('tab', { name: 'TrueNAS' }));
+
+ expect(navigateSpy).toHaveBeenCalledWith('/settings/infrastructure/platforms/truenas');
+ });
+
+ it('treats legacy TrueNAS routes as the TrueNAS workspace', () => {
+ mockPathname = '/settings/infrastructure/truenas';
+ renderWorkspace();
+
+ expect(screen.getByRole('tab', { name: 'TrueNAS' })).toHaveAttribute('aria-selected', 'true');
+ expect(screen.getByTestId('truenas-settings')).toBeInTheDocument();
+ });
+});
diff --git a/frontend-modern/src/components/Settings/__tests__/TrueNASSettingsPanel.test.tsx b/frontend-modern/src/components/Settings/__tests__/TrueNASSettingsPanel.test.tsx
new file mode 100644
index 0000000000..5fc03b0bd9
--- /dev/null
+++ b/frontend-modern/src/components/Settings/__tests__/TrueNASSettingsPanel.test.tsx
@@ -0,0 +1,125 @@
+import { cleanup, fireEvent, render, screen } from '@solidjs/testing-library';
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
+import { TrueNASSettingsPanel } from '../TrueNASSettingsPanel';
+
+const mockState = vi.hoisted(() => ({
+ closeDeleteDialog: vi.fn(),
+ closeDialog: vi.fn(),
+ connections: vi.fn(() => []),
+ deleteDialogOpen: vi.fn(() => false),
+ deletePendingConnection: vi.fn(),
+ deleting: vi.fn(() => false),
+ dialogOpen: vi.fn(() => false),
+ editingConnection: vi.fn(() => null),
+ featureDisabled: vi.fn(() => false),
+ featureDisabledMessage: vi.fn(() => ''),
+ form: vi.fn(() => ({
+ name: '',
+ host: '',
+ port: '',
+ authMode: 'apiKey' as const,
+ apiKey: '',
+ username: '',
+ password: '',
+ useHttps: true,
+ insecureSkipVerify: false,
+ fingerprint: '',
+ enabled: true,
+ hasStoredApiKey: false,
+ hasStoredPassword: false,
+ })),
+ loadConnections: vi.fn(),
+ loading: vi.fn(() => false),
+ loadingError: vi.fn(() => null),
+ openCreateDialog: vi.fn(),
+ openDeleteDialog: vi.fn(),
+ openEditDialog: vi.fn(),
+ pendingDeleteConnection: vi.fn(() => null),
+ saveCurrentForm: vi.fn(),
+ saving: vi.fn(() => false),
+ testCurrentForm: vi.fn(),
+ testSavedConnection: vi.fn(),
+ testing: vi.fn(() => false),
+ updateForm: vi.fn(),
+}));
+
+vi.mock('../useTrueNASSettingsPanelState', () => ({
+ useTrueNASSettingsPanelState: () => mockState,
+}));
+
+describe('TrueNASSettingsPanel', () => {
+ beforeEach(() => {
+ Object.values(mockState).forEach((value) => {
+ if (typeof value === 'function' && 'mockReset' in value) {
+ value.mockReset();
+ }
+ });
+ mockState.connections.mockReturnValue([]);
+ mockState.deleteDialogOpen.mockReturnValue(false);
+ mockState.deleting.mockReturnValue(false);
+ mockState.dialogOpen.mockReturnValue(false);
+ mockState.editingConnection.mockReturnValue(null);
+ mockState.featureDisabled.mockReturnValue(false);
+ mockState.featureDisabledMessage.mockReturnValue('');
+ mockState.form.mockReturnValue({
+ name: '',
+ host: '',
+ port: '',
+ authMode: 'apiKey',
+ apiKey: '',
+ username: '',
+ password: '',
+ useHttps: true,
+ insecureSkipVerify: false,
+ fingerprint: '',
+ enabled: true,
+ hasStoredApiKey: false,
+ hasStoredPassword: false,
+ });
+ mockState.loading.mockReturnValue(false);
+ mockState.loadingError.mockReturnValue(null);
+ mockState.pendingDeleteConnection.mockReturnValue(null);
+ mockState.saving.mockReturnValue(false);
+ mockState.testing.mockReturnValue(false);
+ });
+
+ afterEach(() => {
+ cleanup();
+ });
+
+ it('renders the settings shell and existing connections', () => {
+ mockState.connections.mockReturnValue([
+ {
+ id: 'conn-1',
+ name: 'tower',
+ host: 'truenas.local',
+ port: 443,
+ apiKey: '********',
+ useHttps: true,
+ insecureSkipVerify: false,
+ enabled: true,
+ },
+ ]);
+
+ render(() => <TrueNASSettingsPanel />);
+
+ expect(screen.getByText('TrueNAS platform integration')).toBeInTheDocument();
+ expect(screen.getByText('TrueNAS connections')).toBeInTheDocument();
+ expect(screen.getByText('tower')).toBeInTheDocument();
+ expect(screen.getByText('API key auth')).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: 'Add TrueNAS connection' })).toBeInTheDocument();
+ fireEvent.click(screen.getByRole('button', { name: 'Add TrueNAS connection' }));
+ expect(mockState.openCreateDialog).toHaveBeenCalledTimes(1);
+ });
+
+ it('shows the feature gate warning when the backend path is disabled', () => {
+ mockState.featureDisabled.mockReturnValue(true);
+ mockState.featureDisabledMessage.mockReturnValue('truenas_disabled');
+
+ render(() => <TrueNASSettingsPanel />);
+
+ expect(screen.getByText('TrueNAS integration is disabled')).toBeInTheDocument();
+ expect(screen.getByText('truenas_disabled')).toBeInTheDocument();
+ expect(screen.queryByText('TrueNAS connections')).not.toBeInTheDocument();
+ });
+});
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
index c545f7d28b..3bd32e10c7 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
@@ -7,12 +7,15 @@ import settingsShellSource from '../SettingsPageShell.tsx?raw';
import settingsHeaderMetaSource from '../settingsHeaderMeta.ts?raw';
import infrastructureWorkspaceSource from '../InfrastructureWorkspace.tsx?raw';
import infrastructureWorkspaceModelSource from '../infrastructureWorkspaceModel.ts?raw';
+import platformConnectionsWorkspaceSource from '../PlatformConnectionsWorkspace.tsx?raw';
+import platformConnectionsModelSource from '../platformConnectionsModel.ts?raw';
import infrastructureInstallPanelSource from '../InfrastructureInstallPanel.tsx?raw';
import infrastructureInstallerSectionSource from '../InfrastructureInstallerSection.tsx?raw';
import infrastructureOperationsControllerSource from '../InfrastructureOperationsController.tsx?raw';
import infrastructureOperationsModelSource from '../infrastructureOperationsModel.tsx?raw';
import infrastructureReportingPanelSource from '../InfrastructureReportingPanel.tsx?raw';
import infrastructureDirectConnectionsSummaryCardSource from '../InfrastructureDirectConnectionsSummaryCard.tsx?raw';
+import trueNASSettingsPanelSource from '../TrueNASSettingsPanel.tsx?raw';
import infrastructureInventorySectionSource from '../InfrastructureInventorySection.tsx?raw';
import infrastructureActiveRowDetailsSource from '../InfrastructureActiveRowDetails.tsx?raw';
import infrastructureIgnoredRowDetailsSource from '../InfrastructureIgnoredRowDetails.tsx?raw';
@@ -27,6 +30,7 @@ import nodeModalSource from '../NodeModal.tsx?raw';
import infrastructureInstallStateSource from '../useInfrastructureInstallState.tsx?raw';
import infrastructureOperationsStateSource from '../useInfrastructureOperationsState.tsx?raw';
import infrastructureReportingStateSource from '../useInfrastructureReportingState.tsx?raw';
+import trueNASSettingsStateSource from '../useTrueNASSettingsPanelState.ts?raw';
import infrastructureSettingsStateSource from '../useInfrastructureSettingsState.ts?raw';
import infrastructureSettingsModelSource from '../infrastructureSettingsModel.ts?raw';
import infrastructureConfiguredNodesStateSource from '../useInfrastructureConfiguredNodesState.ts?raw';
@@ -164,9 +168,13 @@ const extractedModules = [
'../BackupTransferDialogs.tsx',
'../InfrastructureOperationsController.tsx',
'../infrastructureOperationsModel.tsx',
+ '../PlatformConnectionsWorkspace.tsx',
+ '../platformConnectionsModel.ts',
+ '../TrueNASSettingsPanel.tsx',
'../useInfrastructureInstallState.tsx',
'../useInfrastructureOperationsState.tsx',
'../useInfrastructureReportingState.tsx',
+ '../useTrueNASSettingsPanelState.ts',
'../infrastructureSettingsModel.ts',
'../useInfrastructureConfiguredNodesState.ts',
'../useInfrastructureDiscoveryRuntimeState.ts',
@@ -855,7 +863,15 @@ describe('Settings architecture guardrails', () => {
);
expect(infrastructureWorkspaceSource).not.toContain('createEffect(() =>');
expect(infrastructureWorkspaceSource).toContain('InfrastructureInstallPanel');
+ expect(infrastructureWorkspaceSource).toContain('PlatformConnectionsWorkspace');
expect(infrastructureWorkspaceSource).toContain('InfrastructureReportingPanel');
+ expect(platformConnectionsWorkspaceSource).toContain('./platformConnectionsModel');
+ expect(platformConnectionsWorkspaceSource).toContain('./ProxmoxSettingsPanel');
+ expect(platformConnectionsWorkspaceSource).toContain('./TrueNASSettingsPanel');
+ expect(platformConnectionsModelSource).toContain('export const PLATFORM_CONNECTIONS_TABS');
+ expect(platformConnectionsModelSource).toContain(
+ "export function getPlatformConnectionsViewFromPath",
+ );
expect(infrastructureInstallPanelSource).toContain('InfrastructureOperationsStateProvider');
expect(infrastructureInstallPanelSource).toContain('InfrastructureInstallerSection');
expect(infrastructureReportingPanelSource).toContain('InfrastructureOperationsStateProvider');
@@ -885,6 +901,9 @@ describe('Settings architecture guardrails', () => {
expect(infrastructureOperationsStateSource).toContain(
'export const useInfrastructureOperationsContext',
);
+ expect(trueNASSettingsPanelSource).toContain('./useTrueNASSettingsPanelState');
+ expect(trueNASSettingsStateSource).toContain('@/api/truenas');
+ expect(trueNASSettingsStateSource).toContain('export function useTrueNASSettingsPanelState');
expect(infrastructureOperationsStateSource).not.toContain('const renderInstallerSection =');
expect(infrastructureOperationsStateSource).not.toContain('const renderInventorySection =');
expect(infrastructureOperationsStateSource).not.toContain('const renderStopMonitoringDialog =');
@@ -913,7 +932,9 @@ describe('Settings architecture guardrails', () => {
expect(infrastructureDirectConnectionsSummaryCardSource).toContain(
'Direct Proxmox connections',
);
- expect(infrastructureDirectConnectionsSummaryCardSource).toContain('Manage direct connections');
+ expect(infrastructureDirectConnectionsSummaryCardSource).toContain(
+ 'Open platform connections',
+ );
expect(infrastructureInstallPanelSource).not.toContain('<PageHeader');
expect(infrastructureReportingPanelSource).not.toContain('<PageHeader');
});
@@ -1322,7 +1343,7 @@ describe('Settings architecture guardrails', () => {
'actively reporting',
);
expect(SETTINGS_HEADER_META['infrastructure-operations'].description).toBe(
- `Bring infrastructure into Pulse, manage direct Proxmox connections, and control which systems are actively reporting. ${SELF_HOSTED_PRO_BILLING_PRESENTATION.infrastructureRouteReferral}`,
+ `Bring infrastructure into Pulse, manage API-backed platform connections, and control which systems are actively reporting. ${SELF_HOSTED_PRO_BILLING_PRESENTATION.infrastructureRouteReferral}`,
);
});
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsNavigation.integration.test.tsx b/frontend-modern/src/components/Settings/__tests__/settingsNavigation.integration.test.tsx
index 56017b9b21..2fd37e79ae 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsNavigation.integration.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/settingsNavigation.integration.test.tsx
@@ -6,7 +6,7 @@ import { getSettingsTabSaveBehavior } from '../settingsTabSaveBehavior';
import { updateDisableLocalUpgradeMetricsSetting } from '@/stores/systemSettings';
const canonicalTabPaths = {
- proxmox: '/settings/infrastructure/proxmox',
+ proxmox: '/settings/infrastructure/platforms/proxmox',
'infrastructure-operations': '/settings/infrastructure/install',
'system-general': '/settings/system-general',
'system-network': '/settings/system-network',
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsRouting.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsRouting.test.ts
index 93e04942db..bd6678a6d1 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsRouting.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsRouting.test.ts
@@ -16,7 +16,7 @@ import {
import { isFeatureLocked, isTabLocked } from '../settingsFeatureGates';
const canonicalTabPaths = {
- proxmox: '/settings/infrastructure/proxmox',
+ proxmox: '/settings/infrastructure/platforms/proxmox',
'infrastructure-operations': '/settings/infrastructure/install',
'system-general': '/settings/system-general',
'system-network': '/settings/system-network',
@@ -75,13 +75,19 @@ describe('settingsNavigationModel', () => {
'/settings/infrastructure/install',
);
expect(resolveCanonicalSettingsPath('/settings/infrastructure/pve')).toBe(
- '/settings/infrastructure/proxmox/pve',
+ '/settings/infrastructure/platforms/proxmox/pve',
);
expect(resolveCanonicalSettingsPath('/settings/infrastructure/api')).toBe(
- '/settings/infrastructure/proxmox',
+ '/settings/infrastructure/platforms/proxmox',
);
expect(resolveCanonicalSettingsPath('/settings/infrastructure/api/pve')).toBe(
- '/settings/infrastructure/proxmox/pve',
+ '/settings/infrastructure/platforms/proxmox/pve',
+ );
+ expect(resolveCanonicalSettingsPath('/settings/infrastructure/proxmox')).toBe(
+ '/settings/infrastructure/platforms/proxmox',
+ );
+ expect(resolveCanonicalSettingsPath('/settings/infrastructure/truenas')).toBe(
+ '/settings/infrastructure/platforms/truenas',
);
expect(resolveCanonicalSettingsPath('/settings/integrations/api')).toBe(
'/settings/security/api',
@@ -157,9 +163,9 @@ describe('settingsNavigationModel', () => {
['/settings/infrastructure/api/pve', 'pve'],
['/settings/infrastructure/api/pbs', 'pbs'],
['/settings/infrastructure/api/pmg', 'pmg'],
- ['/settings/infrastructure/proxmox/pve', 'pve'],
- ['/settings/infrastructure/proxmox/pbs', 'pbs'],
- ['/settings/infrastructure/proxmox/pmg', 'pmg'],
+ ['/settings/infrastructure/platforms/proxmox/pve', 'pve'],
+ ['/settings/infrastructure/platforms/proxmox/pbs', 'pbs'],
+ ['/settings/infrastructure/platforms/proxmox/pmg', 'pmg'],
['/settings/infrastructure', null],
['/settings/infrastructure/operations', null],
];
@@ -169,17 +175,17 @@ describe('settingsNavigationModel', () => {
});
it('maps settings agent keys to canonical platform types, labels, and paths', () => {
- expect(settingsAgentPath('pve')).toBe('/settings/infrastructure/proxmox/pve');
+ expect(settingsAgentPath('pve')).toBe('/settings/infrastructure/platforms/proxmox/pve');
expect(settingsAgentPlatformType('pve')).toBe('proxmox-pve');
expect(settingsAgentLabel('pve')).toBe('Proxmox VE');
expect(settingsAgentNodeLabel('pve')).toBe('Proxmox VE node');
- expect(settingsAgentPath('pbs')).toBe('/settings/infrastructure/proxmox/pbs');
+ expect(settingsAgentPath('pbs')).toBe('/settings/infrastructure/platforms/proxmox/pbs');
expect(settingsAgentPlatformType('pbs')).toBe('proxmox-pbs');
expect(settingsAgentLabel('pbs')).toBe('Proxmox Backup Server');
expect(settingsAgentNodeLabel('pbs')).toBe('Proxmox Backup Server');
- expect(settingsAgentPath('pmg')).toBe('/settings/infrastructure/proxmox/pmg');
+ expect(settingsAgentPath('pmg')).toBe('/settings/infrastructure/platforms/proxmox/pmg');
expect(settingsAgentPlatformType('pmg')).toBe('proxmox-pmg');
expect(settingsAgentLabel('pmg')).toBe('Proxmox Mail Gateway');
expect(settingsAgentNodeLabel('pmg')).toBe('Proxmox Mail Gateway');
@@ -196,8 +202,13 @@ describe('settingsNavigationModel', () => {
});
it('treats proxmox deep links as infrastructure aliases', () => {
- expect(deriveTabFromPath('/settings/infrastructure/proxmox')).toBe('infrastructure-operations');
- expect(deriveTabFromPath('/settings/infrastructure/proxmox/pve')).toBe(
+ expect(deriveTabFromPath('/settings/infrastructure/platforms')).toBe(
+ 'infrastructure-operations',
+ );
+ expect(deriveTabFromPath('/settings/infrastructure/platforms/proxmox')).toBe(
+ 'infrastructure-operations',
+ );
+ expect(deriveTabFromPath('/settings/infrastructure/platforms/proxmox/pve')).toBe(
'infrastructure-operations',
);
expect(deriveTabFromPath('/settings/infrastructure/api/pve')).toBe(
diff --git a/frontend-modern/src/components/Settings/__tests__/useTrueNASSettingsPanelState.test.tsx b/frontend-modern/src/components/Settings/__tests__/useTrueNASSettingsPanelState.test.tsx
new file mode 100644
index 0000000000..10d7dd45cc
--- /dev/null
+++ b/frontend-modern/src/components/Settings/__tests__/useTrueNASSettingsPanelState.test.tsx
@@ -0,0 +1,102 @@
+import { renderHook, waitFor } from '@solidjs/testing-library';
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+import { TrueNASAPI } from '@/api/truenas';
+import { notificationStore } from '@/stores/notifications';
+import { useTrueNASSettingsPanelState } from '../useTrueNASSettingsPanelState';
+
+vi.mock('@/api/truenas', () => ({
+ TrueNASAPI: {
+ listConnections: vi.fn(),
+ createConnection: vi.fn(),
+ updateConnection: vi.fn(),
+ deleteConnection: vi.fn(),
+ testConnection: vi.fn(),
+ },
+ isRedactedTrueNASSecret: (value: string | null | undefined) => (value || '').trim() === '********',
+}));
+
+vi.mock('@/stores/notifications', () => ({
+ notificationStore: {
+ success: vi.fn(),
+ error: vi.fn(),
+ },
+}));
+
+vi.mock('@/utils/logger', () => ({
+ logger: {
+ error: vi.fn(),
+ },
+}));
+
+describe('useTrueNASSettingsPanelState', () => {
+ beforeEach(() => {
+ vi.clearAllMocks();
+ });
+
+ it('treats a 404 list response as a feature-disabled integration state', async () => {
+ vi.mocked(TrueNASAPI.listConnections).mockRejectedValueOnce({
+ status: 404,
+ message: 'truenas_disabled',
+ });
+
+ const { result } = renderHook(() => useTrueNASSettingsPanelState());
+
+ await waitFor(() => expect(result.featureDisabled()).toBe(true));
+ expect(result.featureDisabledMessage()).toBe('truenas_disabled');
+ expect(result.connections()).toEqual([]);
+ });
+
+ it('preserves masked API keys when editing an existing connection without replacing the secret', async () => {
+ vi.mocked(TrueNASAPI.listConnections).mockResolvedValueOnce([
+ {
+ id: 'conn-1',
+ name: 'tower',
+ host: 'truenas.local',
+ apiKey: '********',
+ useHttps: true,
+ insecureSkipVerify: false,
+ enabled: true,
+ },
+ ] as never);
+ vi.mocked(TrueNASAPI.updateConnection).mockResolvedValueOnce({
+ id: 'conn-1',
+ name: 'tower',
+ host: 'truenas.local',
+ apiKey: '********',
+ useHttps: true,
+ insecureSkipVerify: false,
+ enabled: true,
+ } as never);
+ vi.mocked(TrueNASAPI.listConnections).mockResolvedValueOnce([
+ {
+ id: 'conn-1',
+ name: 'tower',
+ host: 'truenas.local',
+ apiKey: '********',
+ useHttps: true,
+ insecureSkipVerify: false,
+ enabled: true,
+ },
+ ] as never);
+
+ const { result } = renderHook(() => useTrueNASSettingsPanelState());
+
+ await waitFor(() => expect(result.connections()).toHaveLength(1));
+
+ result.openEditDialog(result.connections()[0]);
+ expect(result.dialogOpen()).toBe(true);
+ await result.saveCurrentForm();
+
+ expect(TrueNASAPI.updateConnection).toHaveBeenCalledWith(
+ 'conn-1',
+ expect.objectContaining({
+ host: 'truenas.local',
+ apiKey: '********',
+ username: '',
+ password: '',
+ }),
+ );
+ expect(result.dialogOpen()).toBe(false);
+ expect(notificationStore.success).toHaveBeenCalledWith('TrueNAS connection updated');
+ });
+});
diff --git a/frontend-modern/src/components/Settings/infrastructureWorkspaceModel.ts b/frontend-modern/src/components/Settings/infrastructureWorkspaceModel.ts
index 5da9ac84ad..139879b65c 100644
--- a/frontend-modern/src/components/Settings/infrastructureWorkspaceModel.ts
+++ b/frontend-modern/src/components/Settings/infrastructureWorkspaceModel.ts
@@ -1,4 +1,4 @@
-export type InfrastructureWorkspaceView = 'install' | 'direct' | 'inventory';
+export type InfrastructureWorkspaceView = 'install' | 'platforms' | 'inventory';
export interface InfrastructureWorkspaceTabDefinition {
id: InfrastructureWorkspaceView;
@@ -13,9 +13,9 @@ export const INFRASTRUCTURE_WORKSPACE_TABS: readonly InfrastructureWorkspaceTabD
path: '/settings/infrastructure/install',
},
{
- id: 'direct',
- label: 'Direct Proxmox',
- path: '/settings/infrastructure/proxmox',
+ id: 'platforms',
+ label: 'Platform connections',
+ path: '/settings/infrastructure/platforms',
},
{
id: 'inventory',
@@ -27,8 +27,13 @@ export const INFRASTRUCTURE_WORKSPACE_TABS: readonly InfrastructureWorkspaceTabD
export function getInfrastructureWorkspaceViewFromPath(
pathname: string,
): InfrastructureWorkspaceView {
- if (pathname.startsWith('/settings/infrastructure/proxmox')) {
- return 'direct';
+ if (
+ pathname.startsWith('/settings/infrastructure/platforms') ||
+ pathname.startsWith('/settings/infrastructure/proxmox') ||
+ pathname.startsWith('/settings/infrastructure/api') ||
+ pathname.startsWith('/settings/infrastructure/truenas')
+ ) {
+ return 'platforms';
}
if (pathname.startsWith('/settings/infrastructure/operations')) {
return 'inventory';
diff --git a/frontend-modern/src/components/Settings/platformConnectionsModel.ts b/frontend-modern/src/components/Settings/platformConnectionsModel.ts
new file mode 100644
index 0000000000..80e541d2c2
--- /dev/null
+++ b/frontend-modern/src/components/Settings/platformConnectionsModel.ts
@@ -0,0 +1,53 @@
+export type PlatformConnectionsView = 'proxmox' | 'truenas';
+
+export interface PlatformConnectionsTabDefinition {
+ id: PlatformConnectionsView;
+ label: string;
+ path: string;
+}
+
+export const PLATFORM_CONNECTIONS_PREFIX = '/settings/infrastructure/platforms';
+const PLATFORM_CONNECTIONS_PROXMOX_PREFIX = `${PLATFORM_CONNECTIONS_PREFIX}/proxmox`;
+const PLATFORM_CONNECTIONS_TRUENAS_PREFIX = `${PLATFORM_CONNECTIONS_PREFIX}/truenas`;
+const LEGACY_PROXMOX_PREFIX = '/settings/infrastructure/proxmox';
+const LEGACY_PROXMOX_API_PREFIX = '/settings/infrastructure/api';
+const LEGACY_TRUENAS_PREFIX = '/settings/infrastructure/truenas';
+
+export const PLATFORM_CONNECTIONS_TABS: readonly PlatformConnectionsTabDefinition[] = [
+ {
+ id: 'proxmox',
+ label: 'Proxmox',
+ path: PLATFORM_CONNECTIONS_PROXMOX_PREFIX,
+ },
+ {
+ id: 'truenas',
+ label: 'TrueNAS',
+ path: PLATFORM_CONNECTIONS_TRUENAS_PREFIX,
+ },
+];
+
+export function getPlatformConnectionsViewFromPath(pathname: string): PlatformConnectionsView {
+ if (pathname.startsWith(PLATFORM_CONNECTIONS_TRUENAS_PREFIX)) {
+ return 'truenas';
+ }
+ if (pathname.startsWith(LEGACY_TRUENAS_PREFIX)) {
+ return 'truenas';
+ }
+ if (pathname.startsWith(PLATFORM_CONNECTIONS_PREFIX)) {
+ return 'proxmox';
+ }
+ if (
+ pathname.startsWith(LEGACY_PROXMOX_PREFIX) ||
+ pathname.startsWith(LEGACY_PROXMOX_API_PREFIX)
+ ) {
+ return 'proxmox';
+ }
+ return 'proxmox';
+}
+
+export function buildPlatformConnectionsPath(view: PlatformConnectionsView): string {
+ return (
+ PLATFORM_CONNECTIONS_TABS.find((tab) => tab.id === view)?.path ??
+ PLATFORM_CONNECTIONS_PROXMOX_PREFIX
+ );
+}
diff --git a/frontend-modern/src/components/Settings/settingsHeaderMeta.ts b/frontend-modern/src/components/Settings/settingsHeaderMeta.ts
index 0ec45f0c4a..481caa2f04 100644
--- a/frontend-modern/src/components/Settings/settingsHeaderMeta.ts
+++ b/frontend-modern/src/components/Settings/settingsHeaderMeta.ts
@@ -11,7 +11,7 @@ export const SETTINGS_HEADER_META: SettingsHeaderMetaMap = {
'infrastructure-operations': {
title: 'Infrastructure Operations',
description:
- `Bring infrastructure into Pulse, manage direct Proxmox connections, and control which systems are actively reporting. ${SELF_HOSTED_PRO_BILLING_PRESENTATION.infrastructureRouteReferral}`,
+ `Bring infrastructure into Pulse, manage API-backed platform connections, and control which systems are actively reporting. ${SELF_HOSTED_PRO_BILLING_PRESENTATION.infrastructureRouteReferral}`,
},
'system-general': {
title: 'General',
diff --git a/frontend-modern/src/components/Settings/settingsNavigationModel.ts b/frontend-modern/src/components/Settings/settingsNavigationModel.ts
index 201e3068f3..772fe9b79f 100644
--- a/frontend-modern/src/components/Settings/settingsNavigationModel.ts
+++ b/frontend-modern/src/components/Settings/settingsNavigationModel.ts
@@ -71,7 +71,10 @@ const LEGACY_AGENTS_PREFIX = '/settings/workloads';
const LEGACY_DOCKER_PREFIX = '/settings/workloads/docker';
const INFRASTRUCTURE_INSTALL_PREFIX = '/settings/infrastructure/install';
const INFRASTRUCTURE_OPERATIONS_PREFIX = '/settings/infrastructure/operations';
-const PROXMOX_PREFIX = '/settings/infrastructure/proxmox';
+const PLATFORM_CONNECTIONS_PREFIX = '/settings/infrastructure/platforms';
+const TRUENAS_PREFIX = `${PLATFORM_CONNECTIONS_PREFIX}/truenas`;
+const PROXMOX_PREFIX = `${PLATFORM_CONNECTIONS_PREFIX}/proxmox`;
+const LEGACY_PROXMOX_PREFIX = '/settings/infrastructure/proxmox';
const LEGACY_PROXMOX_API_PREFIX = '/settings/infrastructure/api';
const LEGACY_INTEGRATIONS_API_PREFIX = '/settings/integrations/api';
const SECURITY_API_PREFIX = '/settings/security/api';
@@ -128,12 +131,21 @@ export function resolveCanonicalSettingsPath(path: string): string | null {
if (normalizedPath === LEGACY_INFRASTRUCTURE_PREFIX) {
return settingsTabPath(DEFAULT_SETTINGS_TAB);
}
+ if (normalizedPath === PLATFORM_CONNECTIONS_PREFIX) {
+ return PLATFORM_CONNECTIONS_PREFIX;
+ }
if (normalizedPath === LEGACY_DOCKER_PREFIX) {
return settingsTabPath(DEFAULT_SETTINGS_TAB);
}
if (normalizedPath === LEGACY_PROXMOX_API_PREFIX) {
return PROXMOX_PREFIX;
}
+ if (normalizedPath === LEGACY_PROXMOX_PREFIX) {
+ return PROXMOX_PREFIX;
+ }
+ if (normalizedPath === '/settings/infrastructure/truenas') {
+ return TRUENAS_PREFIX;
+ }
if (normalizedPath === `${LEGACY_INFRASTRUCTURE_PREFIX}/pve`) {
return `${PROXMOX_PREFIX}/pve`;
}
@@ -152,6 +164,15 @@ export function resolveCanonicalSettingsPath(path: string): string | null {
if (normalizedPath === `${LEGACY_PROXMOX_API_PREFIX}/pmg`) {
return `${PROXMOX_PREFIX}/pmg`;
}
+ if (normalizedPath === `${LEGACY_PROXMOX_PREFIX}/pve`) {
+ return `${PROXMOX_PREFIX}/pve`;
+ }
+ if (normalizedPath === `${LEGACY_PROXMOX_PREFIX}/pbs`) {
+ return `${PROXMOX_PREFIX}/pbs`;
+ }
+ if (normalizedPath === `${LEGACY_PROXMOX_PREFIX}/pmg`) {
+ return `${PROXMOX_PREFIX}/pmg`;
+ }
if (normalizedPath === LEGACY_INTEGRATIONS_API_PREFIX) {
return SECURITY_API_PREFIX;
}
@@ -167,11 +188,17 @@ export function deriveTabFromPath(path: string): SettingsTab {
if (canonicalPath === '/settings') return DEFAULT_SETTINGS_TAB;
if (
canonicalPath === INFRASTRUCTURE_INSTALL_PREFIX ||
+ canonicalPath === PLATFORM_CONNECTIONS_PREFIX ||
canonicalPath === INFRASTRUCTURE_OPERATIONS_PREFIX
) {
return 'infrastructure-operations';
}
- if (canonicalPath.includes(PROXMOX_PREFIX) || canonicalPath.includes(LEGACY_PROXMOX_API_PREFIX))
+ if (
+ canonicalPath.includes(PROXMOX_PREFIX) ||
+ canonicalPath.includes(TRUENAS_PREFIX) ||
+ canonicalPath.includes(LEGACY_PROXMOX_PREFIX) ||
+ canonicalPath.includes(LEGACY_PROXMOX_API_PREFIX)
+ )
return 'infrastructure-operations';
if (canonicalPath.includes('/settings/system-general')) return 'system-general';
diff --git a/frontend-modern/src/components/Settings/useInfrastructureInstallState.tsx b/frontend-modern/src/components/Settings/useInfrastructureInstallState.tsx
index c0bf91824d..841e82c6b7 100644
--- a/frontend-modern/src/components/Settings/useInfrastructureInstallState.tsx
+++ b/frontend-modern/src/components/Settings/useInfrastructureInstallState.tsx
@@ -17,6 +17,7 @@ import { getPulseBaseUrl } from '@/utils/url';
import { logger } from '@/utils/logger';
import { STORAGE_KEYS } from '@/utils/localStorage';
import { buildInfrastructureWorkspacePath } from './infrastructureWorkspaceModel';
+import { buildPlatformConnectionsPath } from './platformConnectionsModel';
import {
buildUnixAgentInstallCommand,
buildWindowsAgentInstallCommand,
@@ -471,7 +472,7 @@ Pulse prepares the first-host install token from setup so you can move straight
});
const openDirectProxmoxSetup = () => {
- navigate('/settings/infrastructure/proxmox');
+ navigate(buildPlatformConnectionsPath('proxmox'));
};
const openDashboard = () => {
diff --git a/frontend-modern/src/components/Settings/useTrueNASSettingsPanelState.ts b/frontend-modern/src/components/Settings/useTrueNASSettingsPanelState.ts
new file mode 100644
index 0000000000..881e0f5711
--- /dev/null
+++ b/frontend-modern/src/components/Settings/useTrueNASSettingsPanelState.ts
@@ -0,0 +1,315 @@
+import { createMemo, createSignal, onMount } from 'solid-js';
+import { notificationStore } from '@/stores/notifications';
+import { logger } from '@/utils/logger';
+import { apiErrorStatus } from '@/api/responseUtils';
+import {
+ TrueNASAPI,
+ isRedactedTrueNASSecret,
+ type TrueNASConnection,
+ type TrueNASConnectionInput,
+} from '@/api/truenas';
+
+type TrueNASAuthMode = 'apiKey' | 'userpass';
+
+export interface TrueNASConnectionFormState {
+ name: string;
+ host: string;
+ port: string;
+ authMode: TrueNASAuthMode;
+ apiKey: string;
+ username: string;
+ password: string;
+ useHttps: boolean;
+ insecureSkipVerify: boolean;
+ fingerprint: string;
+ enabled: boolean;
+ hasStoredApiKey: boolean;
+ hasStoredPassword: boolean;
+}
+
+const REDACTED_SECRET = '********';
+
+const createEmptyFormState = (): TrueNASConnectionFormState => ({
+ name: '',
+ host: '',
+ port: '',
+ authMode: 'apiKey',
+ apiKey: '',
+ username: '',
+ password: '',
+ useHttps: true,
+ insecureSkipVerify: false,
+ fingerprint: '',
+ enabled: true,
+ hasStoredApiKey: false,
+ hasStoredPassword: false,
+});
+
+const buildFormStateFromConnection = (connection: TrueNASConnection): TrueNASConnectionFormState => {
+ const hasStoredAPIKey = isRedactedTrueNASSecret(connection.apiKey);
+ const hasStoredPassword = isRedactedTrueNASSecret(connection.password);
+ const authMode: TrueNASAuthMode =
+ hasStoredAPIKey || Boolean((connection.apiKey || '').trim()) ? 'apiKey' : 'userpass';
+
+ return {
+ name: connection.name || '',
+ host: connection.host || '',
+ port: connection.port ? String(connection.port) : '',
+ authMode,
+ apiKey: '',
+ username: authMode === 'userpass' ? connection.username || '' : '',
+ password: '',
+ useHttps: connection.useHttps,
+ insecureSkipVerify: connection.insecureSkipVerify,
+ fingerprint: connection.fingerprint || '',
+ enabled: connection.enabled,
+ hasStoredApiKey: hasStoredAPIKey,
+ hasStoredPassword: hasStoredPassword,
+ };
+};
+
+const parseOptionalPort = (value: string): number | undefined => {
+ const trimmed = value.trim();
+ if (!trimmed) return undefined;
+ const parsed = Number(trimmed);
+ if (!Number.isInteger(parsed) || parsed < 1 || parsed > 65535) {
+ throw new Error('Port must be a whole number between 1 and 65535');
+ }
+ return parsed;
+};
+
+const getErrorMessage = (error: unknown, fallback: string): string => {
+ if (error instanceof Error && error.message.trim()) {
+ return error.message;
+ }
+ if (
+ error &&
+ typeof error === 'object' &&
+ 'message' in error &&
+ typeof (error as { message?: unknown }).message === 'string'
+ ) {
+ const message = (error as { message: string }).message.trim();
+ if (message) {
+ return message;
+ }
+ }
+ return fallback;
+};
+
+const buildConnectionInput = (form: TrueNASConnectionFormState): TrueNASConnectionInput => {
+ const port = parseOptionalPort(form.port);
+ const name = form.name.trim();
+ const host = form.host.trim();
+ const fingerprint = form.fingerprint.trim();
+
+ const input: TrueNASConnectionInput = {
+ ...(name ? { name } : {}),
+ host,
+ ...(port !== undefined ? { port } : {}),
+ useHttps: form.useHttps,
+ insecureSkipVerify: form.insecureSkipVerify,
+ ...(fingerprint ? { fingerprint } : {}),
+ enabled: form.enabled,
+ };
+
+ if (form.authMode === 'apiKey') {
+ input.apiKey = form.apiKey.trim() || (form.hasStoredApiKey ? REDACTED_SECRET : '');
+ input.username = '';
+ input.password = '';
+ } else {
+ input.apiKey = '';
+ input.username = form.username.trim();
+ input.password = form.password.trim() || (form.hasStoredPassword ? REDACTED_SECRET : '');
+ }
+
+ return input;
+};
+
+export function useTrueNASSettingsPanelState() {
+ const [connections, setConnections] = createSignal<TrueNASConnection[]>([]);
+ const [loading, setLoading] = createSignal(true);
+ const [loadingError, setLoadingError] = createSignal<string | null>(null);
+ const [featureDisabled, setFeatureDisabled] = createSignal(false);
+ const [featureDisabledMessage, setFeatureDisabledMessage] = createSignal<string>('');
+ const [dialogOpen, setDialogOpen] = createSignal(false);
+ const [deleteDialogOpen, setDeleteDialogOpen] = createSignal(false);
+ const [editingConnectionId, setEditingConnectionId] = createSignal<string | null>(null);
+ const [pendingDeleteConnection, setPendingDeleteConnection] = createSignal<TrueNASConnection | null>(
+ null,
+ );
+ const [form, setForm] = createSignal<TrueNASConnectionFormState>(createEmptyFormState());
+ const [saving, setSaving] = createSignal(false);
+ const [testing, setTesting] = createSignal(false);
+ const [deleting, setDeleting] = createSignal(false);
+
+ const editingConnection = createMemo(() =>
+ connections().find((connection) => connection.id === editingConnectionId()) ?? null,
+ );
+
+ const loadConnections = async () => {
+ setLoading(true);
+ setLoadingError(null);
+ try {
+ const nextConnections = await TrueNASAPI.listConnections();
+ setConnections(nextConnections);
+ setFeatureDisabled(false);
+ setFeatureDisabledMessage('');
+ } catch (error) {
+ if (apiErrorStatus(error) === 404) {
+ setFeatureDisabled(true);
+ setFeatureDisabledMessage(getErrorMessage(error, 'TrueNAS integration is not enabled'));
+ setConnections([]);
+ return;
+ }
+ const message = getErrorMessage(error, 'Failed to load TrueNAS connections');
+ setLoadingError(message);
+ logger.error('[TrueNAS Settings] Failed to load connections', error);
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ onMount(() => {
+ void loadConnections();
+ });
+
+ const openCreateDialog = () => {
+ setEditingConnectionId(null);
+ setForm(createEmptyFormState());
+ setDialogOpen(true);
+ };
+
+ const openEditDialog = (connection: TrueNASConnection) => {
+ setEditingConnectionId(connection.id);
+ setForm(buildFormStateFromConnection(connection));
+ setDialogOpen(true);
+ };
+
+ const resetDialogState = () => {
+ setDialogOpen(false);
+ setEditingConnectionId(null);
+ setForm(createEmptyFormState());
+ };
+
+ const closeDialog = () => {
+ if (saving() || testing()) return;
+ resetDialogState();
+ };
+
+ const openDeleteDialog = (connection: TrueNASConnection) => {
+ setPendingDeleteConnection(connection);
+ setDeleteDialogOpen(true);
+ };
+
+ const resetDeleteDialogState = () => {
+ setDeleteDialogOpen(false);
+ setPendingDeleteConnection(null);
+ };
+
+ const closeDeleteDialog = () => {
+ if (deleting()) return;
+ resetDeleteDialogState();
+ };
+
+ const updateForm = (patch: Partial<TrueNASConnectionFormState>) =>
+ setForm((current) => ({ ...current, ...patch }));
+
+ const testCurrentForm = async () => {
+ setTesting(true);
+ try {
+ await TrueNASAPI.testConnection(buildConnectionInput(form()));
+ notificationStore.success('TrueNAS connection successful');
+ return true;
+ } catch (error) {
+ const message = getErrorMessage(error, 'TrueNAS connection failed');
+ notificationStore.error(message);
+ logger.error('[TrueNAS Settings] Connection test failed', error);
+ return false;
+ } finally {
+ setTesting(false);
+ }
+ };
+
+ const testSavedConnection = async (connection: TrueNASConnection) => {
+ setTesting(true);
+ try {
+ await TrueNASAPI.testConnection(buildConnectionInput(buildFormStateFromConnection(connection)));
+ notificationStore.success(`TrueNAS connection successful for ${connection.name || connection.host}`);
+ } catch (error) {
+ const message = getErrorMessage(error, 'TrueNAS connection failed');
+ notificationStore.error(message);
+ logger.error('[TrueNAS Settings] Saved connection test failed', error);
+ } finally {
+ setTesting(false);
+ }
+ };
+
+ const saveCurrentForm = async () => {
+ setSaving(true);
+ try {
+ const payload = buildConnectionInput(form());
+ if (editingConnectionId()) {
+ await TrueNASAPI.updateConnection(editingConnectionId()!, payload);
+ notificationStore.success('TrueNAS connection updated');
+ } else {
+ await TrueNASAPI.createConnection(payload);
+ notificationStore.success('TrueNAS connection added');
+ }
+ resetDialogState();
+ await loadConnections();
+ } catch (error) {
+ const message = getErrorMessage(error, 'Failed to save TrueNAS connection');
+ notificationStore.error(message);
+ logger.error('[TrueNAS Settings] Save failed', error);
+ } finally {
+ setSaving(false);
+ }
+ };
+
+ const deletePendingConnection = async () => {
+ const connection = pendingDeleteConnection();
+ if (!connection) return;
+ setDeleting(true);
+ try {
+ await TrueNASAPI.deleteConnection(connection.id);
+ notificationStore.success(`Removed ${connection.name || connection.host}`);
+ resetDeleteDialogState();
+ await loadConnections();
+ } catch (error) {
+ const message = getErrorMessage(error, 'Failed to remove TrueNAS connection');
+ notificationStore.error(message);
+ logger.error('[TrueNAS Settings] Delete failed', error);
+ } finally {
+ setDeleting(false);
+ }
+ };
+
+ return {
+ closeDeleteDialog,
+ closeDialog,
+ connections,
+ deleteDialogOpen,
+ deletePendingConnection,
+ deleting,
+ dialogOpen,
+ editingConnection,
+ featureDisabled,
+ featureDisabledMessage,
+ form,
+ loadConnections,
+ loading,
+ loadingError,
+ openCreateDialog,
+ openDeleteDialog,
+ openEditDialog,
+ pendingDeleteConnection,
+ saveCurrentForm,
+ saving,
+ testCurrentForm,
+ testSavedConnection,
+ testing,
+ updateForm,
+ };
+}
+
+export default useTrueNASSettingsPanelState;
diff --git a/frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx b/frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx
index 3f54f6fe6c..1f49f73ae2 100644
--- a/frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx
+++ b/frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx
@@ -71,7 +71,7 @@ const UNIFIED_RESOURCE_GUIDANCE = {
inventoryFacts: [
'Start with one host, then add more systems later from the same install workspace.',
'Infrastructure Install owns the token, connection URL, TLS/CA settings, and platform-specific commands.',
- 'Direct Proxmox stays available as an alternative path when you need it.',
+ 'Platform connections remains available for API-backed platforms like Proxmox and TrueNAS when you need it.',
],
} as const;
diff --git a/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.guardrails.test.ts b/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.guardrails.test.ts
index abd0fe281d..4b7c9b2c82 100644
--- a/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.guardrails.test.ts
+++ b/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.guardrails.test.ts
@@ -31,6 +31,9 @@ describe('SetupCompletionPanel guardrails', () => {
expect(setupCompletionPanelSource).toContain('What to expect');
expect(setupCompletionPanelSource).toContain('First host first');
expect(setupCompletionPanelSource).toContain('Start with one host, then add more systems later from the same install workspace.');
+ expect(setupCompletionPanelSource).toContain(
+ 'Platform connections remains available for API-backed platforms like Proxmox and TrueNAS when you need it.',
+ );
expect(setupCompletionPanelSource).not.toContain('Smart Auto-Detection');
expect(setupCompletionPanelSource).not.toContain('Agent Metrics');
expect(setupCompletionPanelSource).not.toContain('ProxmoxIcon');
diff --git a/frontend-modern/src/routing/__tests__/platformTabs.test.ts b/frontend-modern/src/routing/__tests__/platformTabs.test.ts
index d043cedcf1..6c6fd703fb 100644
--- a/frontend-modern/src/routing/__tests__/platformTabs.test.ts
+++ b/frontend-modern/src/routing/__tests__/platformTabs.test.ts
@@ -10,7 +10,7 @@ describe('buildStorageRecoveryTabSpecs', () => {
expect(specs.map((spec) => spec.label)).toEqual(['Storage', 'Recovery']);
expect(specs.map((spec) => spec.route)).toEqual([buildStoragePath(), buildRecoveryPath()]);
expect(specs.map((spec) => spec.settingsRoute)).toEqual([
- '/settings/infrastructure/api/pbs',
+ '/settings/infrastructure/platforms/proxmox/pbs',
'/settings/system-recovery',
]);
expect(specs.every((spec) => spec.badge === undefined)).toBe(true);
diff --git a/frontend-modern/src/routing/platformTabs.ts b/frontend-modern/src/routing/platformTabs.ts
index daa68e4064..e6ecefc243 100644
--- a/frontend-modern/src/routing/platformTabs.ts
+++ b/frontend-modern/src/routing/platformTabs.ts
@@ -19,7 +19,7 @@ export function buildStorageRecoveryTabSpecs(): StorageRecoveryTabSpec[] {
id: 'storage',
label: 'Storage',
route: buildStoragePath(),
- settingsRoute: '/settings/infrastructure/api/pbs',
+ settingsRoute: '/settings/infrastructure/platforms/proxmox/pbs',
tooltip: 'Storage pools, disks, and datastores',
},
{
diff --git a/frontend-modern/src/utils/__tests__/dashboardEmptyStatePresentation.test.ts b/frontend-modern/src/utils/__tests__/dashboardEmptyStatePresentation.test.ts
index 914b81eb1d..9a72b65596 100644
--- a/frontend-modern/src/utils/__tests__/dashboardEmptyStatePresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/dashboardEmptyStatePresentation.test.ts
@@ -14,7 +14,7 @@ describe('dashboardEmptyStatePresentation', () => {
expect(getDashboardInfrastructureEmptyState()).toEqual({
title: 'No infrastructure hosts connected',
description:
- 'To start using Pulse, first add your infrastructure in Settings → Infrastructure → Install on a host. If you want to connect Proxmox directly instead, use Settings → Infrastructure → Direct Proxmox.',
+ 'To start using Pulse, first add your infrastructure in Settings → Infrastructure → Install on a host. If you want an API-backed platform integration instead, use Settings → Infrastructure → Platform connections.',
actionLabel: 'Open infrastructure setup',
});
});
diff --git a/frontend-modern/src/utils/__tests__/infrastructureEmptyStatePresentation.test.ts b/frontend-modern/src/utils/__tests__/infrastructureEmptyStatePresentation.test.ts
index eec6009826..545b7078c8 100644
--- a/frontend-modern/src/utils/__tests__/infrastructureEmptyStatePresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/infrastructureEmptyStatePresentation.test.ts
@@ -10,7 +10,7 @@ describe('infrastructureEmptyStatePresentation', () => {
expect(getInfrastructureEmptyState()).toEqual({
title: 'No infrastructure resources yet',
description:
- 'Start by opening Settings → Infrastructure → Install on a host and adding the first system you want Pulse to monitor. If you prefer a direct Proxmox connection instead, use Direct Proxmox.',
+ 'Start by opening Settings → Infrastructure → Install on a host and adding the first system you want Pulse to monitor. If you prefer an API-backed platform integration instead, use Platform connections.',
actionLabel: 'Open Infrastructure Install',
});
});
diff --git a/frontend-modern/src/utils/dashboardEmptyStatePresentation.ts b/frontend-modern/src/utils/dashboardEmptyStatePresentation.ts
index e109a4cda8..b672e8b028 100644
--- a/frontend-modern/src/utils/dashboardEmptyStatePresentation.ts
+++ b/frontend-modern/src/utils/dashboardEmptyStatePresentation.ts
@@ -2,7 +2,7 @@ export function getDashboardInfrastructureEmptyState() {
return {
title: 'No infrastructure hosts connected',
description:
- 'To start using Pulse, first add your infrastructure in Settings → Infrastructure → Install on a host. If you want to connect Proxmox directly instead, use Settings → Infrastructure → Direct Proxmox.',
+ 'To start using Pulse, first add your infrastructure in Settings → Infrastructure → Install on a host. If you want an API-backed platform integration instead, use Settings → Infrastructure → Platform connections.',
actionLabel: 'Open infrastructure setup',
} as const;
}
diff --git a/frontend-modern/src/utils/infrastructureEmptyStatePresentation.ts b/frontend-modern/src/utils/infrastructureEmptyStatePresentation.ts
index 9f5fb48e12..dda60703ce 100644
--- a/frontend-modern/src/utils/infrastructureEmptyStatePresentation.ts
+++ b/frontend-modern/src/utils/infrastructureEmptyStatePresentation.ts
@@ -2,7 +2,7 @@ export function getInfrastructureEmptyState() {
return {
title: 'No infrastructure resources yet',
description:
- 'Start by opening Settings → Infrastructure → Install on a host and adding the first system you want Pulse to monitor. If you prefer a direct Proxmox connection instead, use Direct Proxmox.',
+ 'Start by opening Settings → Infrastructure → Install on a host and adding the first system you want Pulse to monitor. If you prefer an API-backed platform integration instead, use Platform connections.',
actionLabel: 'Open Infrastructure Install',
} as const;
}
diff --git a/internal/api/router_routes_registration.go b/internal/api/router_routes_registration.go
index 750eb9a047..f817b76d13 100644
--- a/internal/api/router_routes_registration.go
+++ b/internal/api/router_routes_registration.go
@@ -214,6 +214,8 @@ func (r *Router) registerConfigSystemRoutes(updateHandlers *UpdateHandlers) {
if req.Method == http.MethodDelete {
RequireAdmin(r.config, RequireScope(config.ScopeSettingsWrite, r.trueNASHandlers.HandleDelete))(w, req)
+ } else if req.Method == http.MethodPut {
+ RequireAdmin(r.config, RequireScope(config.ScopeSettingsWrite, r.trueNASHandlers.HandleUpdate))(w, req)
} else {
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
}
diff --git a/internal/api/truenas_handlers.go b/internal/api/truenas_handlers.go
index 84e8312858..e6f88cfea7 100644
--- a/internal/api/truenas_handlers.go
+++ b/internal/api/truenas_handlers.go
@@ -163,6 +163,78 @@ func (h *TrueNASHandlers) HandleDelete(w http.ResponseWriter, r *http.Request) {
})
}
+// HandleUpdate replaces a configured TrueNAS connection by ID while preserving
+// unchanged masked secrets from the stored record.
+func (h *TrueNASHandlers) HandleUpdate(w http.ResponseWriter, r *http.Request) {
+ if !h.featureEnabled(w) {
+ return
+ }
+ if mock.IsMockEnabled() {
+ writeErrorResponse(w, http.StatusForbidden, "mock_mode_enabled", "Cannot modify connections in mock mode", nil)
+ return
+ }
+
+ connectionID, ok := trueNASConnectionIDFromPath(r.URL.Path)
+ if !ok {
+ writeErrorResponse(w, http.StatusBadRequest, "missing_connection_id", "Connection ID is required", nil)
+ return
+ }
+
+ r.Body = http.MaxBytesReader(w, r.Body, 32*1024)
+ defer r.Body.Close()
+
+ var instance config.TrueNASInstance
+ if err := json.NewDecoder(r.Body).Decode(&instance); err != nil {
+ writeErrorResponse(w, http.StatusBadRequest, "invalid_request", "Invalid request body", map[string]string{"error": err.Error()})
+ return
+ }
+
+ instance.ID = connectionID
+ instance.Name = strings.TrimSpace(instance.Name)
+ instance.Host = strings.TrimSpace(instance.Host)
+ instance.APIKey = strings.TrimSpace(instance.APIKey)
+ instance.Username = strings.TrimSpace(instance.Username)
+ instance.Password = strings.TrimSpace(instance.Password)
+ instance.Fingerprint = strings.TrimSpace(instance.Fingerprint)
+
+ persistence := h.persistenceForRequest(w, r.Context())
+ if persistence == nil {
+ return
+ }
+
+ instances, err := persistence.LoadTrueNASConfig()
+ if err != nil {
+ writeErrorResponse(w, http.StatusInternalServerError, "truenas_load_failed", "Failed to load TrueNAS configuration", map[string]string{"error": err.Error()})
+ return
+ }
+
+ index := -1
+ for i := range instances {
+ if strings.TrimSpace(instances[i].ID) == connectionID {
+ index = i
+ break
+ }
+ }
+ if index < 0 {
+ writeErrorResponse(w, http.StatusNotFound, "truenas_not_found", "Connection not found", nil)
+ return
+ }
+
+ instance.PreserveMaskedSecrets(instances[index])
+ if err := instance.Validate(); err != nil {
+ writeErrorResponse(w, http.StatusBadRequest, "validation_error", err.Error(), nil)
+ return
+ }
+
+ instances[index] = instance
+ if err := persistence.SaveTrueNASConfig(instances); err != nil {
+ writeErrorResponse(w, http.StatusInternalServerError, "truenas_save_failed", "Failed to save TrueNAS configuration", map[string]string{"error": err.Error()})
+ return
+ }
+
+ writeJSON(w, http.StatusOK, instance.Redacted())
+}
+
// HandleTestConnection validates connectivity for a proposed TrueNAS connection.
func (h *TrueNASHandlers) HandleTestConnection(w http.ResponseWriter, r *http.Request) {
if !h.featureEnabled(w) {
diff --git a/internal/api/truenas_handlers_test.go b/internal/api/truenas_handlers_test.go
index 64ef009b70..1cfc717cb7 100644
--- a/internal/api/truenas_handlers_test.go
+++ b/internal/api/truenas_handlers_test.go
@@ -251,6 +251,94 @@ func TestTrueNASHandlers_HandleDelete_RemovesAndHandlesUnknownID(t *testing.T) {
}
}
+func TestTrueNASHandlers_HandleUpdate_PreservesMaskedSecretsAndReplacesFields(t *testing.T) {
+ setTrueNASFeatureForTest(t, true)
+ setMockModeForTrueNASTest(t, false)
+
+ handler, persistence, _ := newTrueNASHandlersForTest(t, nil)
+ if err := persistence.SaveTrueNASConfig([]config.TrueNASInstance{
+ {
+ ID: "alpha",
+ Name: "old-name",
+ Host: "old.local",
+ Port: 443,
+ APIKey: "super-secret",
+ UseHTTPS: true,
+ InsecureSkipVerify: false,
+ Enabled: true,
+ },
+ }); err != nil {
+ t.Fatalf("seed truenas config: %v", err)
+ }
+
+ body := marshalTrueNASRequest(t, map[string]any{
+ "id": "ignored-id",
+ "name": "new-name",
+ "host": "new.local",
+ "port": 8443,
+ "apiKey": "********",
+ "useHttps": true,
+ "insecureSkipVerify": true,
+ "enabled": true,
+ })
+
+ req := httptest.NewRequest(http.MethodPut, "/api/truenas/connections/alpha", bytes.NewReader(body))
+ rec := httptest.NewRecorder()
+ handler.HandleUpdate(rec, req)
+
+ if rec.Code != http.StatusOK {
+ t.Fatalf("expected 200, got %d: %s", rec.Code, rec.Body.String())
+ }
+
+ var updated config.TrueNASInstance
+ if err := json.NewDecoder(rec.Body).Decode(&updated); err != nil {
+ t.Fatalf("decode update response: %v", err)
+ }
+ if updated.ID != "alpha" {
+ t.Fatalf("expected path ID to win, got %q", updated.ID)
+ }
+ if updated.APIKey != "********" {
+ t.Fatalf("expected api key to remain redacted, got %q", updated.APIKey)
+ }
+
+ stored, err := persistence.LoadTrueNASConfig()
+ if err != nil {
+ t.Fatalf("load persisted config: %v", err)
+ }
+ if len(stored) != 1 {
+ t.Fatalf("expected 1 stored instance, got %d", len(stored))
+ }
+ if stored[0].Host != "new.local" || stored[0].Port != 8443 {
+ t.Fatalf("expected updated endpoint to persist, got %+v", stored[0])
+ }
+ if stored[0].APIKey != "super-secret" {
+ t.Fatalf("expected masked api key to preserve stored secret, got %q", stored[0].APIKey)
+ }
+ if !stored[0].InsecureSkipVerify {
+ t.Fatalf("expected insecureSkipVerify update to persist")
+ }
+}
+
+func TestTrueNASHandlers_HandleUpdate_UnknownID(t *testing.T) {
+ setTrueNASFeatureForTest(t, true)
+ setMockModeForTrueNASTest(t, false)
+
+ handler, _, _ := newTrueNASHandlersForTest(t, nil)
+
+ body := marshalTrueNASRequest(t, map[string]any{
+ "host": "missing.local",
+ "apiKey": "secret",
+ })
+
+ req := httptest.NewRequest(http.MethodPut, "/api/truenas/connections/missing", bytes.NewReader(body))
+ rec := httptest.NewRecorder()
+ handler.HandleUpdate(rec, req)
+
+ if rec.Code != http.StatusNotFound {
+ t.Fatalf("expected 404, got %d: %s", rec.Code, rec.Body.String())
+ }
+}
+
func TestTrueNASHandlers_HandleTestConnection_SuccessAndFailure(t *testing.T) {
setTrueNASFeatureForTest(t, true)
diff --git a/internal/config/truenas.go b/internal/config/truenas.go
index 6e2dab87dd..f2c5bc9b98 100644
--- a/internal/config/truenas.go
+++ b/internal/config/truenas.go
@@ -9,6 +9,12 @@ import (
const trueNASSensitiveMask = "********"
+// IsTrueNASSensitiveMask reports whether the value is the redacted placeholder
+// used by the TrueNAS settings API.
+func IsTrueNASSensitiveMask(value string) bool {
+ return strings.TrimSpace(value) == trueNASSensitiveMask
+}
+
// TrueNASInstance represents a configured TrueNAS endpoint.
type TrueNASInstance struct {
ID string `json:"id"`
@@ -71,3 +77,17 @@ func (t *TrueNASInstance) Redacted() TrueNASInstance {
}
return redacted
}
+
+// PreserveMaskedSecrets restores stored credentials when an update payload uses
+// the API redaction placeholder for unchanged secret fields.
+func (t *TrueNASInstance) PreserveMaskedSecrets(existing TrueNASInstance) {
+ if t == nil {
+ return
+ }
+ if IsTrueNASSensitiveMask(t.APIKey) {
+ t.APIKey = existing.APIKey
+ }
+ if IsTrueNASSensitiveMask(t.Password) {
+ t.Password = existing.Password
+ }
+}
diff --git a/internal/monitoring/truenas_poller.go b/internal/monitoring/truenas_poller.go
index d0493d69da..1e968746bd 100644
--- a/internal/monitoring/truenas_poller.go
+++ b/internal/monitoring/truenas_poller.go
@@ -29,6 +29,8 @@ type TrueNASPoller struct {
mu sync.Mutex
// providersByOrg is keyed by orgID, then connection ID.
providersByOrg map[string]map[string]*truenas.Provider
+ // configsByOrg is keyed by orgID, then connection ID.
+ configsByOrg map[string]map[string]config.TrueNASInstance
// cachedRecordsByOrg is keyed by orgID, then connection ID.
cachedRecordsByOrg map[string]map[string][]unifiedresources.IngestRecord
cancel context.CancelFunc
@@ -49,6 +51,7 @@ func NewTrueNASPoller(multiTenant *config.MultiTenantPersistence, interval time.
multiTenant: multiTenant,
recoveryManager: recoveryManager,
providersByOrg: make(map[string]map[string]*truenas.Provider),
+ configsByOrg: make(map[string]map[string]config.TrueNASInstance),
cachedRecordsByOrg: make(map[string]map[string][]unifiedresources.IngestRecord),
stopped: stopped,
interval: interval,
@@ -216,12 +219,16 @@ func (p *TrueNASPoller) syncConnections() {
if p.providersByOrg[orgID] == nil {
p.providersByOrg[orgID] = make(map[string]*truenas.Provider)
}
+ if p.configsByOrg[orgID] == nil {
+ p.configsByOrg[orgID] = make(map[string]config.TrueNASInstance)
+ }
if p.cachedRecordsByOrg[orgID] == nil {
p.cachedRecordsByOrg[orgID] = make(map[string][]unifiedresources.IngestRecord)
}
for connID, instance := range byConn {
- if _, exists := p.providersByOrg[orgID][connID]; exists {
+ existingProvider, exists := p.providersByOrg[orgID][connID]
+ if exists && !trueNASProviderConfigChanged(p.configsByOrg[orgID][connID], instance) {
continue
}
@@ -246,7 +253,11 @@ func (p *TrueNASPoller) syncConnections() {
continue
}
+ if existingProvider != nil {
+ existingProvider.Close()
+ }
p.providersByOrg[orgID][connID] = truenas.NewLiveProvider(&truenas.APIFetcher{Client: client})
+ p.configsByOrg[orgID][connID] = instance
}
}
@@ -260,6 +271,9 @@ func (p *TrueNASPoller) syncConnections() {
provider.Close()
}
delete(providers, connID)
+ if p.configsByOrg[orgID] != nil {
+ delete(p.configsByOrg[orgID], connID)
+ }
if p.cachedRecordsByOrg[orgID] != nil {
delete(p.cachedRecordsByOrg[orgID], connID)
}
@@ -270,6 +284,9 @@ func (p *TrueNASPoller) syncConnections() {
provider.Close()
}
delete(providers, connID)
+ if p.configsByOrg[orgID] != nil {
+ delete(p.configsByOrg[orgID], connID)
+ }
if p.cachedRecordsByOrg[orgID] != nil {
delete(p.cachedRecordsByOrg[orgID], connID)
}
@@ -278,6 +295,7 @@ func (p *TrueNASPoller) syncConnections() {
if len(providers) == 0 {
delete(p.providersByOrg, orgID)
+ delete(p.configsByOrg, orgID)
delete(p.cachedRecordsByOrg, orgID)
}
}
@@ -484,6 +502,17 @@ func cloneIngestRecords(records []unifiedresources.IngestRecord) []unifiedresour
return cloned
}
+func trueNASProviderConfigChanged(previous, next config.TrueNASInstance) bool {
+ return strings.TrimSpace(previous.Host) != strings.TrimSpace(next.Host) ||
+ previous.Port != next.Port ||
+ strings.TrimSpace(previous.APIKey) != strings.TrimSpace(next.APIKey) ||
+ strings.TrimSpace(previous.Username) != strings.TrimSpace(next.Username) ||
+ strings.TrimSpace(previous.Password) != strings.TrimSpace(next.Password) ||
+ previous.UseHTTPS != next.UseHTTPS ||
+ previous.InsecureSkipVerify != next.InsecureSkipVerify ||
+ strings.TrimSpace(previous.Fingerprint) != strings.TrimSpace(next.Fingerprint)
+}
+
// classifyTrueNASError wraps a TrueNAS API error in MonitorError for metrics classification.
func classifyTrueNASError(err error, connectionID string) *internalerrors.MonitorError {
if err == nil {
diff --git a/internal/monitoring/truenas_poller_test.go b/internal/monitoring/truenas_poller_test.go
index af8f1655ab..0d3936078c 100644
--- a/internal/monitoring/truenas_poller_test.go
+++ b/internal/monitoring/truenas_poller_test.go
@@ -626,6 +626,55 @@ func TestTrueNASPollerConcurrentConfigChange(t *testing.T) {
}
}
+func TestTrueNASPollerRebindsProviderWhenConnectionConfigChanges(t *testing.T) {
+ previous := truenas.IsFeatureEnabled()
+ truenas.SetFeatureEnabled(true)
+ t.Cleanup(func() { truenas.SetFeatureEnabled(previous) })
+
+ first := newTrueNASMockServer(t, "config-rebind-one")
+ second := newTrueNASMockServer(t, "config-rebind-two")
+ t.Cleanup(first.Close)
+ t.Cleanup(second.Close)
+
+ mtp, persistence := newTestTenantPersistence(t)
+ connection := trueNASInstanceForServer(t, "config-rebind", first.URL(), true)
+ if err := persistence.SaveTrueNASConfig([]config.TrueNASInstance{connection}); err != nil {
+ t.Fatalf("SaveTrueNASConfig() initial error = %v", err)
+ }
+
+ poller := NewTrueNASPoller(mtp, 50*time.Millisecond, nil)
+ poller.Start(context.Background())
+ t.Cleanup(poller.Stop)
+
+ waitForCondition(t, 2*time.Second, func() bool {
+ return pollerProviderCount(poller) == 1 && first.RequestCount() >= 5
+ }, "expected initial TrueNAS connection to poll before config change")
+
+ updated := trueNASInstanceForServer(t, connection.ID, second.URL(), true)
+ updated.Name = connection.Name
+ if err := persistence.SaveTrueNASConfig([]config.TrueNASInstance{updated}); err != nil {
+ t.Fatalf("SaveTrueNASConfig() updated error = %v", err)
+ }
+
+ waitForCondition(t, 2*time.Second, func() bool {
+ return pollerProviderCount(poller) == 1 && second.RequestCount() >= 5
+ }, "expected provider to rebind to updated TrueNAS endpoint")
+
+ firstCountAfterRebind := first.RequestCount()
+ noPollDeadline := time.Now().Add(200 * time.Millisecond)
+ waitForCondition(t, 500*time.Millisecond, func() bool {
+ return time.Now().After(noPollDeadline) && first.RequestCount() == firstCountAfterRebind
+ }, "expected replaced TrueNAS endpoint to stop receiving poll requests")
+
+ poller.Stop()
+ if hasTrueNASHostForOrg(poller, "default", "config-rebind-one") {
+ t.Fatal("expected old TrueNAS host to be replaced after config rebind")
+ }
+ if !hasTrueNASHostForOrg(poller, "default", "config-rebind-two") {
+ t.Fatal("expected updated TrueNAS host to be ingested after config rebind")
+ }
+}
+
func TestTrueNASPollerSkipsDisabledConnections(t *testing.T) {
previous := truenas.IsFeatureEnabled()
truenas.SetFeatureEnabled(true)
diff --git a/tests/integration/tests/21-truenas-settings-platform-connections.spec.ts b/tests/integration/tests/21-truenas-settings-platform-connections.spec.ts
new file mode 100644
index 0000000000..0bf3a75a67
--- /dev/null
+++ b/tests/integration/tests/21-truenas-settings-platform-connections.spec.ts
@@ -0,0 +1,120 @@
+import fs from 'node:fs';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+import { test as base, expect } from '@playwright/test';
+import { createAuthenticatedStorageState } from './helpers';
+
+const __dirname = path.dirname(fileURLToPath(import.meta.url));
+
+type WorkerFixtures = {
+ authStorageStatePath: string;
+};
+
+const SCREENSHOT_PATH = path.resolve(
+ __dirname,
+ '..',
+ '..',
+ 'tmp',
+ 'truenas-settings-platform-connections.png',
+);
+
+const test = base.extend<{}, WorkerFixtures>({
+ storageState: async ({ authStorageStatePath }, use) => {
+ await use(authStorageStatePath);
+ },
+ authStorageStatePath: [async ({ browser }, use, workerInfo) => {
+ const storageStatePath = path.resolve(
+ __dirname,
+ '..',
+ '..',
+ 'tmp',
+ 'playwright-auth',
+ `truenas-settings-platform-connections-${workerInfo.project.name}.json`,
+ );
+ fs.mkdirSync(path.dirname(storageStatePath), { recursive: true });
+ await createAuthenticatedStorageState(browser, storageStatePath);
+ try {
+ await use(storageStatePath);
+ } finally {
+ fs.rmSync(storageStatePath, { force: true });
+ }
+ }, { scope: 'worker' }],
+});
+
+test.describe('TrueNAS platform connections settings', () => {
+ test.setTimeout(180_000);
+
+ test('renders the platform-connections workspace with the TrueNAS integration shell', async ({
+ page,
+ }) => {
+ 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,
+ fingerprint: '',
+ enabled: true,
+ },
+ {
+ id: 'truenas-2',
+ name: 'Backup Vault',
+ host: 'vault.local',
+ port: 443,
+ username: 'admin',
+ password: '********',
+ useHttps: true,
+ insecureSkipVerify: true,
+ fingerprint: 'sha256:example',
+ enabled: false,
+ },
+ ]),
+ });
+ });
+
+ await page.goto('/settings/infrastructure/platforms/truenas', {
+ waitUntil: 'domcontentloaded',
+ });
+ await page.waitForURL(/\/settings\/infrastructure\/platforms\/truenas/, {
+ timeout: 15_000,
+ });
+
+ await expect(
+ page.getByRole('heading', { level: 1, name: 'Infrastructure Operations' }),
+ ).toBeVisible();
+ await expect(page.getByRole('tab', { name: 'Platform connections' })).toHaveAttribute(
+ 'aria-selected',
+ 'true',
+ );
+ await expect(page.getByRole('tab', { name: 'TrueNAS' })).toHaveAttribute(
+ 'aria-selected',
+ 'true',
+ );
+ await expect(page.getByRole('tab', { name: 'Proxmox' })).toHaveAttribute(
+ 'aria-selected',
+ 'false',
+ );
+
+ await expect(page.getByText('TrueNAS platform integration')).toBeVisible();
+ await expect(page.getByRole('button', { name: 'Add TrueNAS connection' })).toBeVisible();
+ await expect(page.getByText('Tower NAS')).toBeVisible();
+ await expect(page.getByText('Backup Vault')).toBeVisible();
+ await expect(page.getByText('API key auth')).toBeVisible();
+ await expect(page.getByText('Username/password auth')).toBeVisible();
+
+ fs.mkdirSync(path.dirname(SCREENSHOT_PATH), { recursive: true });
+ await page.screenshot({ path: SCREENSHOT_PATH, fullPage: true });
+ });
+});