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.

Refine infrastructure onboarding flows

rcourtman485bac636b37
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index 7bb497c6f9..7d21679572 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -116,6 +116,12 @@ management, and fleet control surfaces.
22. `scripts/install.ps1` shared with `deployment-installability`: the Windows installer is both a deployment installability entry point and a canonical agent lifecycle runtime continuity boundary.
23. `scripts/install.sh` shared with `deployment-installability`: the shell installer is both a deployment installability entry point and a canonical agent lifecycle runtime continuity boundary.
+The node setup modal boundary must keep guided setup and manual credential
+submission separate. For new PVE/PBS setup, Agent Install and Direct Connection
+setup-script modes are command-driven auto-registration paths; Token ID/Value
+fields, Test Connection, and Add Node submission belong only to Manual Token
+Setup or existing-node edit flows.
+
That shared monitored-system admission preview boundary also owns the disabled
platform-connection lifecycle state. Once a TrueNAS or VMware setup form marks
the connection disabled, lifecycle surfaces must treat a canonical zero-delta
@@ -227,7 +233,7 @@ an add-only capacity posture.
Persistence-sensitive NAS targets must keep one canonical continuity model here: installer-owned bootstraps may use flash-backed or immutable-root launch hooks only as thin trampolines, while the durable wrapper, state, and reboot-surviving binary copy stay in the governed persistent state directory that updater continuity also refreshes.
9. Add or change profile management, the extracted agent profiles runtime owner, the infrastructure source-manager landing, the pure unified-agent inventory/install model, the connections-ledger workspace shell, the unified ConnectionEditor and its per-type credential slots, route model, shared install section owner, the shared direct-node/discovery infrastructure settings owners plus their model, shared frontend install-command assembly, Proxmox setup/install API transport, TrueNAS platform-connection management, VMware platform-connection management, the shared monitored-system admission preview shell for those platform connections, setup-completion install handoff transport, deploy-fallback manual install transport, and fleet-control presentation through `frontend-modern/src/api/agentProfiles.ts`, `frontend-modern/src/api/nodes.ts`, `frontend-modern/src/components/Settings/AgentProfilesPanel.tsx`, `frontend-modern/src/components/Settings/useAgentProfilesPanelState.ts`, `frontend-modern/src/components/Settings/ConnectionsTable.tsx`, `frontend-modern/src/components/Settings/connectionsTableModel.ts`, `frontend-modern/src/components/Settings/useConnectionsLedger.ts`, `frontend-modern/src/components/Settings/useConnectionRowActions.ts`, `frontend-modern/src/components/Settings/ConnectionEditor/ConnectionEditor.tsx`, `frontend-modern/src/components/Settings/ConnectionEditor/AddressProbeStep.tsx`, `frontend-modern/src/components/Settings/ConnectionEditor/useConnectionEditor.ts`, `frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/NodeCredentialSlot.tsx`, `frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/TrueNASCredentialSlot.tsx`, `frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/VMwareCredentialSlot.tsx`, `frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx`, `frontend-modern/src/components/Settings/InfrastructureInstallerSection.tsx`, `frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx`, `frontend-modern/src/components/Settings/InfrastructureSourceManager.tsx`, `frontend-modern/src/components/Settings/infrastructureWorkspaceModel.ts`, `frontend-modern/src/components/Settings/MonitoredSystemAdmissionPreview.tsx`, `frontend-modern/src/components/Settings/platformConnectionsModel.ts`, `frontend-modern/src/components/Settings/useTrueNASSettingsPanelState.ts`, `frontend-modern/src/components/Settings/useVMwareSettingsPanelState.ts`, `frontend-modern/src/components/Settings/proxmoxSettingsModel.ts`, `frontend-modern/src/components/Settings/ConfiguredNodeTables.tsx`, `frontend-modern/src/components/Settings/SettingsSectionNav.tsx`, `frontend-modern/src/components/Settings/infrastructureSettingsModel.ts`, `frontend-modern/src/components/Settings/useInfrastructureConfiguredNodesState.ts`, `frontend-modern/src/components/Settings/useInfrastructureDiscoveryRuntimeState.ts`, `frontend-modern/src/components/Settings/useInfrastructureInstallState.tsx`, `frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx`, `frontend-modern/src/components/Settings/useInfrastructureSettingsState.ts`, `frontend-modern/src/components/Settings/nodeModalModel.ts`, `frontend-modern/src/components/Settings/useNodeModalState.ts`, `frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx`, and `frontend-modern/src/utils/agentInstallCommand.ts`. Phase 9 retired the legacy reporting/inventory surface (InfrastructureOperationsController, InfrastructureInventorySection, InfrastructureActiveRowDetails, InfrastructureIgnoredRowDetails, InfrastructureStopMonitoringDialog, useInfrastructureReportingState) and the per-type shells (PlatformConnectionsWorkspace, ProxmoxSettingsPanel, ProxmoxDirectWorkspace, ProxmoxConfiguredNodesTable, ProxmoxDirectConnectionsCard, ProxmoxDiscoveryResultsCard, ProxmoxDeleteNodeDialog, ProxmoxNodeModalStack, NodeModal shell, TrueNASSettingsPanel, VMwareSettingsPanel, useProxmoxDirectWorkspaceState); lifecycle extensions must route through the unified aggregator ledger, source-manager cards, and ConnectionEditor credential slots rather than reintroducing those retired surfaces.
Those lifecycle-owned settings hooks may consume websocket state only through `frontend-modern/src/contexts/appRuntime.ts`; they must not import `frontend-modern/src/App.tsx` or recreate root-shell providers.
- Discovery configuration is part of that same lifecycle-owned workspace boundary. `InfrastructureSourceManager.tsx` must open one canonical discovery editor through `InfrastructureDiscoverySettingsDialog.tsx`, `DiscoverySettingsForm.tsx`, and `discoverySettingsModel.ts`, while the System/Network shell stays limited to network-boundary controls instead of reintroducing a second editable discovery surface. That same workspace boundary now owns the add-flow entry split too: the landing strip opens the grouped `Add infrastructure` picker, while `Detect from address` remains a picker-owned utility route instead of a competing top-level header action.
+ Discovery configuration is part of that same lifecycle-owned workspace boundary. `InfrastructureSourceManager.tsx` must open one canonical discovery editor through `InfrastructureDiscoverySettingsDialog.tsx`, `DiscoverySettingsForm.tsx`, and `discoverySettingsModel.ts`, while the System/Network shell stays limited to network-boundary controls instead of reintroducing a second editable discovery surface. That same workspace boundary now owns the add-flow entry split too: the landing guidance exposes `Detect from address`, `Install Pulse Agent`, and `Choose source type` as first-run actions above the source ledger, while header actions stay limited to ongoing discovery controls.
The same lifecycle-owned workspace boundary now also owns attached-agent composition. When a unified Pulse Agent augments a first-class platform source such as Proxmox VE, the source manager and edit dialog must present one primary platform row with explicit `API` plus `Pulse Agent` composition rather than duplicating that same machine as a second peer row under a generic Pulse Agent platform bucket. Standalone hosts with no owning platform source remain grouped under a standalone-host owner bucket, with `Pulse Agent` shown as the collection method rather than as the pseudo-platform label.
When that primary Proxmox source is cluster-backed, the same workspace boundary must render the row under the canonical cluster moniker carried by the backend grouping contract rather than under one sibling node's hostname. That same backend grouping contract must also carry the explicit member-node list for the cluster so the source manager can render child node composition such as `delly` and `minipc` beneath the owning cluster row with per-node coverage/status. Cluster-member node agents belong as augmentations on that owning Proxmox row and its child nodes, not as separate standalone-host peers.
That same lifecycle-owned workspace boundary also owns agent version
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index aac9f56508..d0fcab93ba 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -123,6 +123,11 @@ Own canonical runtime payload shapes between backend and frontend.
29. `frontend-modern/src/utils/apiTokenPresentation.ts` shared with `security-privacy`: the API token presentation helper is both a security/privacy control surface and a canonical API token management boundary.
30. `frontend-modern/src/utils/infrastructureSettingsPresentation.ts` shared with `agent-lifecycle`: the infrastructure settings presentation helper is both an agent lifecycle control surface and an API-backed direct-node/discovery settings boundary.
31. `internal/api/access_control_handlers.go` shared with `organization-settings`: RBAC role and user-assignment handlers are both an organization settings control surface and a canonical API payload contract boundary.
+ The shared node setup boundary above owns the guided/manual setup split
+ for PVE/PBS consumers: Agent Install and Direct Connection setup-script
+ modes are auto-registration paths, while Token ID/Value fields, Test
+ Connection, and Add Node are manual-token or existing-node edit controls
+ only.
32. `internal/api/agent_install_command_shared.go` shared with `agent-lifecycle`: agent install command assembly is both an agent lifecycle control surface and a canonical API payload contract boundary.
33. `internal/api/ai_handler.go` shared with `ai-runtime`: Pulse Assistant handlers are both an AI runtime control surface and a canonical API payload contract boundary.
34. `internal/api/ai_handlers.go` shared with `ai-runtime`: AI settings and remediation handlers are both an AI runtime control surface and a canonical API payload contract boundary.
@@ -2281,6 +2286,11 @@ masked: copy-success messaging may not tell the operator to paste a token
"shown below" once only `tokenHint` remains visible, and stale raw-token
cleanup paths may not survive in one Proxmox branch after the shared UI state
has moved to hint-only handling.
+That same shared settings consumer must keep command-driven setup and manual
+credential submission distinct. When a new PVE/PBS setup is in Agent Install or
+Direct Connection setup-script mode, the settings UI must not render Token
+ID/Value fields, Test Connection, or Add Node controls; those controls are only
+valid for Manual Token Setup or existing-node edit flows.
That same shared frontend setup surface must also trim and validate the
canonical `host` input before invoking `/api/setup-script` downloads, and the
shared `frontend-modern/src/api/nodes.ts` helper must reject empty `host` or
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 164a1d648f..45ff0f5776 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -245,15 +245,16 @@ work extends shared components instead of creating new local variants.
from a top-level product route such as `/recovery`, the first highlighted
step should match that route instead of always restarting at Dashboard.
5. Keep shared infrastructure shell state on the reusable settings boundary: `frontend-modern/src/components/Settings/useSettingsInfrastructurePanelProps.ts` and `frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx` must continue to derive provider counts, availability, and shared subtab copy from one infrastructure-settings source — via the unified aggregator through `frontend-modern/src/components/Settings/useConnectionsLedger.ts` — instead of creating provider-local summary fetches or VMware-only shell vocabulary. Phase 9 retired the old `PlatformConnectionsWorkspace` per-type shell, but setup guidance may still use `Platform connections` as the operator-facing label for the shared API-backed onboarding path.
- That same shared shell boundary now owns the default posture for
+ That same shared shell boundary now owns the first-run posture for
`/settings/infrastructure`: the landing route should read as one
source-manager workspace with configured infrastructure instances first
- and no redundant monitored-systems ledger beneath it. The landing route
- must not lead with
- connection-type explanations, onboarding-path copy, or separate detect
- utilities. Existing sources stay visible on the page, and add, detect,
- install, and edit flows open as secondary interactions from that same
- destination instead of taking over the whole page.
+ and no redundant monitored-systems ledger beneath it. The landing route may
+ include a compact guidance strip that explains platform APIs and host agents
+ as Pulse 6 infrastructure sources and exposes `Detect from address`, `Install
+ Pulse Agent`, and `Choose source type` as first-run actions. Existing sources
+ stay visible on the page, and add, detect, install, and edit flows open as
+ secondary interactions from that same destination instead of taking over the
+ whole page.
Those secondary views must stay under the same single `Infrastructure`
sidebar destination, but they may open in governed modal/dialog chrome when
that preserves the persistent source-manager page behind them.
diff --git a/frontend-modern/src/components/Settings/InfrastructureSourceManager.tsx b/frontend-modern/src/components/Settings/InfrastructureSourceManager.tsx
index fdfa89c51d..0a848ec40b 100644
--- a/frontend-modern/src/components/Settings/InfrastructureSourceManager.tsx
+++ b/frontend-modern/src/components/Settings/InfrastructureSourceManager.tsx
@@ -8,7 +8,7 @@ import {
type Accessor,
type Component,
} from 'solid-js';
-import { Plus, RotateCw, SlidersHorizontal } from 'lucide-solid';
+import { Cpu, Plus, RotateCw, Search, SlidersHorizontal } from 'lucide-solid';
import SettingsPanel from '@/components/shared/SettingsPanel';
import {
Table,
@@ -26,6 +26,8 @@ import {
} from './connectionsTableModel';
import type { DiscoveredServer, DiscoveryScanStatus } from './infrastructureSettingsModel';
import {
+ getInfrastructureEmptyStateDetail,
+ getInfrastructureEmptyStateSummary,
getInfrastructureOnboardingProductPresentation,
getInfrastructureSourceManagerProducts,
type InfrastructureOnboardingConnectionType,
@@ -39,6 +41,7 @@ interface InfrastructureSourceManagerProps {
readOnly: boolean;
onAddSource?: (type: InfrastructureOnboardingConnectionType) => void;
onAddInfrastructure?: () => void;
+ onDetectFromAddress?: () => void;
onRunDiscovery?: () => void;
onOpenDiscoverySettings?: () => void;
onOpenConnection?: (row: InfrastructureSystemRow) => void;
@@ -51,6 +54,10 @@ const addSectionButtonClass =
'inline-flex min-w-[4.5rem] items-center justify-center gap-1.5 rounded-md border border-blue-200 bg-blue-50 px-2.5 py-1 text-xs font-medium text-blue-700 transition-colors hover:bg-blue-100 dark:border-blue-900 dark:bg-blue-950/30 dark:text-blue-200 dark:hover:bg-blue-900/40';
const utilityToolbarButtonClass =
'inline-flex items-center gap-1.5 rounded-md px-1 py-1 text-sm font-medium text-muted transition-colors hover:text-base-content disabled:cursor-not-allowed disabled:opacity-60';
+const onboardingPrimaryButtonClass =
+ 'inline-flex min-h-9 items-center justify-center gap-2 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 onboardingSecondaryButtonClass =
+ 'inline-flex min-h-9 items-center justify-center gap-2 rounded-md border border-border bg-surface 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 discoveryRowClass =
'border-b border-border-subtle bg-blue-50/30 hover:bg-blue-50/40 dark:bg-blue-950/10 dark:hover:bg-blue-950/20';
const wrappedFieldClass = 'whitespace-normal break-words leading-4';
@@ -115,7 +122,10 @@ const agentMethodTitleFor = (row: InfrastructureSystemRow): string | undefined =
return `${agentConnections.length} Pulse Agent attachments`;
};
-const memberMethodTitleFor = (row: InfrastructureSystemRow, memberIndex: number): string | undefined => {
+const memberMethodTitleFor = (
+ row: InfrastructureSystemRow,
+ memberIndex: number,
+): string | undefined => {
const member = row.members[memberIndex];
if (!member?.agentConnection) return undefined;
return (
@@ -202,6 +212,9 @@ export const InfrastructureSourceManager: Component<InfrastructureSourceManagerP
!props.readOnly && Boolean(props.onOpenConnection) && (row.canEdit || row.isAgent);
const actionColumnVisible = () => !props.readOnly;
+ const onboardingActionsVisible = () =>
+ !props.readOnly &&
+ Boolean(props.onDetectFromAddress || props.onAddSource || props.onAddInfrastructure);
const lastDiscoveryResultText = createMemo(() =>
formatRelativeTimestamp(props.discoveryScanStatus().lastResultAt),
);
@@ -280,6 +293,66 @@ export const InfrastructureSourceManager: Component<InfrastructureSourceManagerP
</Show>
);
+ const onboardingBand = () => (
+ <div class="border-b border-border bg-surface px-4 py-4">
+ <div class="flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between">
+ <div class="max-w-3xl">
+ <h3 class="text-sm font-semibold text-base-content">
+ Start by connecting what Pulse should monitor
+ </h3>
+ <p class="mt-1 text-sm leading-5 text-muted">
+ Pulse 6 treats platform APIs and host agents as infrastructure sources. Connect a
+ supported platform API for inventory and health, install Pulse Agent for node-local
+ telemetry, or use both when you want full coverage.
+ </p>
+ </div>
+
+ <Show when={onboardingActionsVisible()}>
+ <div class="flex flex-wrap gap-2 lg:justify-end">
+ <Show when={props.onDetectFromAddress}>
+ <button
+ type="button"
+ onClick={props.onDetectFromAddress}
+ class={onboardingPrimaryButtonClass}
+ >
+ <Search class="h-4 w-4" />
+ Detect from address
+ </button>
+ </Show>
+ <Show when={props.onAddSource}>
+ <button
+ type="button"
+ onClick={() => props.onAddSource?.('agent')}
+ class={onboardingSecondaryButtonClass}
+ >
+ <Cpu class="h-4 w-4" />
+ Install Pulse Agent
+ </button>
+ </Show>
+ <Show when={props.onAddInfrastructure}>
+ <button
+ type="button"
+ onClick={props.onAddInfrastructure}
+ class={onboardingSecondaryButtonClass}
+ >
+ <Plus class="h-4 w-4" />
+ Choose source type
+ </button>
+ </Show>
+ </div>
+ </Show>
+ </div>
+ </div>
+ );
+
+ const emptyStateContent = () => (
+ <div class="mx-auto max-w-3xl space-y-2">
+ <div class="text-sm font-semibold text-base-content">Start monitoring infrastructure</div>
+ <p>{getInfrastructureEmptyStateSummary()}</p>
+ <p class="text-xs leading-5 text-muted">{getInfrastructureEmptyStateDetail()}</p>
+ </div>
+ );
+
return (
<div ref={layoutContainerRef} class="min-w-0">
<SettingsPanel
@@ -288,668 +361,670 @@ export const InfrastructureSourceManager: Component<InfrastructureSourceManagerP
noPadding
action={headerActions()}
>
- <Show when={!useCardLayout()}>
- <Table class="w-full table-fixed text-sm">
- <TableHeader class="bg-surface-alt/60">
- <TableRow>
- <TableHead class="w-[22%] py-1.5 pl-3 pr-3 text-left text-[11px] font-medium text-muted whitespace-nowrap xl:w-[20%]">
- System
- </TableHead>
- <TableHead class="w-[7.5rem] px-3 py-1.5 text-left text-[11px] font-medium text-muted whitespace-nowrap">
- Source
- </TableHead>
- <TableHead class="w-[21%] px-3 py-1.5 text-left text-[11px] font-medium text-muted whitespace-nowrap xl:w-[20%]">
- Endpoint
- </TableHead>
- <TableHead class="w-[18%] px-3 py-1.5 text-left text-[11px] font-medium text-muted whitespace-nowrap xl:w-[22%]">
- Coverage
- </TableHead>
- <TableHead class="w-[16%] px-3 py-1.5 text-left text-[11px] font-medium text-muted whitespace-nowrap xl:w-[15%]">
- Status
- </TableHead>
- <Show when={actionColumnVisible()}>
- <TableHead class="w-[7rem] px-3 py-1.5 text-right text-[11px] font-medium text-muted whitespace-nowrap">
- Actions
- </TableHead>
- </Show>
- </TableRow>
- </TableHeader>
-
- <TableBody class="bg-surface">
- <For each={sortedProducts()}>
- {(product) => {
- const configuredRows = () => groupedConfiguredRows().get(product.type) ?? [];
- const discoveredRows = () => groupedDiscoveredRows().get(product.type) ?? [];
- const groupRowClass = () =>
- 'border-b border-border-subtle bg-base hover:bg-base';
- const groupLabelClass = () => 'text-[15px] font-semibold text-base-content';
-
- return (
- <>
- <Show
- when={actionColumnVisible()}
- fallback={
- <TableRow class={groupRowClass()}>
- <TableCell colspan={5} class="px-3 py-1.5">
- <div class="flex min-w-0 items-center gap-2">
- <span class={groupLabelClass()}>{product.label}</span>
- </div>
- </TableCell>
- </TableRow>
- }
- >
- <TableRow class={groupRowClass()}>
- <TableCell colspan={5} class="px-3 py-1.5">
- <div class="flex items-center gap-2 whitespace-nowrap">
- <span class={groupLabelClass()}>{product.label}</span>
- </div>
- </TableCell>
- <TableCell class="px-3 py-1.5 text-right">
- <Show when={!props.readOnly && props.onAddSource}>
- <button
- type="button"
- onClick={() => props.onAddSource?.(product.type)}
- class={`${addSectionButtonClass} whitespace-nowrap`}
- aria-label={product.actionLabel}
- title={product.actionLabel}
- >
- <Plus class="h-3.5 w-3.5" />
- Add
- </button>
- </Show>
- </TableCell>
- </TableRow>
- </Show>
-
- <Show when={configuredRows().length > 0}>
- <For each={configuredRows()}>
- {(row) => {
- return (
- <>
- <TableRow
- class={`border-b border-border-subtle ${
- row.isCluster ? 'bg-surface-alt/40' : ''
- }`}
- >
- <TableCell class="py-1 pl-3 pr-3 align-top">
- <div
- class={`text-[13px] ${
- row.isCluster
- ? 'font-medium text-base-content'
- : 'text-base-content/80'
- } ${wrappedFieldClass}`}
- title={row.name}
+ {onboardingBand()}
+
+ <Show when={!useCardLayout()}>
+ <Table class="w-full table-fixed text-sm">
+ <TableHeader class="bg-surface-alt/60">
+ <TableRow>
+ <TableHead class="w-[22%] py-1.5 pl-3 pr-3 text-left text-[11px] font-medium text-muted whitespace-nowrap xl:w-[20%]">
+ System
+ </TableHead>
+ <TableHead class="w-[7.5rem] px-3 py-1.5 text-left text-[11px] font-medium text-muted whitespace-nowrap">
+ Source
+ </TableHead>
+ <TableHead class="w-[21%] px-3 py-1.5 text-left text-[11px] font-medium text-muted whitespace-nowrap xl:w-[20%]">
+ Endpoint
+ </TableHead>
+ <TableHead class="w-[18%] px-3 py-1.5 text-left text-[11px] font-medium text-muted whitespace-nowrap xl:w-[22%]">
+ Coverage
+ </TableHead>
+ <TableHead class="w-[16%] px-3 py-1.5 text-left text-[11px] font-medium text-muted whitespace-nowrap xl:w-[15%]">
+ Status
+ </TableHead>
+ <Show when={actionColumnVisible()}>
+ <TableHead class="w-[7rem] px-3 py-1.5 text-right text-[11px] font-medium text-muted whitespace-nowrap">
+ Actions
+ </TableHead>
+ </Show>
+ </TableRow>
+ </TableHeader>
+
+ <TableBody class="bg-surface">
+ <For each={sortedProducts()}>
+ {(product) => {
+ const configuredRows = () => groupedConfiguredRows().get(product.type) ?? [];
+ const discoveredRows = () => groupedDiscoveredRows().get(product.type) ?? [];
+ const groupRowClass = () => 'border-b border-border-subtle bg-base hover:bg-base';
+ const groupLabelClass = () => 'text-[15px] font-semibold text-base-content';
+
+ return (
+ <>
+ <Show
+ when={actionColumnVisible()}
+ fallback={
+ <TableRow class={groupRowClass()}>
+ <TableCell colspan={5} class="px-3 py-1.5">
+ <div class="flex min-w-0 items-center gap-2">
+ <span class={groupLabelClass()}>{product.label}</span>
+ </div>
+ </TableCell>
+ </TableRow>
+ }
+ >
+ <TableRow class={groupRowClass()}>
+ <TableCell colspan={5} class="px-3 py-1.5">
+ <div class="flex items-center gap-2 whitespace-nowrap">
+ <span class={groupLabelClass()}>{product.label}</span>
+ </div>
+ </TableCell>
+ <TableCell class="px-3 py-1.5 text-right">
+ <Show when={!props.readOnly && props.onAddSource}>
+ <button
+ type="button"
+ onClick={() => props.onAddSource?.(product.type)}
+ class={`${addSectionButtonClass} whitespace-nowrap`}
+ aria-label={product.actionLabel}
+ title={product.actionLabel}
+ >
+ <Plus class="h-3.5 w-3.5" />
+ Add
+ </button>
+ </Show>
+ </TableCell>
+ </TableRow>
+ </Show>
+
+ <Show when={configuredRows().length > 0}>
+ <For each={configuredRows()}>
+ {(row) => {
+ return (
+ <>
+ <TableRow
+ class={`border-b border-border-subtle ${
+ row.isCluster ? 'bg-surface-alt/40' : ''
+ }`}
>
- {row.name}
- </div>
- <Show when={row.isCluster && row.subtitle}>
- <div class="mt-0.5 text-[11px] text-muted">{row.subtitle}</div>
- </Show>
- <Show when={!row.isCluster && row.identitySubtitle}>
- <div class="mt-0.5 text-[11px] text-muted">
- {row.identitySubtitle}
- </div>
- </Show>
- </TableCell>
-
- <TableCell class="px-3 py-1 align-top">
- {(() => {
- const presentation = infrastructureSourcePresentation(row.source);
- const title = agentMethodTitleFor(row) ?? presentation.title;
- return (
- <span
- class={`${presentation.badgeClassName} whitespace-nowrap`}
- title={title}
+ <TableCell class="py-1 pl-3 pr-3 align-top">
+ <div
+ class={`text-[13px] ${
+ row.isCluster
+ ? 'font-medium text-base-content'
+ : 'text-base-content/80'
+ } ${wrappedFieldClass}`}
+ title={row.name}
>
- {presentation.label}
- </span>
- );
- })()}
- </TableCell>
-
- <TableCell class="px-3 py-1 align-top">
- <Show
- when={row.host}
- fallback={<span class="text-xs text-muted">-</span>}
- >
- <div
- class="truncate whitespace-nowrap text-[12px] text-muted"
- title={row.host}
- >
- {row.host}
- </div>
+ {row.name}
+ </div>
+ <Show when={row.isCluster && row.subtitle}>
+ <div class="mt-0.5 text-[11px] text-muted">
+ {row.subtitle}
+ </div>
+ </Show>
+ <Show when={!row.isCluster && row.identitySubtitle}>
+ <div class="mt-0.5 text-[11px] text-muted">
+ {row.identitySubtitle}
+ </div>
+ </Show>
+ </TableCell>
+
+ <TableCell class="px-3 py-1 align-top">
+ {(() => {
+ const presentation = infrastructureSourcePresentation(
+ row.source,
+ );
+ const title = agentMethodTitleFor(row) ?? presentation.title;
+ return (
+ <span
+ class={`${presentation.badgeClassName} whitespace-nowrap`}
+ title={title}
+ >
+ {presentation.label}
+ </span>
+ );
+ })()}
+ </TableCell>
+
+ <TableCell class="px-3 py-1 align-top">
+ <Show
+ when={row.host}
+ fallback={<span class="text-xs text-muted">-</span>}
+ >
+ <div
+ class="truncate whitespace-nowrap text-[12px] text-muted"
+ title={row.host}
+ >
+ {row.host}
+ </div>
+ </Show>
+ </TableCell>
+
+ <TableCell class="px-3 py-1 align-top">
+ <Show
+ when={row.coverageLabels.length > 0}
+ fallback={<span class="text-xs text-muted">-</span>}
+ >
+ <div
+ class="whitespace-normal break-words text-[12px] leading-4 text-muted"
+ title={row.coverageLabels.join(', ')}
+ >
+ {row.coverageLabels.join(', ')}
+ </div>
+ </Show>
+ </TableCell>
+
+ <TableCell class="px-3 py-1 align-top">
+ <div class="flex flex-wrap items-center gap-x-1.5 gap-y-1">
+ <span
+ class={`inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium whitespace-nowrap ${row.statusClassName}`}
+ >
+ {row.statusLabel}
+ </span>
+ <Show when={row.agentUpdateCount > 0}>
+ <span class="inline-flex items-center rounded-full bg-amber-100 px-2 py-0.5 text-[11px] font-medium whitespace-nowrap text-amber-800 dark:bg-amber-900 dark:text-amber-200">
+ {row.agentUpdateCount === 1
+ ? 'Agent update'
+ : `${row.agentUpdateCount} agent updates`}
+ </span>
+ </Show>
+ <span class="whitespace-nowrap text-[12px] text-muted/90">
+ {row.lastActivityText}
+ </span>
+ </div>
+ </TableCell>
+
+ <Show when={actionColumnVisible()}>
+ <TableCell class="px-3 py-1 align-top text-right">
+ <Show
+ when={rowInteractive(row)}
+ fallback={<span class="text-xs text-muted">Read only</span>}
+ >
+ <button
+ type="button"
+ onClick={() => props.onOpenConnection?.(row)}
+ class={inlineButtonClass}
+ >
+ Edit
+ </button>
+ </Show>
+ </TableCell>
+ </Show>
+ </TableRow>
+
+ <Show when={row.lastErrorMessage}>
+ <TableRow class="border-b border-border-subtle">
+ <TableCell
+ colspan={actionColumnVisible() ? 6 : 5}
+ class="bg-surface px-3 pb-1.5 pt-0"
+ >
+ <div
+ role="alert"
+ class="rounded-md border border-rose-300 bg-rose-50 px-3 py-2 text-xs text-rose-800 dark:border-rose-900 dark:bg-rose-950 dark:text-rose-200"
+ >
+ {row.lastErrorMessage}
+ </div>
+ </TableCell>
+ </TableRow>
</Show>
- </TableCell>
- <TableCell class="px-3 py-1 align-top">
- <Show
- when={row.coverageLabels.length > 0}
- fallback={<span class="text-xs text-muted">-</span>}
- >
+ <Show when={row.members.length > 0}>
+ <For each={row.members}>
+ {(member, memberIndex) => {
+ const memberPresentation = infrastructureSourcePresentation(
+ member.source,
+ );
+ const memberSourceTitle =
+ memberMethodTitleFor(row, memberIndex()) ??
+ memberPresentation.title;
+ return (
+ <TableRow class="border-b border-border-subtle bg-surface-alt/30">
+ <TableCell class="py-1 pl-3 pr-3 align-top">
+ <div class="flex min-w-0 items-start gap-2 pl-4">
+ <span class="mt-1.5 h-1.5 w-1.5 flex-shrink-0 rounded-full bg-border" />
+ <div class="min-w-0">
+ <div
+ class={`text-[13px] text-base-content/85 ${wrappedFieldClass}`}
+ title={member.name}
+ >
+ {member.name}
+ </div>
+ <div class="mt-0.5 text-[11px] text-muted">
+ {member.subtitle}
+ </div>
+ </div>
+ </div>
+ </TableCell>
+
+ <TableCell class="px-3 py-1 align-top">
+ <span
+ class={`${memberPresentation.badgeClassName} whitespace-nowrap`}
+ title={memberSourceTitle}
+ >
+ {memberPresentation.label}
+ </span>
+ </TableCell>
+
+ <TableCell class="px-3 py-1 align-top">
+ <Show
+ when={member.host}
+ fallback={<span class="text-xs text-muted">-</span>}
+ >
+ <div
+ class="truncate whitespace-nowrap text-[12px] text-muted"
+ title={member.host}
+ >
+ {member.host}
+ </div>
+ </Show>
+ </TableCell>
+
+ <TableCell class="px-3 py-1 align-top">
+ <Show
+ when={member.coverageLabels.length > 0}
+ fallback={<span class="text-xs text-muted">-</span>}
+ >
+ <div
+ class="whitespace-normal break-words text-[12px] leading-4 text-muted"
+ title={member.coverageLabels.join(', ')}
+ >
+ {member.coverageLabels.join(', ')}
+ </div>
+ </Show>
+ </TableCell>
+
+ <TableCell class="px-3 py-1 align-top">
+ <div class="flex flex-wrap items-center gap-x-1.5 gap-y-1">
+ <span
+ class={`inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium whitespace-nowrap ${member.statusClassName}`}
+ >
+ {member.statusLabel}
+ </span>
+ <span class="whitespace-nowrap text-[12px] text-muted/90">
+ {member.lastActivityText}
+ </span>
+ </div>
+ </TableCell>
+
+ <Show when={actionColumnVisible()}>
+ <TableCell class="px-3 py-1 align-top text-right">
+ <span class="text-xs text-muted" aria-hidden="true">
+ —
+ </span>
+ </TableCell>
+ </Show>
+ </TableRow>
+ );
+ }}
+ </For>
+ </Show>
+ </>
+ );
+ }}
+ </For>
+ </Show>
+
+ <Show when={discoveredRows().length > 0}>
+ <For each={discoveredRows()}>
+ {(server) => {
+ return (
+ <TableRow class={discoveryRowClass}>
+ <TableCell class="py-1 pl-3 pr-3 align-top">
<div
- class="whitespace-normal break-words text-[12px] leading-4 text-muted"
- title={row.coverageLabels.join(', ')}
+ class={`text-[13px] text-base-content/85 ${wrappedFieldClass}`}
+ title={`${discoveredServerName(server)}${server.version ? ` · ${server.version}` : ''}`}
>
- {row.coverageLabels.join(', ')}
+ {discoveredServerName(server)}
</div>
- </Show>
- </TableCell>
+ </TableCell>
- <TableCell class="px-3 py-1 align-top">
- <div class="flex flex-wrap items-center gap-x-1.5 gap-y-1">
+ <TableCell class="px-3 py-1 align-top">
<span
- class={`inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium whitespace-nowrap ${row.statusClassName}`}
+ class="inline-flex items-center rounded-full border border-dashed border-border bg-surface-alt px-2 py-0.5 text-[11px] font-medium text-muted whitespace-nowrap"
+ title="Discovery candidate — review to attach a source"
>
- {row.statusLabel}
+ Candidate
</span>
- <Show when={row.agentUpdateCount > 0}>
- <span class="inline-flex items-center rounded-full bg-amber-100 px-2 py-0.5 text-[11px] font-medium whitespace-nowrap text-amber-800 dark:bg-amber-900 dark:text-amber-200">
- {row.agentUpdateCount === 1
- ? 'Agent update'
- : `${row.agentUpdateCount} agent updates`}
- </span>
- </Show>
- <span class="whitespace-nowrap text-[12px] text-muted/90">
- {row.lastActivityText}
- </span>
- </div>
- </TableCell>
+ </TableCell>
- <Show when={actionColumnVisible()}>
- <TableCell class="px-3 py-1 align-top text-right">
- <Show
- when={rowInteractive(row)}
- fallback={<span class="text-xs text-muted">Read only</span>}
+ <TableCell class="px-3 py-1 align-top">
+ <div
+ class="truncate whitespace-nowrap text-[12px] text-muted"
+ title={discoveredServerEndpoint(server)}
>
- <button
- type="button"
- onClick={() => props.onOpenConnection?.(row)}
- class={inlineButtonClass}
- >
- Edit
- </button>
- </Show>
+ {discoveredServerEndpoint(server)}
+ </div>
</TableCell>
- </Show>
- </TableRow>
- <Show when={row.lastErrorMessage}>
- <TableRow class="border-b border-border-subtle">
- <TableCell
- colspan={actionColumnVisible() ? 6 : 5}
- class="bg-surface px-3 pb-1.5 pt-0"
- >
+ <TableCell class="px-3 py-1 align-top">
<div
- role="alert"
- class="rounded-md border border-rose-300 bg-rose-50 px-3 py-2 text-xs text-rose-800 dark:border-rose-900 dark:bg-rose-950 dark:text-rose-200"
+ class="whitespace-normal break-words text-[12px] leading-4 text-muted"
+ title={discoveredCoverageText(server)}
>
- {row.lastErrorMessage}
+ {discoveredCoverageText(server)}
</div>
</TableCell>
- </TableRow>
- </Show>
- <Show when={row.members.length > 0}>
- <For each={row.members}>
- {(member, memberIndex) => {
- const memberPresentation = infrastructureSourcePresentation(
- member.source,
- );
- const memberSourceTitle =
- memberMethodTitleFor(row, memberIndex()) ??
- memberPresentation.title;
- return (
- <TableRow class="border-b border-border-subtle bg-surface-alt/30">
- <TableCell class="py-1 pl-3 pr-3 align-top">
- <div class="flex min-w-0 items-start gap-2 pl-4">
- <span class="mt-1.5 h-1.5 w-1.5 flex-shrink-0 rounded-full bg-border" />
- <div class="min-w-0">
- <div
- class={`text-[13px] text-base-content/85 ${wrappedFieldClass}`}
- title={member.name}
- >
- {member.name}
- </div>
- <div class="mt-0.5 text-[11px] text-muted">
- {member.subtitle}
- </div>
- </div>
- </div>
- </TableCell>
-
- <TableCell class="px-3 py-1 align-top">
- <span
- class={`${memberPresentation.badgeClassName} whitespace-nowrap`}
- title={memberSourceTitle}
- >
- {memberPresentation.label}
- </span>
- </TableCell>
+ <TableCell class="px-3 py-1 align-top">
+ <div class="flex flex-wrap items-center gap-x-1.5 gap-y-1">
+ <span class="inline-flex items-center rounded-full bg-blue-100 px-2 py-0.5 text-[11px] font-medium whitespace-nowrap text-blue-800 dark:bg-blue-950/40 dark:text-blue-200">
+ Discovered
+ </span>
+ <span class="whitespace-nowrap text-[12px] text-muted/90">
+ {lastDiscoveryResultText() ?? 'Waiting for scan'}
+ </span>
+ </div>
+ </TableCell>
- <TableCell class="px-3 py-1 align-top">
- <Show
- when={member.host}
- fallback={<span class="text-xs text-muted">-</span>}
- >
- <div
- class="truncate whitespace-nowrap text-[12px] text-muted"
- title={member.host}
- >
- {member.host}
- </div>
- </Show>
- </TableCell>
+ <Show when={actionColumnVisible()}>
+ <TableCell class="px-3 py-1 align-top text-right">
+ <Show
+ when={props.onReviewDiscoveredSource}
+ fallback={<span class="text-xs text-muted">Read only</span>}
+ >
+ <button
+ type="button"
+ onClick={() => props.onReviewDiscoveredSource?.(server)}
+ class={inlineButtonClass}
+ >
+ Review
+ </button>
+ </Show>
+ </TableCell>
+ </Show>
+ </TableRow>
+ );
+ }}
+ </For>
+ </Show>
+ </>
+ );
+ }}
+ </For>
+
+ <Show when={!hasAnyConfigured() && !hasAnyDiscovered()}>
+ <TableRow>
+ <TableCell
+ colspan={actionColumnVisible() ? 6 : 5}
+ class="px-4 py-8 text-center text-sm text-muted"
+ >
+ {emptyStateContent()}
+ </TableCell>
+ </TableRow>
+ </Show>
+
+ <Show when={!props.readOnly && props.onAddInfrastructure}>
+ <TableRow class="border-t border-border-subtle bg-surface-alt/40">
+ <TableCell colspan={actionColumnVisible() ? 6 : 5} class="px-3 py-2 text-center">
+ <button
+ type="button"
+ onClick={props.onAddInfrastructure}
+ class={`${addSectionButtonClass} whitespace-nowrap`}
+ >
+ <Plus class="h-3.5 w-3.5" />
+ Add infrastructure
+ </button>
+ </TableCell>
+ </TableRow>
+ </Show>
+ </TableBody>
+ </Table>
+ </Show>
- <TableCell class="px-3 py-1 align-top">
- <Show
- when={member.coverageLabels.length > 0}
- fallback={<span class="text-xs text-muted">-</span>}
- >
- <div
- class="whitespace-normal break-words text-[12px] leading-4 text-muted"
- title={member.coverageLabels.join(', ')}
- >
- {member.coverageLabels.join(', ')}
- </div>
- </Show>
- </TableCell>
-
- <TableCell class="px-3 py-1 align-top">
- <div class="flex flex-wrap items-center gap-x-1.5 gap-y-1">
- <span
- class={`inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium whitespace-nowrap ${member.statusClassName}`}
- >
- {member.statusLabel}
- </span>
- <span class="whitespace-nowrap text-[12px] text-muted/90">
- {member.lastActivityText}
- </span>
- </div>
- </TableCell>
-
- <Show when={actionColumnVisible()}>
- <TableCell class="px-3 py-1 align-top text-right">
- <span class="text-xs text-muted" aria-hidden="true">
- —
- </span>
- </TableCell>
- </Show>
- </TableRow>
- );
- }}
- </For>
- </Show>
- </>
- );
- }}
- </For>
- </Show>
+ <Show when={useCardLayout()}>
+ <div class="space-y-3 p-3">
+ <For each={sortedProducts()}>
+ {(product) => {
+ const configuredRows = () => groupedConfiguredRows().get(product.type) ?? [];
+ const discoveredRows = () => groupedDiscoveredRows().get(product.type) ?? [];
+
+ return (
+ <section class="space-y-2">
+ <header class="flex items-center justify-between gap-2">
+ <h3 class="text-[14px] font-semibold text-base-content">{product.label}</h3>
+ <Show when={!props.readOnly && props.onAddSource}>
+ <button
+ type="button"
+ onClick={() => props.onAddSource?.(product.type)}
+ class={`${addSectionButtonClass} whitespace-nowrap`}
+ aria-label={product.actionLabel}
+ title={product.actionLabel}
+ >
+ <Plus class="h-3.5 w-3.5" />
+ Add
+ </button>
+ </Show>
+ </header>
- <Show when={discoveredRows().length > 0}>
- <For each={discoveredRows()}>
- {(server) => {
+ <For each={configuredRows()}>
+ {(row) => {
+ const presentation = infrastructureSourcePresentation(row.source);
+ const sourceTitle = agentMethodTitleFor(row) ?? presentation.title;
return (
- <TableRow class={discoveryRowClass}>
- <TableCell class="py-1 pl-3 pr-3 align-top">
- <div
- class={`text-[13px] text-base-content/85 ${wrappedFieldClass}`}
- title={`${discoveredServerName(server)}${server.version ? ` · ${server.version}` : ''}`}
- >
- {discoveredServerName(server)}
+ <article class="rounded-md border border-border-subtle bg-surface p-3 shadow-sm">
+ <header class="flex items-start justify-between gap-2">
+ <div class="min-w-0 flex-1">
+ <div
+ class="break-words text-[13px] font-medium text-base-content"
+ title={row.name}
+ >
+ {row.name}
+ </div>
+ <Show when={row.isCluster && row.subtitle}>
+ <div class="mt-0.5 text-[11px] text-muted">{row.subtitle}</div>
+ </Show>
+ <Show when={!row.isCluster && row.identitySubtitle}>
+ <div class="mt-0.5 text-[11px] text-muted">
+ {row.identitySubtitle}
+ </div>
+ </Show>
</div>
- </TableCell>
-
- <TableCell class="px-3 py-1 align-top">
<span
- class="inline-flex items-center rounded-full border border-dashed border-border bg-surface-alt px-2 py-0.5 text-[11px] font-medium text-muted whitespace-nowrap"
- title="Discovery candidate — review to attach a source"
+ class={`${presentation.badgeClassName} flex-shrink-0`}
+ title={sourceTitle}
>
- Candidate
+ {presentation.label}
</span>
- </TableCell>
+ </header>
- <TableCell class="px-3 py-1 align-top">
- <div
- class="truncate whitespace-nowrap text-[12px] text-muted"
- title={discoveredServerEndpoint(server)}
- >
- {discoveredServerEndpoint(server)}
+ <Show when={row.host}>
+ <div class="mt-1 truncate text-[12px] text-muted" title={row.host}>
+ {row.host}
</div>
- </TableCell>
+ </Show>
- <TableCell class="px-3 py-1 align-top">
- <div
- class="whitespace-normal break-words text-[12px] leading-4 text-muted"
- title={discoveredCoverageText(server)}
- >
- {discoveredCoverageText(server)}
+ <Show when={row.coverageLabels.length > 0}>
+ <div class="mt-1 text-[12px] leading-4 text-muted">
+ {row.coverageLabels.join(', ')}
</div>
- </TableCell>
+ </Show>
- <TableCell class="px-3 py-1 align-top">
- <div class="flex flex-wrap items-center gap-x-1.5 gap-y-1">
- <span class="inline-flex items-center rounded-full bg-blue-100 px-2 py-0.5 text-[11px] font-medium whitespace-nowrap text-blue-800 dark:bg-blue-950/40 dark:text-blue-200">
- Discovered
- </span>
- <span class="whitespace-nowrap text-[12px] text-muted/90">
- {lastDiscoveryResultText() ?? 'Waiting for scan'}
- </span>
+ <Show when={row.members.length > 0}>
+ <div class="mt-3 border-t border-border-subtle pt-2">
+ <div class="text-[11px] font-medium uppercase tracking-[0.08em] text-muted">
+ Cluster nodes
+ </div>
+ <div class="mt-2 space-y-2">
+ <For each={row.members}>
+ {(member, memberIndex) => {
+ const memberPresentation = infrastructureSourcePresentation(
+ member.source,
+ );
+ const memberSourceTitle =
+ memberMethodTitleFor(row, memberIndex()) ??
+ memberPresentation.title;
+ return (
+ <div class="rounded-md border border-border-subtle bg-surface-alt/30 px-2.5 py-2">
+ <div class="flex items-start justify-between gap-2">
+ <div class="min-w-0 flex-1">
+ <div
+ class="break-words text-[13px] font-medium text-base-content"
+ title={member.name}
+ >
+ {member.name}
+ </div>
+ <div class="mt-0.5 text-[11px] text-muted">
+ {member.subtitle}
+ </div>
+ </div>
+ <span
+ class={`${memberPresentation.badgeClassName} flex-shrink-0`}
+ title={memberSourceTitle}
+ >
+ {memberPresentation.label}
+ </span>
+ </div>
+
+ <Show when={member.host}>
+ <div
+ class="mt-1 truncate text-[12px] text-muted"
+ title={member.host}
+ >
+ {member.host}
+ </div>
+ </Show>
+
+ <Show when={member.coverageLabels.length > 0}>
+ <div class="mt-1 text-[12px] leading-4 text-muted">
+ {member.coverageLabels.join(', ')}
+ </div>
+ </Show>
+
+ <div class="mt-2 flex flex-wrap items-center gap-1.5">
+ <span
+ class={`inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium whitespace-nowrap ${member.statusClassName}`}
+ >
+ {member.statusLabel}
+ </span>
+ <span class="text-[12px] text-muted/90">
+ {member.lastActivityText}
+ </span>
+ </div>
+ </div>
+ );
+ }}
+ </For>
+ </div>
</div>
- </TableCell>
+ </Show>
- <Show when={actionColumnVisible()}>
- <TableCell class="px-3 py-1 align-top text-right">
- <Show
- when={props.onReviewDiscoveredSource}
- fallback={<span class="text-xs text-muted">Read only</span>}
+ <footer class="mt-2 flex items-center justify-between gap-2 border-t border-border-subtle pt-2">
+ <div class="flex flex-wrap items-center gap-1.5">
+ <span
+ class={`inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium whitespace-nowrap ${row.statusClassName}`}
>
- <button
- type="button"
- onClick={() => props.onReviewDiscoveredSource?.(server)}
- class={inlineButtonClass}
- >
- Review
- </button>
+ {row.statusLabel}
+ </span>
+ <Show when={row.agentUpdateCount > 0}>
+ <span class="inline-flex items-center rounded-full bg-amber-100 px-2 py-0.5 text-[11px] font-medium text-amber-800 dark:bg-amber-900 dark:text-amber-200">
+ {row.agentUpdateCount === 1
+ ? 'Agent update'
+ : `${row.agentUpdateCount} agent updates`}
+ </span>
</Show>
- </TableCell>
+ <span class="text-[12px] text-muted/90">
+ {row.lastActivityText}
+ </span>
+ </div>
+ <Show when={!props.readOnly && rowInteractive(row)}>
+ <button
+ type="button"
+ onClick={() => props.onOpenConnection?.(row)}
+ class={`${inlineButtonClass} flex-shrink-0`}
+ >
+ Edit
+ </button>
+ </Show>
+ </footer>
+
+ <Show when={row.lastErrorMessage}>
+ <div
+ role="alert"
+ class="mt-2 rounded-md border border-rose-300 bg-rose-50 px-3 py-2 text-xs text-rose-800 dark:border-rose-900 dark:bg-rose-950 dark:text-rose-200"
+ >
+ {row.lastErrorMessage}
+ </div>
</Show>
- </TableRow>
+ </article>
);
}}
</For>
- </Show>
- </>
- );
- }}
- </For>
-
- <Show when={!hasAnyConfigured() && !hasAnyDiscovered()}>
- <TableRow>
- <TableCell
- colspan={actionColumnVisible() ? 6 : 5}
- class="px-3 py-6 text-center text-sm text-muted"
- >
- No infrastructure configured yet.
- </TableCell>
- </TableRow>
- </Show>
-
- <Show when={!props.readOnly && props.onAddInfrastructure}>
- <TableRow class="border-t border-border-subtle bg-surface-alt/40">
- <TableCell
- colspan={actionColumnVisible() ? 6 : 5}
- class="px-3 py-2 text-center"
- >
- <button
- type="button"
- onClick={props.onAddInfrastructure}
- class={`${addSectionButtonClass} whitespace-nowrap`}
- >
- <Plus class="h-3.5 w-3.5" />
- Add infrastructure
- </button>
- </TableCell>
- </TableRow>
- </Show>
- </TableBody>
- </Table>
- </Show>
-
- <Show when={useCardLayout()}>
- <div class="space-y-3 p-3">
- <For each={sortedProducts()}>
- {(product) => {
- const configuredRows = () => groupedConfiguredRows().get(product.type) ?? [];
- const discoveredRows = () => groupedDiscoveredRows().get(product.type) ?? [];
-
- return (
- <section class="space-y-2">
- <header class="flex items-center justify-between gap-2">
- <h3 class="text-[14px] font-semibold text-base-content">{product.label}</h3>
- <Show when={!props.readOnly && props.onAddSource}>
- <button
- type="button"
- onClick={() => props.onAddSource?.(product.type)}
- class={`${addSectionButtonClass} whitespace-nowrap`}
- aria-label={product.actionLabel}
- title={product.actionLabel}
- >
- <Plus class="h-3.5 w-3.5" />
- Add
- </button>
- </Show>
- </header>
-
- <For each={configuredRows()}>
- {(row) => {
- const presentation = infrastructureSourcePresentation(row.source);
- const sourceTitle = agentMethodTitleFor(row) ?? presentation.title;
- return (
- <article class="rounded-md border border-border-subtle bg-surface p-3 shadow-sm">
- <header class="flex items-start justify-between gap-2">
- <div class="min-w-0 flex-1">
+
+ <For each={discoveredRows()}>
+ {(server) => (
+ <article class="rounded-md border border-blue-200 bg-blue-50/50 p-3 shadow-sm dark:border-blue-900 dark:bg-blue-950/20">
+ <header class="flex items-start justify-between gap-2">
<div
- class="break-words text-[13px] font-medium text-base-content"
- title={row.name}
+ class="min-w-0 flex-1 break-words text-[13px] font-medium text-base-content"
+ title={`${discoveredServerName(server)}${server.version ? ` · ${server.version}` : ''}`}
>
- {row.name}
+ {discoveredServerName(server)}
</div>
- <Show when={row.isCluster && row.subtitle}>
- <div class="mt-0.5 text-[11px] text-muted">{row.subtitle}</div>
- </Show>
- <Show when={!row.isCluster && row.identitySubtitle}>
- <div class="mt-0.5 text-[11px] text-muted">
- {row.identitySubtitle}
- </div>
- </Show>
- </div>
- <span
- class={`${presentation.badgeClassName} flex-shrink-0`}
- title={sourceTitle}
- >
- {presentation.label}
- </span>
- </header>
+ <span
+ class="inline-flex flex-shrink-0 items-center rounded-full border border-dashed border-border bg-surface-alt px-2 py-0.5 text-[11px] font-medium text-muted whitespace-nowrap"
+ title="Discovery candidate — review to attach a source"
+ >
+ Candidate
+ </span>
+ </header>
- <Show when={row.host}>
<div
class="mt-1 truncate text-[12px] text-muted"
- title={row.host}
+ title={discoveredServerEndpoint(server)}
>
- {row.host}
+ {discoveredServerEndpoint(server)}
</div>
- </Show>
- <Show when={row.coverageLabels.length > 0}>
<div class="mt-1 text-[12px] leading-4 text-muted">
- {row.coverageLabels.join(', ')}
+ {discoveredCoverageText(server)}
</div>
- </Show>
- <Show when={row.members.length > 0}>
- <div class="mt-3 border-t border-border-subtle pt-2">
- <div class="text-[11px] font-medium uppercase tracking-[0.08em] text-muted">
- Cluster nodes
- </div>
- <div class="mt-2 space-y-2">
- <For each={row.members}>
- {(member, memberIndex) => {
- const memberPresentation = infrastructureSourcePresentation(
- member.source,
- );
- const memberSourceTitle =
- memberMethodTitleFor(row, memberIndex()) ??
- memberPresentation.title;
- return (
- <div class="rounded-md border border-border-subtle bg-surface-alt/30 px-2.5 py-2">
- <div class="flex items-start justify-between gap-2">
- <div class="min-w-0 flex-1">
- <div
- class="break-words text-[13px] font-medium text-base-content"
- title={member.name}
- >
- {member.name}
- </div>
- <div class="mt-0.5 text-[11px] text-muted">
- {member.subtitle}
- </div>
- </div>
- <span
- class={`${memberPresentation.badgeClassName} flex-shrink-0`}
- title={memberSourceTitle}
- >
- {memberPresentation.label}
- </span>
- </div>
-
- <Show when={member.host}>
- <div class="mt-1 truncate text-[12px] text-muted" title={member.host}>
- {member.host}
- </div>
- </Show>
-
- <Show when={member.coverageLabels.length > 0}>
- <div class="mt-1 text-[12px] leading-4 text-muted">
- {member.coverageLabels.join(', ')}
- </div>
- </Show>
-
- <div class="mt-2 flex flex-wrap items-center gap-1.5">
- <span
- class={`inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium whitespace-nowrap ${member.statusClassName}`}
- >
- {member.statusLabel}
- </span>
- <span class="text-[12px] text-muted/90">
- {member.lastActivityText}
- </span>
- </div>
- </div>
- );
- }}
- </For>
- </div>
- </div>
- </Show>
-
- <footer class="mt-2 flex items-center justify-between gap-2 border-t border-border-subtle pt-2">
- <div class="flex flex-wrap items-center gap-1.5">
- <span
- class={`inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium whitespace-nowrap ${row.statusClassName}`}
- >
- {row.statusLabel}
- </span>
- <Show when={row.agentUpdateCount > 0}>
- <span class="inline-flex items-center rounded-full bg-amber-100 px-2 py-0.5 text-[11px] font-medium text-amber-800 dark:bg-amber-900 dark:text-amber-200">
- {row.agentUpdateCount === 1
- ? 'Agent update'
- : `${row.agentUpdateCount} agent updates`}
+ <footer class="mt-2 flex items-center justify-between gap-2 border-t border-border-subtle pt-2">
+ <div class="flex flex-wrap items-center gap-1.5">
+ <span class="inline-flex items-center rounded-full bg-blue-100 px-2 py-0.5 text-[11px] font-medium text-blue-800 dark:bg-blue-950/40 dark:text-blue-200">
+ Discovered
</span>
+ <span class="text-[12px] text-muted/90">
+ {lastDiscoveryResultText() ?? 'Waiting for scan'}
+ </span>
+ </div>
+ <Show when={!props.readOnly && props.onReviewDiscoveredSource}>
+ <button
+ type="button"
+ onClick={() => props.onReviewDiscoveredSource?.(server)}
+ class={`${inlineButtonClass} flex-shrink-0`}
+ >
+ Review
+ </button>
</Show>
- <span class="text-[12px] text-muted/90">
- {row.lastActivityText}
- </span>
- </div>
- <Show when={!props.readOnly && rowInteractive(row)}>
- <button
- type="button"
- onClick={() => props.onOpenConnection?.(row)}
- class={`${inlineButtonClass} flex-shrink-0`}
- >
- Edit
- </button>
- </Show>
- </footer>
-
- <Show when={row.lastErrorMessage}>
- <div
- role="alert"
- class="mt-2 rounded-md border border-rose-300 bg-rose-50 px-3 py-2 text-xs text-rose-800 dark:border-rose-900 dark:bg-rose-950 dark:text-rose-200"
- >
- {row.lastErrorMessage}
- </div>
- </Show>
- </article>
- );
- }}
- </For>
-
- <For each={discoveredRows()}>
- {(server) => (
- <article class="rounded-md border border-blue-200 bg-blue-50/50 p-3 shadow-sm dark:border-blue-900 dark:bg-blue-950/20">
- <header class="flex items-start justify-between gap-2">
- <div
- class="min-w-0 flex-1 break-words text-[13px] font-medium text-base-content"
- title={`${discoveredServerName(server)}${server.version ? ` · ${server.version}` : ''}`}
- >
- {discoveredServerName(server)}
- </div>
- <span
- class="inline-flex flex-shrink-0 items-center rounded-full border border-dashed border-border bg-surface-alt px-2 py-0.5 text-[11px] font-medium text-muted whitespace-nowrap"
- title="Discovery candidate — review to attach a source"
- >
- Candidate
- </span>
- </header>
-
- <div
- class="mt-1 truncate text-[12px] text-muted"
- title={discoveredServerEndpoint(server)}
- >
- {discoveredServerEndpoint(server)}
- </div>
-
- <div class="mt-1 text-[12px] leading-4 text-muted">
- {discoveredCoverageText(server)}
- </div>
-
- <footer class="mt-2 flex items-center justify-between gap-2 border-t border-border-subtle pt-2">
- <div class="flex flex-wrap items-center gap-1.5">
- <span class="inline-flex items-center rounded-full bg-blue-100 px-2 py-0.5 text-[11px] font-medium text-blue-800 dark:bg-blue-950/40 dark:text-blue-200">
- Discovered
- </span>
- <span class="text-[12px] text-muted/90">
- {lastDiscoveryResultText() ?? 'Waiting for scan'}
- </span>
- </div>
- <Show when={!props.readOnly && props.onReviewDiscoveredSource}>
- <button
- type="button"
- onClick={() => props.onReviewDiscoveredSource?.(server)}
- class={`${inlineButtonClass} flex-shrink-0`}
- >
- Review
- </button>
- </Show>
- </footer>
- </article>
- )}
- </For>
- </section>
- );
- }}
- </For>
-
- <Show when={!hasAnyConfigured() && !hasAnyDiscovered()}>
- <div class="rounded-md border border-dashed border-border px-3 py-6 text-center text-sm text-muted">
- No infrastructure configured yet.
- </div>
- </Show>
+ </footer>
+ </article>
+ )}
+ </For>
+ </section>
+ );
+ }}
+ </For>
+
+ <Show when={!hasAnyConfigured() && !hasAnyDiscovered()}>
+ <div class="rounded-md border border-dashed border-border px-3 py-6 text-center text-sm text-muted">
+ {emptyStateContent()}
+ </div>
+ </Show>
- <Show when={!props.readOnly && props.onAddInfrastructure}>
- <div class="border-t border-border-subtle pt-3 text-center">
- <button
- type="button"
- onClick={props.onAddInfrastructure}
- class={`${addSectionButtonClass} whitespace-nowrap`}
- >
- <Plus class="h-3.5 w-3.5" />
- Add infrastructure
- </button>
+ <Show when={!props.readOnly && props.onAddInfrastructure}>
+ <div class="border-t border-border-subtle pt-3 text-center">
+ <button
+ type="button"
+ onClick={props.onAddInfrastructure}
+ class={`${addSectionButtonClass} whitespace-nowrap`}
+ >
+ <Plus class="h-3.5 w-3.5" />
+ Add infrastructure
+ </button>
+ </div>
+ </Show>
</div>
</Show>
- </div>
- </Show>
</SettingsPanel>
</div>
);
diff --git a/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx b/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx
index e27282bca4..c84eae9db2 100644
--- a/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx
+++ b/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx
@@ -875,6 +875,7 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
: (type) => openAddFlow(type === 'agent' ? 'agent' : (type as ManagedAddTypeStep))
}
onAddInfrastructure={readOnly() ? undefined : () => openAddFlow('pick')}
+ onDetectFromAddress={readOnly() ? undefined : () => openAddFlow('detect')}
onRunDiscovery={
readOnly()
? undefined
diff --git a/frontend-modern/src/components/Settings/NodeModalAuthenticationSection.tsx b/frontend-modern/src/components/Settings/NodeModalAuthenticationSection.tsx
index b68370ced1..8644342b2b 100644
--- a/frontend-modern/src/components/Settings/NodeModalAuthenticationSection.tsx
+++ b/frontend-modern/src/components/Settings/NodeModalAuthenticationSection.tsx
@@ -22,12 +22,7 @@ export const NodeModalAuthenticationSection: Component<NodeModalAuthenticationSe
return (
<div>
- <SectionHeader
- title="Authentication"
- size="sm"
- class="mb-4"
- titleClass="text-base-content"
- />
+ <SectionHeader title="Authentication" size="sm" class="mb-4" titleClass="text-base-content" />
<div class="mb-4">
<div class="flex gap-4">
@@ -62,8 +57,8 @@ export const NodeModalAuthenticationSection: Component<NodeModalAuthenticationSe
<Show when={modalProps.nodeType === 'pmg'}>
<p class="text-xs text-muted mt-2">
Proxmox Mail Gateway does not support API tokens. Use a service account with password
- authentication (for example <code>root@pam</code> or a dedicated{' '}
- <code>api@pmg</code> user).
+ authentication (for example <code>root@pam</code> or a dedicated <code>api@pmg</code>{' '}
+ user).
</p>
</Show>
</div>
@@ -98,7 +93,9 @@ export const NodeModalAuthenticationSection: Component<NodeModalAuthenticationSe
type="password"
value={state.formData().password}
onInput={(event) => state.updateField('password', event.currentTarget.value)}
- placeholder={state.isEditingExistingNode() ? 'Leave blank to keep existing' : 'Password'}
+ placeholder={
+ state.isEditingExistingNode() ? 'Leave blank to keep existing' : 'Password'
+ }
required={state.formData().authType === 'password' && !state.isEditingExistingNode()}
class={controlClass()}
/>
@@ -110,44 +107,58 @@ export const NodeModalAuthenticationSection: Component<NodeModalAuthenticationSe
<div class="space-y-4">
<NodeModalSetupGuideSection modalProps={modalProps} state={state} />
- <div class="grid grid-cols-1 gap-4 md:grid-cols-2">
- <div class={formField}>
- <label class={labelClass()}>
- Token ID <span class="text-red-500">*</span>
- </label>
- <input
- type="text"
- value={state.formData().tokenName}
- onInput={(event) => state.updateField('tokenName', event.currentTarget.value)}
- placeholder={getNodeTokenIdPlaceholder(modalProps.nodeType)}
- required={state.formData().authType === 'token'}
- class={controlClass('font-mono')}
- />
- <p class={formHelpText}>Full token ID from Proxmox (user@realm!tokenname).</p>
+ <Show when={state.formData().setupMode === 'manual'}>
+ <div class="rounded-md border border-border bg-surface-alt px-3 py-2 text-xs leading-5 text-muted">
+ Use the manual token path only when you already created the API token yourself. The
+ automatic setup paths register the node without copying token credentials into this
+ form.
</div>
- <div class={formField}>
- <label class={labelClass('flex items-center gap-2')}>
- Token Value
- <Show when={!state.isEditingExistingNode()}>
- <span class="text-red-500">*</span>
- </Show>
- </label>
- <input
- type="password"
- value={state.formData().tokenValue}
- onInput={(event) => state.updateField('tokenValue', event.currentTarget.value)}
- placeholder={
- state.isEditingExistingNode()
- ? 'Leave blank to keep existing'
- : 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
- }
- required={state.formData().authType === 'token' && !state.isEditingExistingNode()}
- class={controlClass('font-mono')}
- />
- <p class={formHelpText}>The secret value shown when creating the token.</p>
+ <div class="grid grid-cols-1 gap-4 md:grid-cols-2">
+ <div class={formField}>
+ <label class={labelClass()}>
+ Token ID <span class="text-red-500">*</span>
+ </label>
+ <input
+ type="text"
+ value={state.formData().tokenName}
+ onInput={(event) => state.updateField('tokenName', event.currentTarget.value)}
+ placeholder={getNodeTokenIdPlaceholder(modalProps.nodeType)}
+ required={
+ state.formData().authType === 'token' && state.formData().setupMode === 'manual'
+ }
+ class={controlClass('font-mono')}
+ />
+ <p class={formHelpText}>Full token ID from Proxmox (user@realm!tokenname).</p>
+ </div>
+
+ <div class={formField}>
+ <label class={labelClass('flex items-center gap-2')}>
+ Token Value
+ <Show when={!state.isEditingExistingNode()}>
+ <span class="text-red-500">*</span>
+ </Show>
+ </label>
+ <input
+ type="password"
+ value={state.formData().tokenValue}
+ onInput={(event) => state.updateField('tokenValue', event.currentTarget.value)}
+ placeholder={
+ state.isEditingExistingNode()
+ ? 'Leave blank to keep existing'
+ : 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
+ }
+ required={
+ state.formData().authType === 'token' &&
+ state.formData().setupMode === 'manual' &&
+ !state.isEditingExistingNode()
+ }
+ class={controlClass('font-mono')}
+ />
+ <p class={formHelpText}>The secret value shown when creating the token.</p>
+ </div>
</div>
- </div>
+ </Show>
</div>
</Show>
</div>
diff --git a/frontend-modern/src/components/Settings/NodeModalStatusFooter.tsx b/frontend-modern/src/components/Settings/NodeModalStatusFooter.tsx
index 341ad7c4e6..c9213d75eb 100644
--- a/frontend-modern/src/components/Settings/NodeModalStatusFooter.tsx
+++ b/frontend-modern/src/components/Settings/NodeModalStatusFooter.tsx
@@ -17,6 +17,15 @@ interface NodeModalStatusFooterProps {
export const NodeModalStatusFooter: Component<NodeModalStatusFooterProps> = (props) => {
const { modalProps, state } = props;
+ const guidedSetupOnlyMode = () =>
+ !state.isEditingExistingNode() &&
+ modalProps.nodeType !== 'pmg' &&
+ state.formData().authType === 'token' &&
+ state.formData().setupMode !== 'manual';
+ const guidedSetupFooterHint = () =>
+ state.formData().setupMode === 'agent'
+ ? 'Run the generated command on the host. Pulse adds the node automatically after the agent starts.'
+ : 'Run the generated command on the host. Pulse adds the API connection automatically after the setup script finishes.';
return (
<>
@@ -84,7 +93,9 @@ export const NodeModalStatusFooter: Component<NodeModalStatusFooterProps> = (pro
<div class="mt-2 space-y-1">
<p class="text-xs font-semibold opacity-90">Warnings:</p>
<ul class="text-xs space-y-0.5 opacity-80">
- <For each={state.testResult()?.warnings}>{(warning) => <li>• {warning}</li>}</For>
+ <For each={state.testResult()?.warnings}>
+ {(warning) => <li>• {warning}</li>}
+ </For>
</ul>
</div>
</Show>
@@ -152,14 +163,21 @@ export const NodeModalStatusFooter: Component<NodeModalStatusFooterProps> = (pro
: 'Delete connection'}
</button>
</Show>
- <button
- type="button"
- onClick={state.handleTestConnection}
- disabled={state.isTesting() || props.togglePending || props.deletePending}
- class="px-4 py-2 text-sm border border-border text-base-content rounded-md hover:bg-surface-hover transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
+ <Show
+ when={!guidedSetupOnlyMode()}
+ fallback={
+ <p class="max-w-md text-xs leading-5 text-muted">{guidedSetupFooterHint()}</p>
+ }
>
- {state.isTesting() ? 'Testing...' : 'Test Connection'}
- </button>
+ <button
+ type="button"
+ onClick={state.handleTestConnection}
+ disabled={state.isTesting() || props.togglePending || props.deletePending}
+ class="px-4 py-2 text-sm border border-border text-base-content rounded-md hover:bg-surface-hover transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
+ >
+ {state.isTesting() ? 'Testing...' : 'Test Connection'}
+ </button>
+ </Show>
</div>
<div class="flex items-center gap-3">
@@ -208,15 +226,17 @@ export const NodeModalStatusFooter: Component<NodeModalStatusFooterProps> = (pro
disabled={props.togglePending || props.deletePending}
class="px-4 py-2 text-sm border border-border text-base-content rounded-md hover:bg-surface-hover transition-colors"
>
- Cancel
- </button>
- <button
- type="submit"
- disabled={props.togglePending || props.deletePending}
- class="px-4 py-2 text-sm bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
- >
- {state.isEditingExistingNode() ? 'Update' : 'Add'} Node
+ {guidedSetupOnlyMode() ? 'Close' : 'Cancel'}
</button>
+ <Show when={!guidedSetupOnlyMode()}>
+ <button
+ type="submit"
+ disabled={props.togglePending || props.deletePending}
+ class="px-4 py-2 text-sm bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
+ >
+ {state.isEditingExistingNode() ? 'Update' : 'Add'} Node
+ </button>
+ </Show>
</div>
</div>
</>
diff --git a/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx b/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx
index b63587053f..6069f81804 100644
--- a/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx
@@ -287,9 +287,15 @@ describe('InfrastructureWorkspace', () => {
renderWorkspace();
await waitFor(() => expect(screen.getByText('Infrastructure systems')).toBeInTheDocument());
+ expect(screen.getByText('Start by connecting what Pulse should monitor')).toBeInTheDocument();
+ expect(
+ screen.getByText(/Pulse 6 treats platform APIs and host agents as infrastructure sources/i),
+ ).toBeInTheDocument();
expect(screen.getByRole('button', { name: /Run discovery/i })).toBeInTheDocument();
expect(screen.getByRole('button', { name: /Discovery settings/i })).toBeInTheDocument();
- expect(screen.queryByRole('button', { name: /Detect from address/i })).toBeNull();
+ expect(screen.getByRole('button', { name: /Detect from address/i })).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: /Install Pulse Agent/i })).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: /Choose source type/i })).toBeInTheDocument();
expect(screen.getByText('Proxmox VE')).toBeInTheDocument();
expect(screen.getByText('Proxmox VE').closest('tr')?.className).toContain('bg-base');
expect(screen.queryByText('VMware vCenter')).toBeNull();
@@ -303,6 +309,27 @@ describe('InfrastructureWorkspace', () => {
expect(screen.queryByRole('heading', { name: 'Monitored systems' })).not.toBeInTheDocument();
});
+ it('routes first-run actions from the source manager guidance', async () => {
+ renderWorkspace();
+
+ await waitFor(() => expect(screen.getByText('Infrastructure systems')).toBeInTheDocument());
+
+ fireEvent.click(screen.getByRole('button', { name: /Detect from address/i }));
+ expect(navigateSpy).toHaveBeenLastCalledWith('/settings/infrastructure?add=detect', {
+ scroll: false,
+ });
+
+ fireEvent.click(screen.getByRole('button', { name: /Install Pulse Agent/i }));
+ expect(navigateSpy).toHaveBeenLastCalledWith('/settings/infrastructure?add=agent', {
+ scroll: false,
+ });
+
+ fireEvent.click(screen.getByRole('button', { name: /Choose source type/i }));
+ expect(navigateSpy).toHaveBeenLastCalledWith('/settings/infrastructure?add=pick', {
+ scroll: false,
+ });
+ });
+
it('switches the source manager layout from measured container width during live resize', async () => {
installResizeObserverMock();
Object.defineProperty(window, 'innerWidth', {
@@ -327,6 +354,22 @@ describe('InfrastructureWorkspace', () => {
expect(screen.getByText('Active')).toBeInTheDocument();
});
+ it('keeps onboarding copy visible in the empty infrastructure state', async () => {
+ connectionState.connections = [];
+ connectionState.rows = [];
+
+ renderWorkspace();
+
+ await waitFor(() =>
+ expect(screen.getByText('Start monitoring infrastructure')).toBeInTheDocument(),
+ );
+ expect(
+ screen.getByText('Add infrastructure systems to start monitoring your environment.'),
+ ).toBeInTheDocument();
+ expect(screen.getByText(/Available system types: VMware vCenter/i)).toBeInTheDocument();
+ expect(screen.getByText(/standalone hosts through Pulse Agent/i)).toBeInTheDocument();
+ });
+
it('routes discovery actions from the manager and shows discovered candidates in the matching platform group', async () => {
const triggerDiscoveryScan = vi.fn();
renderWorkspace({
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
index fecbeb3b43..821121e9ba 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
@@ -15,6 +15,9 @@ import connectionEditorSource from '../ConnectionEditor/ConnectionEditor.tsx?raw
import addressProbeStepSource from '../ConnectionEditor/AddressProbeStep.tsx?raw';
import connectionEditorStateSource from '../ConnectionEditor/useConnectionEditor.ts?raw';
import nodeCredentialSlotSource from '../ConnectionEditor/CredentialSlots/NodeCredentialSlot.tsx?raw';
+import nodeModalAuthenticationSectionSource from '../NodeModalAuthenticationSection.tsx?raw';
+import nodeModalStatusFooterSource from '../NodeModalStatusFooter.tsx?raw';
+import nodeModalStateSource from '../useNodeModalState.ts?raw';
import trueNASCredentialSlotSource from '../ConnectionEditor/CredentialSlots/TrueNASCredentialSlot.tsx?raw';
import vmwareCredentialSlotSource from '../ConnectionEditor/CredentialSlots/VMwareCredentialSlot.tsx?raw';
import diagnosticsResultsPanelSource from '../DiagnosticsResultsPanel.tsx?raw';
@@ -168,7 +171,13 @@ describe('settings architecture guardrails', () => {
expect(infrastructureSourceManagerSource).toContain('aria-label={product.actionLabel}');
expect(infrastructureSourceManagerSource).toContain('Review');
expect(infrastructureSourceManagerSource).toContain('Edit');
- expect(infrastructureSourceManagerSource).not.toContain('Detect from address');
+ expect(infrastructureSourceManagerSource).toContain(
+ 'Start by connecting what Pulse should monitor',
+ );
+ expect(infrastructureSourceManagerSource).toContain('Detect from address');
+ expect(infrastructureSourceManagerSource).toContain('Install Pulse Agent');
+ expect(infrastructureSourceManagerSource).toContain('Choose source type');
+ expect(infrastructureSourceManagerSource).toContain('getInfrastructureEmptyStateSummary');
expect(infrastructureSourceManagerSource).not.toContain('Connection types');
expect(infrastructureSourcePickerSource).toContain('Detect from address');
expect(infrastructureSourcePickerSource).toContain('getInfrastructureSourcePickerGroups');
@@ -230,6 +239,11 @@ describe('settings architecture guardrails', () => {
expect(nodeCredentialSlotSource).toContain('<NodeModalMonitoringSection');
expect(nodeCredentialSlotSource).toContain('<NodeModalStatusFooter');
expect(nodeCredentialSlotSource).not.toContain('<Dialog');
+ expect(nodeModalAuthenticationSectionSource).toContain(
+ "state.formData().setupMode === 'manual'",
+ );
+ expect(nodeModalStatusFooterSource).toContain('guidedSetupOnlyMode');
+ expect(nodeModalStateSource).toContain('data.setupMode !==');
expect(vmwareCredentialSlotSource).toContain('TlsVerificationWarningBanner');
expect(vmwareCredentialSlotSource).toContain('subject="this vCenter connection"');
diff --git a/frontend-modern/src/components/Settings/useNodeModalState.ts b/frontend-modern/src/components/Settings/useNodeModalState.ts
index 1ec9952b6a..50302d60ee 100644
--- a/frontend-modern/src/components/Settings/useNodeModalState.ts
+++ b/frontend-modern/src/components/Settings/useNodeModalState.ts
@@ -96,10 +96,7 @@ export const useNodeModalState = (props: NodeModalProps) => {
}
};
- const copyProxmoxAgentInstallCommand = async (
- type: 'pve' | 'pbs',
- successMessage: string,
- ) => {
+ const copyProxmoxAgentInstallCommand = async (type: 'pve' | 'pbs', successMessage: string) => {
try {
setLoadingAgentCommand(true);
setAgentCommandError(null);
@@ -356,6 +353,20 @@ export const useNodeModalState = (props: NodeModalProps) => {
event.preventDefault();
const data = formData();
+ if (
+ !isEditingExistingNode() &&
+ props.nodeType !== 'pmg' &&
+ data.authType === 'token' &&
+ data.setupMode !== 'manual'
+ ) {
+ const setupPath =
+ data.setupMode === 'agent' ? 'Pulse Agent install command' : 'setup command';
+ notificationStore.info(
+ `Run the ${setupPath} on the host. Pulse will add the node automatically.`,
+ );
+ return;
+ }
+
const normalizedName = data.name.trim() || deriveNameFromHost(data.host);
if (!normalizedName) {
notificationStore.error('Node name is required');