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 source-manager landing

rcourtman4d02f0769f2b
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index 8bfe6ecb41..1684d5066c 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -43,31 +43,34 @@ management, and fleet control surfaces.
21. `frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/TrueNASCredentialSlot.tsx`
22. `frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/VMwareCredentialSlot.tsx`
23. `frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx`
-24. `frontend-modern/src/components/Settings/infrastructureWorkspaceModel.ts`
-25. `frontend-modern/src/components/Settings/proxmoxSettingsModel.ts`
-26. `frontend-modern/src/components/Settings/ConfiguredNodeTables.tsx`
-27. `frontend-modern/src/components/Settings/SettingsSectionNav.tsx`
-28. `frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx`
-29. `frontend-modern/src/components/Settings/useInfrastructureSettingsState.ts`
-30. `frontend-modern/src/components/Settings/NodeModalAuthenticationSection.tsx`
-31. `frontend-modern/src/components/Settings/NodeModalBasicInfoSection.tsx`
-32. `frontend-modern/src/components/Settings/nodeModalModel.ts`
-33. `frontend-modern/src/components/Settings/NodeModalMonitoringSection.tsx`
-34. `frontend-modern/src/components/Settings/NodeModalSetupGuideSection.tsx`
-35. `frontend-modern/src/components/Settings/NodeModalStatusFooter.tsx`
-36. `frontend-modern/src/components/Settings/useNodeModalState.ts`
-37. `frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx`
-38. `frontend-modern/src/components/Infrastructure/deploy/ResultsStep.tsx`
-39. `frontend-modern/src/utils/agentProfilesPresentation.ts`
-40. `frontend-modern/src/utils/agentInstallCommand.ts`
-41. `frontend-modern/src/api/nodes.ts`
-42. `frontend-modern/src/components/Settings/InfrastructureInstallerSection.tsx`
-43. `frontend-modern/src/components/Settings/useInfrastructureInstallState.tsx`
-44. `frontend-modern/src/components/Settings/infrastructureSettingsModel.ts`
-45. `frontend-modern/src/components/Settings/useInfrastructureConfiguredNodesState.ts`
-46. `frontend-modern/src/components/Settings/useInfrastructureDiscoveryRuntimeState.ts`
-47. `frontend-modern/src/utils/infrastructureSettingsPresentation.ts`
-48. `frontend-modern/src/utils/agentCapabilityPresentation.ts`
+24. `frontend-modern/src/components/Settings/InfrastructureSourceManager.tsx`
+25. `frontend-modern/src/components/Settings/InfrastructureSourcePicker.tsx`
+26. `frontend-modern/src/components/Settings/infrastructureWorkspaceModel.ts`
+27. `frontend-modern/src/components/Settings/proxmoxSettingsModel.ts`
+28. `frontend-modern/src/components/Settings/ConfiguredNodeTables.tsx`
+29. `frontend-modern/src/components/Settings/SettingsSectionNav.tsx`
+30. `frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx`
+31. `frontend-modern/src/components/Settings/useInfrastructureSettingsState.ts`
+32. `frontend-modern/src/components/Settings/NodeModalAuthenticationSection.tsx`
+33. `frontend-modern/src/components/Settings/NodeModalBasicInfoSection.tsx`
+34. `frontend-modern/src/components/Settings/nodeModalModel.ts`
+35. `frontend-modern/src/components/Settings/NodeModalMonitoringSection.tsx`
+36. `frontend-modern/src/components/Settings/NodeModalSetupGuideSection.tsx`
+37. `frontend-modern/src/components/Settings/NodeModalStatusFooter.tsx`
+38. `frontend-modern/src/components/Settings/useNodeModalState.ts`
+39. `frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx`
+40. `frontend-modern/src/components/Infrastructure/deploy/ResultsStep.tsx`
+41. `frontend-modern/src/utils/agentProfilesPresentation.ts`
+42. `frontend-modern/src/utils/agentInstallCommand.ts`
+43. `frontend-modern/src/utils/infrastructureOnboardingPresentation.ts`
+44. `frontend-modern/src/api/nodes.ts`
+45. `frontend-modern/src/components/Settings/InfrastructureInstallerSection.tsx`
+46. `frontend-modern/src/components/Settings/useInfrastructureInstallState.tsx`
+47. `frontend-modern/src/components/Settings/infrastructureSettingsModel.ts`
+48. `frontend-modern/src/components/Settings/useInfrastructureConfiguredNodesState.ts`
+49. `frontend-modern/src/components/Settings/useInfrastructureDiscoveryRuntimeState.ts`
+50. `frontend-modern/src/utils/infrastructureSettingsPresentation.ts`
+51. `frontend-modern/src/utils/agentCapabilityPresentation.ts`
49. `frontend-modern/src/utils/agentProfileSuggestionPresentation.ts`
50. `frontend-modern/src/utils/configuredNodeCapabilityPresentation.ts`
51. `frontend-modern/src/utils/configuredNodeStatusPresentation.ts`
@@ -212,7 +215,7 @@ an add-only capacity posture.
The CLI entrypoint owns propagation of persistence context into runtime-owned helpers. When installer-selected state roots differ from the default, `cmd/pulse-agent/main.go` must pass that exact `StateDir` through both the host-agent runtime and updater startup paths instead of letting one path silently fall back to `/var/lib/pulse-agent`.
8. Add or change installer flags, persisted service arguments, or upgrade-safe re-entry behavior through `scripts/install.sh` and `scripts/install.ps1`.
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 and monitored-systems summary, 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.
+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.
Public demo and other read-only settings posture must stay reporting-first
on that same lifecycle-owned workspace boundary: infrastructure workspace
@@ -328,16 +331,15 @@ an add-only capacity posture.
endpoints that own admission checks, and the `Disabled` flag on
PVE/PBS/PMG surfaced by that ledger must remain a pause-only signal
rather than an installer pre-flight gate.
- The unified add surface is
- `frontend-modern/src/components/Settings/ConnectionEditor/ConnectionEditor.tsx`,
- mounted inline by `InfrastructureWorkspace.tsx` in place of the legacy
- type-picker step tree. The add flow must not be a right-side drawer,
- centered modal, or any other overlay chrome — it takes over the
- infrastructure workspace in place, headed by a back-to-systems
- affordance. The editor's probe step calls the aggregator probe
- endpoint and dispatches the detected or manually-selected type into a
- credential slot; it must not bypass the probe endpoint or fabricate
- probe candidates, and the agent credential slot must continue to reach
+ The unified add surface is the governed modal flow mounted by
+ `InfrastructureWorkspace.tsx`: the landing page owns the persistent
+ instance list, the picker dialog owns source-type selection, and
+ `frontend-modern/src/components/Settings/ConnectionEditor/ConnectionEditor.tsx`
+ owns detect-driven credential handoff plus type-specific form bodies.
+ The editor's probe step calls the aggregator probe endpoint and
+ dispatches the detected or manually-selected type into a credential
+ slot; it must not bypass the probe endpoint or fabricate probe
+ candidates, and the agent credential slot must continue to reach
`InfrastructureInstallerSection.tsx` so install handoffs remain on the
canonical unified-agent install path. For PVE, PBS, and PMG, the
credential slot is
@@ -985,33 +987,26 @@ Infrastructure workspace. `ConnectionsTable.tsx`,
`useInfrastructureDiscoveryRuntimeState.ts` own the fallback
install/direct/reporting operator flow, with `ConnectionsTable.tsx` plus
`connectionsTableModel.ts` as the canonical top-level infrastructure ledger
-and the inline `ConnectionEditor` credential slots as the API-backed add/edit
-surface. Operator-facing setup copy may still use `Platform connections`, but
-that label now means the shared Infrastructure onboarding path
+and the governed add/edit modals as the API-backed add/edit surface.
+Operator-facing setup copy may still use `Platform connections`, but that
+label now means the shared Infrastructure onboarding path
(`/settings/infrastructure?add=pick`) rather than a standalone
`PlatformConnectionsWorkspace.tsx` shell.
-That ledger-first default route must stay focused on one row per top-level
-monitored system. Configured platform connections must stay in secondary
-connection-management flows rather than appearing as peer rows in the default
-ledger, and movement between the connections ledger, inline add flow, and
-install surface must stay inside the single `Infrastructure` sidebar
-destination rather than reviving extra shells, tabs, or overlays.
-Those secondary infrastructure views must open through route-backed workspaces
-rather than modal overlays or stacked inline bodies. When the
-operator opens platform connection management, install tooling, or the legacy
-operations workspace route, `InfrastructureWorkspace.tsx` must keep the same
-single `Infrastructure` destination and provide explicit back navigation to
-`/settings/infrastructure` without trapping the user behind overlays or
-relegating primary setup work to a detail pattern.
-That infrastructure surface must now stay single-purpose per route-backed
-workspace: the default systems view owns the top-level monitored-system ledger,
-the connections workspace owns API-backed platform management, and the install
-workspace owns Linux/Windows/macOS/FreeBSD command generation plus the add-flow
-handoff. The shared
-Settings sidebar owns only the top-level `Infrastructure` destination; movement
-between those three jobs belongs to explicit ledger actions inside
-`InfrastructureWorkspace.tsx`, not extra sidebar entries or body-replacing
-workspace subtabs.
+That infrastructure destination now has one canonical mental model:
+configured infrastructure sources stay visible on the landing page as the
+primary objects the operator manages. The landing grid is instance-first, not
+type-first: existing connections or agent-backed hosts render as source cards,
+the same grid carries one `Add infrastructure` tile, and the monitored-system
+ledger remains secondary context below.
+Adding infrastructure therefore happens in two governed steps. The
+`?add=pick` modal owns grouped source-type selection and may offer
+`Detect from address` as a secondary utility. The `?add=detect` modal owns
+probe-driven handoff into `ConnectionEditor.tsx`, while typed add routes jump
+straight into the matching credential or install body. The shared Settings
+sidebar still owns only the top-level `Infrastructure` destination; movement
+between landing, picker, detect flow, add form, and edit form belongs to
+explicit actions inside `InfrastructureWorkspace.tsx`, not extra sidebar
+entries or body-replacing workspace subtabs.
That same lifecycle-owned platform onboarding boundary must keep API-backed
provider state operationally useful, not CRUD-only.
`useTrueNASSettingsPanelState.ts` and `useVMwareSettingsPanelState.ts` must
@@ -1071,34 +1066,19 @@ handoff copy for new operators. `InfrastructureWorkspace.tsx` must keep
workspace instead of leaving first-session guidance implicit in generic
settings-shell prose or retreating to one provider's name or one onboarding
mode as the primary story.
-That same first-run infrastructure handoff now also owns the inline
-add-infrastructure landing in `ConnectionEditor.tsx`: when the target can run
-the Unified Agent, the landing must lead with the platform-API probe and
-picker as the primary catalog story while keeping the host-install path in a
-separate secondary section instead of teaching one provider-specific shortcut
-as the frame for the whole screen. That top-level catalog must also collapse
-the Proxmox family into one peer entry rather than rendering Proxmox VE, PBS,
-and PMG as three separate first-class tiles beside VMware and TrueNAS; after
-the operator picks that family, the shared editor may present a second-step
-Proxmox product chooser before entering the inline credential slot. The shared
-grouping membership for that catalog belongs to the governed platform-support
-manifest family model rather than lane-local UI lists. Product-specific host
-advantages such as Proxmox auto-registration may be explained inside that
-host-install section, but they must not become the headline copy or top
-visual weight for the shared add-infrastructure landing, and the Unified Agent
-framing itself must remain provider-neutral rather than teaching one platform
-as the memorable reason to choose the host path. When that host-install card
-describes adjacent service discovery, it should use plain operator wording
-about detecting and connecting local services when available rather than
-platform-specific callouts or vague orchestration jargon. Returning `Back to catalog`
-must reset probe input and result state rather than reopening the landing
-with stale no-match or detected-product state already rendered, and the
-family-local `Back to platforms` path must restore the top-level platform
-catalog without entering a credential slot.
-Render-order proof for that landing belongs to DOM-backed settings tests, not
-raw source-string position checks, so lifecycle ownership continues to guard
-the operator-visible order after reasonable component extraction or copy
-refactors.
+That same first-run infrastructure handoff now also owns the instance-first
+add flow. `InfrastructureSourcePicker.tsx` must present grouped source types
+only after the operator deliberately clicks `Add infrastructure`, and
+`ConnectionEditor.tsx` must stay focused on detect-driven handoff and the
+selected type's form body instead of reviving a second top-level catalog.
+Product grouping belongs to the governed platform-support presentation helper,
+not lane-local card lists. Detect utility copy must stay provider-neutral and
+operationally plain, and returning from a chosen credential slot to detect
+must reset probe input and result state rather than reopening the editor with
+stale no-match or detected-product state already rendered. Render-order proof
+for that landing belongs to DOM-backed settings tests, not raw source-string
+position checks, so lifecycle ownership continues to guard the operator-visible
+order after reasonable component extraction or copy refactors.
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
@@ -2377,9 +2357,9 @@ lifecycle-owned update and registration paths cannot leak one test or runtime
override into another agent session.
The infrastructure workspace now uses a single flat route
(`/settings/infrastructure`) instead of the former three-sub-route layout
-(`/install`, `/platforms`, `/connections`). Panel state — which of the picker,
-agent-install, or platform-specific screens is open — is managed in-page
-through `InfrastructurePanelStep` signals rather than URL segments.
+(`/install`, `/platforms`, `/connections`). Panel state — which add/edit
+modal is open and which add step is active — is managed through the governed
+`InfrastructurePanelStep` query contract rather than URL segments.
`frontend-modern/src/components/Settings/infrastructureWorkspaceModel.ts`
exposes `buildInfrastructureWorkspacePath()` (always returns the base path
regardless of argument) and `deriveAddStepFromLegacyPath()` (maps legacy deep
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index c6b9eca5db..d1c41e6002 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -235,27 +235,28 @@ work extends shared components instead of creating new local variants.
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
`/settings/infrastructure`: the landing route should read as one
- source-manager workspace with product-type cards first and the monitored
- systems ledger as secondary summary context. Configured platform
- connections must stay visible on the landing route under those product
- cards instead of hiding behind a separate add screen, while installer
- tooling, probe/detect flows, and profile management remain secondary
- interactions opened from the same destination instead of taking over the
- whole page.
+ 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.
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.
That same shared shell boundary now owns one canonical infrastructure
destination in the Settings sidebar. `InfrastructureWorkspace.tsx` owns the
- source-manager landing plus the subordinate monitored-systems summary inside
- that destination, while route-backed add flows and local edit flows stay
- single-purpose instead of stacking multiple page-level workspaces at once.
+ source-manager landing inside that destination, while route-backed add flows
+ and local edit flows stay single-purpose instead of stacking multiple
+ page-level workspaces at once.
`InfrastructureWorkspace.tsx` must still open a new connection through
`frontend-modern/src/components/Settings/ConnectionEditor/ConnectionEditor.tsx`,
but the editor now serves as governed dialog content under the source
manager rather than replacing the page inline. The `?add=pick` route owns
- the generic detect/browse dialog, while product-type add buttons may jump
- straight into the matching credential slot through `initialType`.
+ the grouped source-type picker, `?add=detect` owns the detect-from-address
+ utility, and typed add routes jump straight into the matching credential
+ slot through `initialType`.
Credential slots are dispatched by the detected or manually-selected type
and must still reach the canonical form body rather than diverging into a
revived provider-specific workspace.
@@ -276,15 +277,14 @@ work extends shared components instead of creating new local variants.
slot is exactly the ledger-inside-editor drift this contract forbids.
The configured-connections summary and source-manager rows themselves must
render exclusively from the aggregator.
- `InfrastructureWorkspace.tsx` composes the source cards plus the subordinate
- monitored-systems table from
+ `InfrastructureWorkspace.tsx` composes the instance-first source cards plus
+ the subordinate monitored-systems table from
`frontend-modern/src/components/Settings/useConnectionsLedger.ts`
- (polling `GET /api/connections`) and renders per-source Edit, Pause, and
- Remove actions through
- `frontend-modern/src/components/Settings/useConnectionRowActions.ts`;
- last-error detail and agent uninstall commands surface on the source row or
- in the governed edit dialog rather than behind a revived provider-specific
- detail page.
+ (polling `GET /api/connections`). Source cards may open a governed edit
+ dialog for mutable sources, but pause, resume, remove, last-error detail,
+ and agent uninstall commands must live inside that owned edit surface or
+ the shared row-action owner rather than returning to inline landing-page
+ action clutter or a revived provider-specific detail page.
Phase 9 retired the
parallel reporting/inventory surface entirely:
`useInfrastructureReportingState`, `InfrastructureOperationsController`,
diff --git a/frontend-modern/src/components/Settings/ConnectionEditor/AddressProbeStep.tsx b/frontend-modern/src/components/Settings/ConnectionEditor/AddressProbeStep.tsx
index 47bf56acc8..ee9f91c237 100644
--- a/frontend-modern/src/components/Settings/ConnectionEditor/AddressProbeStep.tsx
+++ b/frontend-modern/src/components/Settings/ConnectionEditor/AddressProbeStep.tsx
@@ -9,6 +9,7 @@ export interface AddressProbeStepProps {
state: ConnectionEditorState;
onSelectCandidate: (candidate: ProbeCandidate) => void;
onInstallAgent?: () => void;
+ onChooseSourceTypeInstead?: () => void;
onProbeSubmitted?: () => void;
onProbeResolved?: (outcome: CompletedProbePhase) => void;
}
@@ -79,8 +80,20 @@ export const AddressProbeStep: Component<AddressProbeStepProps> = (props) => {
<div class="rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-100">
<div class="font-medium">No supported API-backed platform detected at that address.</div>
<div class="mt-1 text-xs">
- Pick a supported product from the catalog below, or if this is bare-metal Linux / Unraid
- / FreeBSD,{' '}
+ <Show
+ when={props.onChooseSourceTypeInstead}
+ fallback={<span>Pick a supported product from the catalog below, or if this is </span>}
+ >
+ <button
+ type="button"
+ onClick={props.onChooseSourceTypeInstead}
+ class="font-medium underline underline-offset-2 hover:text-amber-950 dark:hover:text-amber-50"
+ >
+ Choose a source type instead
+ </button>
+ <span>, or if this is </span>
+ </Show>
+ bare-metal Linux / Unraid / FreeBSD,{' '}
<Show
when={props.onInstallAgent}
fallback={<span class="font-medium">install Pulse Agent instead</span>}
diff --git a/frontend-modern/src/components/Settings/ConnectionEditor/ConnectionEditor.tsx b/frontend-modern/src/components/Settings/ConnectionEditor/ConnectionEditor.tsx
index 2baecfcb81..b2412918d0 100644
--- a/frontend-modern/src/components/Settings/ConnectionEditor/ConnectionEditor.tsx
+++ b/frontend-modern/src/components/Settings/ConnectionEditor/ConnectionEditor.tsx
@@ -1,34 +1,19 @@
-import {
- Component,
- For,
- type JSX,
- Show,
- createEffect,
- createMemo,
- createSignal,
- onMount,
-} from 'solid-js';
-import { Archive, ArrowRight, Cpu, Database, Mail, Server, ServerCog } from 'lucide-solid';
+import { Component, For, type JSX, Show, createEffect, createMemo, createSignal, onMount } from 'solid-js';
import type { ConnectionType, ProbeCandidate } from '@/api/connections';
import { AddressProbeStep } from './AddressProbeStep';
import {
- buildConnectionEditorCatalogEntries,
CONNECTION_TYPE_LABELS,
- type ConnectionEditorCatalogFamilyEntry,
- type ConnectionEditorCatalogFamilyId,
- type ConnectionEditorCatalogEntry,
createConnectionEditorState,
type ConnectionEditorState,
} from './useConnectionEditor';
import {
- INFRASTRUCTURE_AGENT_DISCOVERY_LABELS,
- INFRASTRUCTURE_ONBOARDING_PATHS,
INFRASTRUCTURE_ONBOARDING_STEPS,
- getInfrastructureApiProductsByGovernanceState,
- getInfrastructureOnboardingProductPresentation,
- getInfrastructureSupportSummaryBadges,
+ getInfrastructureAutoDetectLabels,
} from '@/utils/infrastructureOnboardingPresentation';
-import { createInfrastructureOnboardingMetricsTracker } from '@/utils/infrastructureOnboardingMetrics';
+import {
+ createInfrastructureOnboardingMetricsTracker,
+ type InfrastructureOnboardingMetricsTracker,
+} from '@/utils/infrastructureOnboardingMetrics';
export type ConnectionEditorMode = 'add' | 'edit';
@@ -48,27 +33,13 @@ export interface ConnectionEditorProps {
initialAddress?: string;
showSlotHeader?: boolean;
trackInitialCatalogSelection?: boolean;
+ onboardingMetricsTracker?: InfrastructureOnboardingMetricsTracker | null;
+ onBackToCatalog?: () => void;
renderCredentialSlot: CredentialSlotRenderer;
- manualTypeOptions?: ConnectionType[];
onClose: () => void;
onSaved?: () => void;
}
-interface TileMeta {
- icon: Component<{ class?: string }>;
-}
-
-const PLATFORM_TILE_META: Record<
- Exclude<ConnectionType, 'agent' | 'docker' | 'kubernetes'>,
- TileMeta
-> = {
- pve: { icon: Server },
- pbs: { icon: Archive },
- pmg: { icon: Mail },
- vmware: { icon: ServerCog },
- truenas: { icon: Database },
-};
-
export const ConnectionEditor: Component<ConnectionEditorProps> = (props) => {
const state: ConnectionEditorState = createConnectionEditorState();
if (props.initialAddress) {
@@ -79,26 +50,16 @@ export const ConnectionEditor: Component<ConnectionEditorProps> = (props) => {
props.initialType ?? null,
);
const [selectedCandidate, setSelectedCandidate] = createSignal<ProbeCandidate | null>(null);
- const [selectedFamilyId, setSelectedFamilyId] =
- createSignal<ConnectionEditorCatalogFamilyId | null>(null);
+ const ownsOnboardingMetricsTracker =
+ (props.mode ?? 'add') === 'add' && !props.onboardingMetricsTracker;
const onboardingMetrics =
- (props.mode ?? 'add') === 'add' ? createInfrastructureOnboardingMetricsTracker() : null;
-
- const platformCatalogEntries = createMemo<ConnectionEditorCatalogEntry[]>(() =>
- buildConnectionEditorCatalogEntries(props.manualTypeOptions),
- );
- const activeFamily = createMemo<ConnectionEditorCatalogFamilyEntry | null>(() => {
- const familyId = selectedFamilyId();
- if (!familyId) return null;
- const family = platformCatalogEntries().find(
- (entry): entry is ConnectionEditorCatalogFamilyEntry =>
- entry.kind === 'family' && entry.id === familyId,
- );
- return family ?? null;
- });
+ (props.mode ?? 'add') === 'add'
+ ? props.onboardingMetricsTracker ?? createInfrastructureOnboardingMetricsTracker()
+ : null;
const activeType = () => selectedType();
const showCredentialSlot = () => activeType() !== null;
+ const autoDetectLabels = createMemo(() => getInfrastructureAutoDetectLabels());
const recordPathSelectedForType = (type: ConnectionType) => {
onboardingMetrics?.recordPathSelected(type === 'agent' ? 'agent' : 'api');
@@ -106,7 +67,9 @@ export const ConnectionEditor: Component<ConnectionEditorProps> = (props) => {
onMount(() => {
if (!onboardingMetrics) return;
- onboardingMetrics.recordOpened();
+ if (ownsOnboardingMetricsTracker) {
+ onboardingMetrics.recordOpened();
+ }
if (props.initialType) {
recordPathSelectedForType(props.initialType);
if (props.trackInitialCatalogSelection && props.initialType !== 'agent') {
@@ -124,39 +87,18 @@ export const ConnectionEditor: Component<ConnectionEditorProps> = (props) => {
const chooseCandidate = (candidate: ProbeCandidate) => {
onboardingMetrics?.recordPathSelected('api');
setSelectedCandidate(candidate);
- setSelectedFamilyId(null);
setSelectedType(candidate.type);
};
- const chooseManualType = (
- type: ConnectionType,
- options?: {
- fromCatalog?: boolean;
- },
- ) => {
+ const chooseManualType = (type: ConnectionType) => {
recordPathSelectedForType(type);
- if (options?.fromCatalog && type !== 'agent') {
- onboardingMetrics?.recordCatalogSelected(type);
- }
setSelectedCandidate(null);
- setSelectedFamilyId(null);
setSelectedType(type);
};
- const chooseFamily = (familyId: ConnectionEditorCatalogFamilyId) => {
- onboardingMetrics?.recordPathSelected('api');
- setSelectedCandidate(null);
- setSelectedFamilyId(familyId);
- };
-
- const reopenFamilies = () => {
- setSelectedFamilyId(null);
- };
-
const reopenProbe = () => {
state.reset();
setSelectedCandidate(null);
- setSelectedFamilyId(null);
setSelectedType(null);
};
@@ -165,19 +107,8 @@ export const ConnectionEditor: Component<ConnectionEditorProps> = (props) => {
props.onClose();
};
- const supportedApiProducts = createMemo(() =>
- getInfrastructureApiProductsByGovernanceState('supported'),
- );
- const supportBadges = createMemo(() => getInfrastructureSupportSummaryBadges());
-
- const renderBadge = (label: string, tone: 'neutral' | 'accent' = 'neutral') => (
- <span
- class={
- tone === 'accent'
- ? 'inline-flex items-center rounded-full border border-blue-200 bg-blue-100 px-2 py-0.5 text-[11px] font-medium text-blue-800 dark:border-blue-900 dark:bg-blue-950/40 dark:text-blue-200'
- : 'inline-flex items-center rounded-full border border-border bg-surface px-2 py-0.5 text-[11px] font-medium text-base-content'
- }
- >
+ const renderBadge = (label: string) => (
+ <span class="inline-flex items-center rounded-full border border-border bg-surface px-2 py-0.5 text-[11px] font-medium text-base-content">
{label}
</span>
);
@@ -189,318 +120,47 @@ export const ConnectionEditor: Component<ConnectionEditorProps> = (props) => {
fallback={
<div class="space-y-6 p-4">
<section class="rounded-xl border border-border bg-surface-alt p-4">
- <div class="space-y-4">
+ <div class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
<div class="space-y-1">
- <div class="text-sm font-semibold text-base-content">
- Choose how Pulse should connect
- </div>
+ <div class="text-sm font-semibold text-base-content">Detect from address</div>
<p class="text-sm text-muted">
- Pulse can monitor supported platforms through their management APIs, or install
- Pulse Agent on a host for machine telemetry and local runtime discovery.
+ Enter a hostname, IP, or URL and Pulse will try to identify a supported
+ platform automatically before opening the matching credential form.
</p>
</div>
-
- <div class="grid grid-cols-1 gap-3 xl:grid-cols-2">
- <div class="rounded-lg border border-border bg-surface p-4">
- <div class="space-y-3">
- <div class="flex items-start justify-between gap-3">
- <div class="space-y-1">
- <div class="text-sm font-semibold text-base-content">
- {INFRASTRUCTURE_ONBOARDING_PATHS.api.title}
- </div>
- <p class="text-xs text-muted">
- {INFRASTRUCTURE_ONBOARDING_PATHS.api.bestFor}
- </p>
- </div>
- <span class="rounded-full border border-border bg-surface-alt px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted">
- API path
- </span>
- </div>
-
- <p class="text-xs text-muted">
- {INFRASTRUCTURE_ONBOARDING_PATHS.api.description}
- </p>
-
- <div class="space-y-1.5">
- <div class="text-[11px] font-medium uppercase tracking-wide text-muted">
- Supported today
- </div>
- <div class="flex flex-wrap gap-1.5">
- <For each={supportedApiProducts()}>
- {(product) => renderBadge(product.label)}
- </For>
- </div>
- </div>
-
- <Show when={supportBadges().currentAdmissionPath.length > 0}>
- <div class="space-y-1.5">
- <div class="text-[11px] font-medium uppercase tracking-wide text-muted">
- Available now
- </div>
- <div class="flex flex-wrap gap-1.5">
- <For each={supportBadges().currentAdmissionPath}>
- {(label) => renderBadge(label, 'accent')}
- </For>
- </div>
- </div>
- </Show>
-
- <p class="text-xs text-muted">
- {INFRASTRUCTURE_ONBOARDING_PATHS.api.coverage}
- </p>
- </div>
- </div>
-
- <div class="rounded-lg border border-emerald-200 bg-surface p-4 dark:border-emerald-900">
- <div class="space-y-3">
- <div class="flex items-start justify-between gap-3">
- <div class="space-y-1">
- <div class="text-sm font-semibold text-base-content">
- {INFRASTRUCTURE_ONBOARDING_PATHS.agent.title}
- </div>
- <p class="text-xs text-muted">
- {INFRASTRUCTURE_ONBOARDING_PATHS.agent.bestFor}
- </p>
- </div>
- <span class="rounded-full border border-emerald-200 bg-emerald-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-emerald-800 dark:border-emerald-900 dark:bg-emerald-900/40 dark:text-emerald-200">
- Agent path
- </span>
- </div>
-
- <p class="text-xs text-muted">
- {INFRASTRUCTURE_ONBOARDING_PATHS.agent.description}
- </p>
-
- <div class="flex flex-wrap gap-1.5">
- <For each={supportBadges().installPath}>
- {(label) => renderBadge(label)}
- </For>
- </div>
-
- <p class="text-xs text-muted">
- {INFRASTRUCTURE_ONBOARDING_PATHS.agent.coverage}
- </p>
- </div>
- </div>
- </div>
+ <Show when={props.onBackToCatalog}>
+ <button
+ type="button"
+ onClick={props.onBackToCatalog}
+ class="inline-flex items-center rounded-md border border-border px-3 py-2 text-sm font-medium text-base-content transition-colors hover:bg-surface-hover"
+ >
+ ← Back to source types
+ </button>
+ </Show>
</div>
</section>
<section class="space-y-4 rounded-xl border border-border bg-surface p-4">
<div class="space-y-1">
- <div class="text-sm font-semibold text-base-content">
- Connect a supported platform
- </div>
+ <div class="text-sm font-semibold text-base-content">Address probe</div>
<p class="text-xs text-muted">
- Paste an address to identify a supported platform automatically, or pick the
- product you already know from the catalog.
+ Pulse can auto-detect these platforms from an address when their management API
+ is reachable.
</p>
</div>
+ <div class="flex flex-wrap gap-1.5">
+ <For each={autoDetectLabels()}>{(label) => renderBadge(label)}</For>
+ </div>
+
<AddressProbeStep
state={state}
onSelectCandidate={chooseCandidate}
onInstallAgent={() => chooseManualType('agent')}
+ onChooseSourceTypeInstead={props.onBackToCatalog}
onProbeSubmitted={() => onboardingMetrics?.recordPathSelected('api')}
onProbeResolved={(outcome) => onboardingMetrics?.recordProbeResult(outcome)}
/>
-
- <Show
- when={activeFamily()}
- fallback={
- <div class="space-y-3">
- <div class="space-y-1">
- <div class="text-sm font-semibold text-base-content">
- Supported platform catalog
- </div>
- <p class="text-xs text-muted">
- Choose the product path that matches your environment when you already know
- the system type.
- </p>
- </div>
-
- <div class="grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3">
- <For each={platformCatalogEntries()}>
- {(entry) => {
- if (entry.kind === 'type') {
- const meta = PLATFORM_TILE_META[entry.type];
- const Icon = meta.icon;
- const product = getInfrastructureOnboardingProductPresentation(
- entry.type,
- );
- return (
- <button
- type="button"
- onClick={() => chooseManualType(entry.type, { fromCatalog: true })}
- class="group flex h-full flex-col gap-2 rounded-lg border border-border bg-surface p-4 text-left transition-colors hover:border-blue-500 hover:bg-blue-50/40 dark:hover:bg-blue-950/20"
- >
- <div class="flex items-center gap-2.5">
- <div
- aria-hidden="true"
- class="flex h-8 w-8 flex-none items-center justify-center rounded-md border border-border bg-surface-alt text-base-content"
- >
- <Icon class="h-4 w-4" />
- </div>
- <div class="space-y-1">
- <div class="text-sm font-semibold text-base-content">
- {product.label}
- </div>
- <Show when={product.governanceState === 'admitted'}>
- <span class="inline-flex items-center rounded-full border border-blue-200 bg-blue-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-blue-800 dark:border-blue-900 dark:bg-blue-950/40 dark:text-blue-200">
- Available now
- </span>
- </Show>
- </div>
- </div>
- <div class="text-xs text-muted">{product.catalogDescription}</div>
- <div class="text-[11px] text-muted">{product.bestFor}</div>
- </button>
- );
- }
-
- const familyLeadType = entry.childTypes[0];
- const Icon = PLATFORM_TILE_META[familyLeadType]?.icon ?? Server;
- return (
- <button
- type="button"
- onClick={() => chooseFamily(entry.id)}
- class="group flex h-full flex-col gap-2 rounded-lg border border-border bg-surface p-4 text-left transition-colors hover:border-blue-500 hover:bg-blue-50/40 dark:hover:bg-blue-950/20"
- >
- <div class="flex items-center gap-2.5">
- <div
- aria-hidden="true"
- class="flex h-8 w-8 flex-none items-center justify-center rounded-md border border-border bg-surface-alt text-base-content"
- >
- <Icon class="h-4 w-4" />
- </div>
- <div class="text-sm font-semibold text-base-content">
- {entry.label}
- </div>
- </div>
- <div class="text-xs text-muted">{entry.description}</div>
- </button>
- );
- }}
- </For>
- </div>
- </div>
- }
- >
- {(familyAccessor) => {
- const family = familyAccessor();
- return (
- <div class="space-y-4 rounded-lg border border-border bg-surface p-4">
- <div class="flex flex-wrap items-start justify-between gap-3">
- <div class="space-y-1">
- <div class="text-sm font-semibold text-base-content">
- Choose a {family.label} product
- </div>
- <p class="text-xs text-muted">
- Pick the {family.label} product you want to connect. Pulse will open the
- matching credential flow next.
- </p>
- </div>
- <button
- type="button"
- onClick={reopenFamilies}
- class="inline-flex items-center rounded-md border border-border px-2.5 py-1 text-xs font-medium text-base-content transition-colors hover:bg-surface-hover"
- >
- ← Back to platforms
- </button>
- </div>
-
- <div class="grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3">
- <For each={family.childTypes}>
- {(type) => {
- const meta = PLATFORM_TILE_META[type];
- const Icon = meta.icon;
- const product = getInfrastructureOnboardingProductPresentation(type);
- return (
- <button
- type="button"
- onClick={() => chooseManualType(type, { fromCatalog: true })}
- class="group flex h-full flex-col gap-2 rounded-lg border border-border bg-surface-alt p-4 text-left transition-colors hover:border-blue-500 hover:bg-blue-50/40 dark:hover:bg-blue-950/20"
- >
- <div class="flex items-center gap-2.5">
- <div
- aria-hidden="true"
- class="flex h-8 w-8 flex-none items-center justify-center rounded-md border border-border bg-surface text-base-content"
- >
- <Icon class="h-4 w-4" />
- </div>
- <div class="space-y-1">
- <div class="text-sm font-semibold text-base-content">
- {product.label}
- </div>
- <Show when={product.governanceState === 'admitted'}>
- <span class="inline-flex items-center rounded-full border border-blue-200 bg-blue-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-blue-800 dark:border-blue-900 dark:bg-blue-950/40 dark:text-blue-200">
- Available now
- </span>
- </Show>
- </div>
- </div>
- <div class="text-xs text-muted">{product.catalogDescription}</div>
- <div class="text-[11px] text-muted">{product.bestFor}</div>
- </button>
- );
- }}
- </For>
- </div>
- </div>
- );
- }}
- </Show>
- </section>
-
- <section class="space-y-3 rounded-xl border border-border bg-surface p-4">
- <div class="space-y-1">
- <div class="text-sm font-semibold text-base-content">Install Pulse Agent</div>
- <p class="text-xs text-muted">
- Use the agent when you want machine telemetry, or when the system has no
- management API Pulse can connect to directly.
- </p>
- </div>
-
- <button
- type="button"
- onClick={() => chooseManualType('agent')}
- class="group flex w-full items-start gap-4 rounded-lg border border-border bg-surface p-4 text-left transition-colors hover:border-blue-500 hover:bg-blue-50/40 dark:hover:bg-blue-950/20"
- >
- <div
- aria-hidden="true"
- class="flex h-10 w-10 flex-none items-center justify-center rounded-md border border-emerald-200 bg-emerald-100 text-emerald-700 dark:border-emerald-900 dark:bg-emerald-900/40 dark:text-emerald-300"
- >
- <Cpu class="h-5 w-5" />
- </div>
- <div class="flex-1 space-y-1.5">
- <div class="flex flex-wrap items-center gap-2">
- <div class="text-sm font-semibold text-base-content">Install Pulse Agent</div>
- <div class="rounded-full border border-border bg-surface px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted">
- Runs on a host
- </div>
- </div>
- <div class="text-xs text-muted">
- Install on Linux, FreeBSD, or compatible hosts such as Unraid when you want CPU
- temperature, disk SMART, system services, and network metrics from the host
- itself.
- </div>
- <div class="text-xs text-muted">
- Also detects local Docker, Kubernetes, and other supported services on the same
- machine and connects them when available.
- </div>
- <div class="flex flex-wrap gap-1.5 pt-1">
- <For each={INFRASTRUCTURE_AGENT_DISCOVERY_LABELS}>
- {(label) => renderBadge(label)}
- </For>
- </div>
- </div>
- <div
- aria-hidden="true"
- class="flex-none self-center text-muted transition-colors group-hover:text-blue-700 dark:group-hover:text-blue-300"
- >
- <ArrowRight class="h-4 w-4" />
- </div>
- </button>
</section>
<section class="rounded-xl border border-border bg-surface-alt p-4">
@@ -508,8 +168,8 @@ export const ConnectionEditor: Component<ConnectionEditorProps> = (props) => {
<div class="space-y-1">
<div class="text-sm font-semibold text-base-content">What happens next</div>
<p class="text-xs text-muted">
- Pulse guides each path through the same monitored-system admission flow before
- the system lands in the shared infrastructure ledger.
+ Pulse validates the connection before the system lands in the shared
+ infrastructure ledger.
</p>
</div>
@@ -548,7 +208,7 @@ export const ConnectionEditor: Component<ConnectionEditorProps> = (props) => {
onClick={reopenProbe}
class="inline-flex items-center rounded-md border border-border px-2.5 py-1 text-xs font-medium text-base-content transition-colors hover:bg-surface-hover"
>
- ← Back to catalog
+ ← Back to detect
</button>
</Show>
</div>
diff --git a/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/NodeCredentialSlot.tsx b/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/NodeCredentialSlot.tsx
index e3031f1de8..1fa768fc7f 100644
--- a/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/NodeCredentialSlot.tsx
+++ b/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/NodeCredentialSlot.tsx
@@ -18,6 +18,9 @@ export interface NodeCredentialSlotProps {
initialAddress?: string;
onCancel: () => void;
onSaved: () => void;
+ onToggleEnabled?: () => void;
+ togglePending?: boolean;
+ connectionEnabled?: boolean;
onDelete?: () => void;
deletePending?: boolean;
deleteConfirming?: boolean;
@@ -67,6 +70,9 @@ export const NodeCredentialSlot: Component<NodeCredentialSlotProps> = (props) =>
<NodeModalStatusFooter
modalProps={modalProps}
state={state}
+ onToggleEnabled={props.onToggleEnabled}
+ togglePending={props.togglePending}
+ connectionEnabled={props.connectionEnabled}
onDelete={props.onDelete}
deletePending={props.deletePending}
deleteConfirming={props.deleteConfirming}
diff --git a/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/TrueNASCredentialSlot.tsx b/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/TrueNASCredentialSlot.tsx
index 0adf8dd889..865e7d7cc3 100644
--- a/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/TrueNASCredentialSlot.tsx
+++ b/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/TrueNASCredentialSlot.tsx
@@ -22,6 +22,9 @@ export interface TrueNASCredentialSlotProps {
editingConnection?: TrueNASConnection | null;
onCancel: () => void;
onSaved: () => void;
+ onToggleEnabled?: () => void;
+ togglePending?: boolean;
+ connectionEnabled?: boolean;
onDelete?: () => void;
deletePending?: boolean;
deleteConfirming?: boolean;
@@ -319,6 +322,27 @@ export const TrueNASCredentialSlot: Component<TrueNASCredentialSlotProps> = (pro
</Show>
<div class="flex flex-col-reverse gap-2 sm:flex-row sm:justify-end">
+ <Show when={isEditing() && props.onToggleEnabled}>
+ <button
+ type="button"
+ class={buttonClass}
+ onClick={() => props.onToggleEnabled?.()}
+ disabled={
+ props.state.saving() ||
+ props.state.testing() ||
+ props.togglePending ||
+ props.deletePending
+ }
+ >
+ {props.togglePending
+ ? props.connectionEnabled
+ ? 'Pausing…'
+ : 'Resuming…'
+ : props.connectionEnabled
+ ? 'Pause connection'
+ : 'Resume connection'}
+ </button>
+ </Show>
<Show when={isEditing() && props.onDelete}>
<button
type="button"
@@ -328,7 +352,12 @@ export const TrueNASCredentialSlot: Component<TrueNASCredentialSlotProps> = (pro
: 'inline-flex min-h-10 sm:min-h-9 items-center justify-center rounded-md border border-rose-300 px-3 py-2 text-sm font-medium text-rose-700 transition-colors hover:bg-rose-50 disabled:cursor-not-allowed disabled:opacity-60 dark:border-rose-900 dark:text-rose-300 dark:hover:bg-rose-950'
}
onClick={() => props.onDelete?.()}
- disabled={props.state.saving() || props.state.testing() || props.deletePending}
+ disabled={
+ props.state.saving() ||
+ props.state.testing() ||
+ props.togglePending ||
+ props.deletePending
+ }
>
{props.deletePending
? 'Deleting…'
@@ -341,7 +370,12 @@ export const TrueNASCredentialSlot: Component<TrueNASCredentialSlotProps> = (pro
type="button"
class={buttonClass}
onClick={handleCancel}
- disabled={props.state.saving() || props.state.testing() || props.deletePending}
+ disabled={
+ props.state.saving() ||
+ props.state.testing() ||
+ props.togglePending ||
+ props.deletePending
+ }
>
Cancel
</button>
@@ -349,7 +383,12 @@ export const TrueNASCredentialSlot: Component<TrueNASCredentialSlotProps> = (pro
type="button"
class={buttonClass}
onClick={() => void props.state.testCurrentForm()}
- disabled={props.state.saving() || props.state.testing() || props.deletePending}
+ disabled={
+ props.state.saving() ||
+ props.state.testing() ||
+ props.togglePending ||
+ props.deletePending
+ }
>
{props.state.testing() ? 'Testing…' : 'Test connection'}
</button>
@@ -371,6 +410,7 @@ export const TrueNASCredentialSlot: Component<TrueNASCredentialSlotProps> = (pro
props.state.saving() ||
props.state.testing() ||
props.state.previewing() ||
+ props.togglePending ||
props.deletePending ||
props.state.monitoredSystemAdmissionSaveBlocked()
}
diff --git a/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/VMwareCredentialSlot.tsx b/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/VMwareCredentialSlot.tsx
index d706575b4c..2be626511c 100644
--- a/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/VMwareCredentialSlot.tsx
+++ b/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/VMwareCredentialSlot.tsx
@@ -23,6 +23,9 @@ export interface VMwareCredentialSlotProps {
editingConnection?: VMwareConnection | null;
onCancel: () => void;
onSaved: () => void;
+ onToggleEnabled?: () => void;
+ togglePending?: boolean;
+ connectionEnabled?: boolean;
onDelete?: () => void;
deletePending?: boolean;
deleteConfirming?: boolean;
@@ -257,6 +260,27 @@ export const VMwareCredentialSlot: Component<VMwareCredentialSlotProps> = (props
</Show>
<div class="flex flex-col-reverse gap-2 sm:flex-row sm:justify-end">
+ <Show when={isEditing() && props.onToggleEnabled}>
+ <button
+ type="button"
+ class={buttonClass}
+ onClick={() => props.onToggleEnabled?.()}
+ disabled={
+ props.state.saving() ||
+ props.state.testing() ||
+ props.togglePending ||
+ props.deletePending
+ }
+ >
+ {props.togglePending
+ ? props.connectionEnabled
+ ? 'Pausing…'
+ : 'Resuming…'
+ : props.connectionEnabled
+ ? 'Pause connection'
+ : 'Resume connection'}
+ </button>
+ </Show>
<Show when={isEditing() && props.onDelete}>
<button
type="button"
@@ -266,7 +290,12 @@ export const VMwareCredentialSlot: Component<VMwareCredentialSlotProps> = (props
: 'inline-flex min-h-10 sm:min-h-9 items-center justify-center rounded-md border border-rose-300 px-3 py-2 text-sm font-medium text-rose-700 transition-colors hover:bg-rose-50 disabled:cursor-not-allowed disabled:opacity-60 dark:border-rose-900 dark:text-rose-300 dark:hover:bg-rose-950'
}
onClick={() => props.onDelete?.()}
- disabled={props.state.saving() || props.state.testing() || props.deletePending}
+ disabled={
+ props.state.saving() ||
+ props.state.testing() ||
+ props.togglePending ||
+ props.deletePending
+ }
>
{props.deletePending
? 'Deleting…'
@@ -279,7 +308,12 @@ export const VMwareCredentialSlot: Component<VMwareCredentialSlotProps> = (props
type="button"
class={buttonClass}
onClick={handleCancel}
- disabled={props.state.saving() || props.state.testing() || props.deletePending}
+ disabled={
+ props.state.saving() ||
+ props.state.testing() ||
+ props.togglePending ||
+ props.deletePending
+ }
>
Cancel
</button>
@@ -287,7 +321,12 @@ export const VMwareCredentialSlot: Component<VMwareCredentialSlotProps> = (props
type="button"
class={buttonClass}
onClick={() => void props.state.testCurrentForm()}
- disabled={props.state.saving() || props.state.testing() || props.deletePending}
+ disabled={
+ props.state.saving() ||
+ props.state.testing() ||
+ props.togglePending ||
+ props.deletePending
+ }
>
{props.state.testing() ? 'Testing…' : 'Test connection'}
</button>
@@ -309,6 +348,7 @@ export const VMwareCredentialSlot: Component<VMwareCredentialSlotProps> = (props
props.state.saving() ||
props.state.testing() ||
props.state.previewing() ||
+ props.togglePending ||
props.deletePending ||
props.state.monitoredSystemAdmissionSaveBlocked()
}
diff --git a/frontend-modern/src/components/Settings/ConnectionEditor/__tests__/ConnectionEditor.test.tsx b/frontend-modern/src/components/Settings/ConnectionEditor/__tests__/ConnectionEditor.test.tsx
index e0c9e1c173..6a232eac38 100644
--- a/frontend-modern/src/components/Settings/ConnectionEditor/__tests__/ConnectionEditor.test.tsx
+++ b/frontend-modern/src/components/Settings/ConnectionEditor/__tests__/ConnectionEditor.test.tsx
@@ -1,7 +1,7 @@
-import { describe, expect, it, vi, beforeEach } from 'vitest';
-import { render, fireEvent, screen, waitFor } from '@solidjs/testing-library';
-import { ConnectionEditor } from '../ConnectionEditor';
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+import { fireEvent, render, screen, waitFor } from '@solidjs/testing-library';
import { ConnectionsAPI, type ProbeResponse } from '@/api/connections';
+import { ConnectionEditor } from '../ConnectionEditor';
const connectionsApiMock = vi.hoisted(() => ({
list: vi.fn(),
@@ -30,10 +30,6 @@ vi.mock('@/utils/infrastructureOnboardingMetrics', () => ({
const mockedProbe = vi.mocked(ConnectionsAPI.probe);
-function expectNodeBefore(a: Node, b: Node) {
- expect(a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
-}
-
describe('ConnectionEditor', () => {
beforeEach(() => {
vi.clearAllMocks();
@@ -57,8 +53,7 @@ describe('ConnectionEditor', () => {
const input = screen.getByPlaceholderText(/vcenter\.lab/) as HTMLInputElement;
fireEvent.input(input, { target: { value: 'pve.lab' } });
- const probeButton = screen.getByRole('button', { name: /probe address/i });
- fireEvent.click(probeButton);
+ fireEvent.click(screen.getByRole('button', { name: /probe address/i }));
await waitFor(() => expect(mockedProbe).toHaveBeenCalledWith('pve.lab'));
await waitFor(() =>
@@ -66,107 +61,58 @@ describe('ConnectionEditor', () => {
);
expect(onboardingMetricsTrackerMock.recordPathSelected).toHaveBeenCalledWith('api');
- const candidateHost = await screen.findByText('https://pve.lab:8006');
- const candidateButton = candidateHost.closest('button');
- expect(candidateButton).not.toBeNull();
- fireEvent.click(candidateButton!);
+ fireEvent.click((await screen.findByText('https://pve.lab:8006')).closest('button')!);
await waitFor(() => expect(screen.getByTestId('slot').textContent).toBe('slot:pve'));
expect(onboardingMetricsTrackerMock.recordCredentialsOpened).toHaveBeenCalledWith('pve');
- expect(renderSlot).toHaveBeenCalled();
const lastCall = renderSlot.mock.calls.at(-1)![0];
expect(lastCall.type).toBe('pve');
expect(lastCall.candidate?.host).toBe('https://pve.lab:8006');
expect(lastCall.mode).toBe('add');
});
- it('lets the user pick a product tile when probe returns no match', async () => {
- mockedProbe.mockResolvedValueOnce({ candidates: [], probedMs: 203 });
-
- const renderSlot = vi.fn((props) => <div data-testid="slot">slot:{props.type}</div>);
-
- render(() => <ConnectionEditor renderCredentialSlot={renderSlot} onClose={() => {}} />);
+ it('renders the detect landing and can return to the source picker', () => {
+ const onBackToCatalog = vi.fn();
- const input = screen.getByPlaceholderText(/vcenter\.lab/) as HTMLInputElement;
- fireEvent.input(input, { target: { value: '192.168.1.50' } });
-
- fireEvent.click(screen.getByRole('button', { name: /probe address/i }));
- await waitFor(() => expect(mockedProbe).toHaveBeenCalled());
- await waitFor(() =>
- expect(onboardingMetricsTrackerMock.recordProbeResult).toHaveBeenCalledWith('no-match'),
- );
-
- await screen.findByText(/no supported api-backed platform detected/i);
-
- // The catalog grid is always visible below the probe, so the user picks a
- // tile directly — no intermediate "enter credentials manually" toggle.
- fireEvent.click(screen.getByRole('button', { name: /TrueNAS SCALE/i }));
-
- await waitFor(() => expect(screen.getByTestId('slot').textContent).toBe('slot:truenas'));
- expect(onboardingMetricsTrackerMock.recordCatalogSelected).toHaveBeenCalledWith('truenas');
- expect(onboardingMetricsTrackerMock.recordCredentialsOpened).toHaveBeenCalledWith('truenas');
- const lastCall = renderSlot.mock.calls.at(-1)![0];
- expect(lastCall.type).toBe('truenas');
- expect(lastCall.candidate).toBeNull();
- });
+ render(() => (
+ <ConnectionEditor
+ renderCredentialSlot={() => <div />}
+ onBackToCatalog={onBackToCatalog}
+ onClose={() => {}}
+ />
+ ));
- it('renders a platform-first catalog with the host-install path beneath it', () => {
- render(() => <ConnectionEditor renderCredentialSlot={() => <div />} onClose={() => {}} />);
-
- const platformHeading = screen.getAllByText('Connect a supported platform')[0];
- const agentButton = screen.getByRole('button', { name: /Install Pulse Agent/i });
- const probeButton = screen.getByRole('button', { name: /probe address/i });
- const vmwareButton = screen.getByRole('button', { name: /VMware vCenter/i });
- const trueNASButton = screen.getByRole('button', { name: /TrueNAS SCALE/i });
- const proxmoxButton = screen.getByRole('button', { name: /^Proxmox\b/i });
-
- // Catalog landing — lead with management-platform onboarding, then keep
- // host install as a secondary path below it.
- expect(platformHeading).toBeInTheDocument();
- expect(agentButton).toBeInTheDocument();
- expect(probeButton).toBeInTheDocument();
- expect(vmwareButton).toBeInTheDocument();
- expect(trueNASButton).toBeInTheDocument();
- expect(proxmoxButton).toBeInTheDocument();
- expectNodeBefore(platformHeading, probeButton);
- expectNodeBefore(vmwareButton, trueNASButton);
- expectNodeBefore(trueNASButton, proxmoxButton);
- expectNodeBefore(proxmoxButton, agentButton);
- expect(screen.queryByRole('button', { name: /^Proxmox VE/i })).toBeNull();
- expect(screen.queryByText('Recommended')).toBeNull();
- expect(screen.getAllByText('Available now').length).toBeGreaterThan(0);
+ expect(screen.getByText('Detect from address')).toBeInTheDocument();
+ expect(screen.getByText('Address probe')).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: /Back to source types/i })).toBeInTheDocument();
expect(screen.getByText('What happens next')).toBeInTheDocument();
- });
-
- it('groups Proxmox products under one family step before entering credentials', async () => {
- const renderSlot = vi.fn((props) => <div data-testid="slot">slot:{props.type}</div>);
-
- render(() => <ConnectionEditor renderCredentialSlot={renderSlot} onClose={() => {}} />);
- fireEvent.click(screen.getByRole('button', { name: /^Proxmox\b/i }));
-
- expect(screen.getByText('Choose a Proxmox product')).toBeInTheDocument();
- expect(screen.getByRole('button', { name: /^Proxmox VE/i })).toBeInTheDocument();
- expect(screen.getByRole('button', { name: /Proxmox Backup Server/i })).toBeInTheDocument();
- expect(screen.getByRole('button', { name: /Proxmox Mail Gateway/i })).toBeInTheDocument();
-
- fireEvent.click(screen.getByRole('button', { name: /^Proxmox VE/i }));
-
- await waitFor(() => expect(screen.getByTestId('slot').textContent).toBe('slot:pve'));
- expect(renderSlot.mock.calls.at(-1)![0].type).toBe('pve');
+ fireEvent.click(screen.getByRole('button', { name: /Back to source types/i }));
+ expect(onBackToCatalog).toHaveBeenCalledTimes(1);
});
- it('keeps a single available Proxmox product as a direct tile', () => {
+ it('offers the source picker as a no-match escape hatch when provided', async () => {
+ mockedProbe.mockResolvedValueOnce({ candidates: [], probedMs: 203 });
+ const onBackToCatalog = vi.fn();
+
render(() => (
<ConnectionEditor
- manualTypeOptions={['pve']}
renderCredentialSlot={() => <div />}
+ onBackToCatalog={onBackToCatalog}
onClose={() => {}}
/>
));
- expect(screen.getByRole('button', { name: /^Proxmox VE/i })).toBeInTheDocument();
- expect(screen.queryByText('VE, Backup Server, Mail Gateway')).toBeNull();
+ const input = screen.getByPlaceholderText(/vcenter\.lab/) as HTMLInputElement;
+ fireEvent.input(input, { target: { value: '192.168.1.50' } });
+ fireEvent.click(screen.getByRole('button', { name: /probe address/i }));
+
+ await waitFor(() =>
+ expect(onboardingMetricsTrackerMock.recordProbeResult).toHaveBeenCalledWith('no-match'),
+ );
+
+ fireEvent.click(screen.getByRole('button', { name: /Choose a source type instead/i }));
+ expect(onBackToCatalog).toHaveBeenCalledTimes(1);
});
it('offers the agent path contextually when a probe returns no match', async () => {
@@ -181,9 +127,6 @@ describe('ConnectionEditor', () => {
fireEvent.click(screen.getByRole('button', { name: /probe address/i }));
await waitFor(() => expect(mockedProbe).toHaveBeenCalled());
- // The no-match box names bare-metal Linux / Unraid / FreeBSD and offers
- // the agent as a first-class alternative, so a user who probed the wrong
- // thing isn't left in a Platform-API-only dead end.
const agentButton = await screen.findByRole('button', {
name: /install pulse agent instead/i,
});
@@ -197,7 +140,62 @@ describe('ConnectionEditor', () => {
expect(call.candidate).toBeNull();
});
- it('skips the probe step when an initialType is supplied (edit mode)', () => {
+ it('reopens the detect form from a selected credential slot', async () => {
+ mockedProbe.mockResolvedValueOnce({
+ candidates: [
+ { type: 'truenas', host: 'https://truenas.lab', port: 443, hints: { product: 'TrueNAS SCALE' } },
+ ],
+ probedMs: 142,
+ });
+
+ const renderSlot = vi.fn((props) => <div data-testid="slot">slot:{props.type}</div>);
+
+ render(() => <ConnectionEditor renderCredentialSlot={renderSlot} onClose={() => {}} />);
+
+ const input = screen.getByPlaceholderText(/vcenter\.lab/) as HTMLInputElement;
+ fireEvent.input(input, { target: { value: 'truenas.lab' } });
+ fireEvent.click(screen.getByRole('button', { name: /probe address/i }));
+
+ fireEvent.click((await screen.findByText('https://truenas.lab')).closest('button')!);
+ await waitFor(() => expect(screen.getByTestId('slot').textContent).toBe('slot:truenas'));
+
+ fireEvent.click(screen.getByRole('button', { name: /Back to detect/i }));
+
+ const resetInput = screen.getByPlaceholderText(/vcenter\.lab/) as HTMLInputElement;
+ expect(resetInput.value).toBe('');
+ expect(screen.queryByTestId('slot')).toBeNull();
+ expect(screen.getByText('Detect from address')).toBeInTheDocument();
+ });
+
+ it('uses an injected tracker for direct type routes without creating another one', async () => {
+ const externalTracker = {
+ recordOpened: vi.fn(),
+ recordPathSelected: vi.fn(),
+ recordProbeResult: vi.fn(),
+ recordCatalogSelected: vi.fn(),
+ recordCredentialsOpened: vi.fn(),
+ };
+ const renderSlot = vi.fn((props) => <div data-testid="slot">slot:{props.type}</div>);
+
+ render(() => (
+ <ConnectionEditor
+ initialType="truenas"
+ trackInitialCatalogSelection={true}
+ onboardingMetricsTracker={externalTracker}
+ renderCredentialSlot={renderSlot}
+ onClose={() => {}}
+ />
+ ));
+
+ await waitFor(() => expect(screen.getByTestId('slot').textContent).toBe('slot:truenas'));
+ expect(createInfrastructureOnboardingMetricsTrackerMock).not.toHaveBeenCalled();
+ expect(externalTracker.recordOpened).not.toHaveBeenCalled();
+ expect(externalTracker.recordPathSelected).toHaveBeenCalledWith('api');
+ expect(externalTracker.recordCatalogSelected).toHaveBeenCalledWith('truenas');
+ expect(externalTracker.recordCredentialsOpened).toHaveBeenCalledWith('truenas');
+ });
+
+ it('skips probe setup when an initialType is supplied in edit mode', () => {
const renderSlot = vi.fn((props) => <div data-testid="slot">slot:{props.type}</div>);
render(() => (
@@ -216,41 +214,4 @@ describe('ConnectionEditor', () => {
expect(call.type).toBe('vmware');
expect(call.candidate).toBeNull();
});
-
- it('can return from a provider family to the top-level platform catalog', () => {
- render(() => <ConnectionEditor renderCredentialSlot={() => <div />} onClose={() => {}} />);
-
- fireEvent.click(screen.getByRole('button', { name: /^Proxmox\b/i }));
- expect(screen.getByText('Choose a Proxmox product')).toBeInTheDocument();
-
- fireEvent.click(screen.getByRole('button', { name: /back to platforms/i }));
-
- expect(screen.getByRole('button', { name: /^Proxmox\b/i })).toBeInTheDocument();
- expect(screen.queryByText('Choose a Proxmox product')).toBeNull();
- });
-
- it('resets probe state when returning to the catalog from a credential slot', async () => {
- mockedProbe.mockResolvedValueOnce({ candidates: [], probedMs: 203 });
-
- const renderSlot = vi.fn((props) => <div data-testid="slot">slot:{props.type}</div>);
-
- render(() => <ConnectionEditor renderCredentialSlot={renderSlot} onClose={() => {}} />);
-
- const input = screen.getByPlaceholderText(/vcenter\.lab/) as HTMLInputElement;
- fireEvent.input(input, { target: { value: '192.168.1.50' } });
- fireEvent.click(screen.getByRole('button', { name: /probe address/i }));
-
- await waitFor(() => expect(mockedProbe).toHaveBeenCalled());
- await screen.findByText(/no supported api-backed platform detected/i);
-
- fireEvent.click(screen.getByRole('button', { name: /TrueNAS SCALE/i }));
- await waitFor(() => expect(screen.getByTestId('slot').textContent).toBe('slot:truenas'));
-
- fireEvent.click(screen.getByRole('button', { name: /back to catalog/i }));
-
- const resetInput = screen.getByPlaceholderText(/vcenter\.lab/) as HTMLInputElement;
- expect(resetInput.value).toBe('');
- expect(screen.queryByText(/no supported api-backed platform detected/i)).toBeNull();
- expect(screen.queryByTestId('slot')).toBeNull();
- });
});
diff --git a/frontend-modern/src/components/Settings/ConnectionEditor/useConnectionEditor.ts b/frontend-modern/src/components/Settings/ConnectionEditor/useConnectionEditor.ts
index 11e5e3221b..09e49c50d3 100644
--- a/frontend-modern/src/components/Settings/ConnectionEditor/useConnectionEditor.ts
+++ b/frontend-modern/src/components/Settings/ConnectionEditor/useConnectionEditor.ts
@@ -5,14 +5,7 @@ import {
type ProbeCandidate,
type ProbeResponse,
} from '@/api/connections';
-import {
- DEFAULT_INFRASTRUCTURE_SOURCE_ORDER,
- getSourcePlatformFamily,
-} from '@/utils/platformSupportManifest';
-import {
- INFRASTRUCTURE_API_FAMILY_DESCRIPTIONS,
- getInfrastructureOnboardingProductPresentation,
-} from '@/utils/infrastructureOnboardingPresentation';
+import { getInfrastructureOnboardingProductPresentation } from '@/utils/infrastructureOnboardingPresentation';
const PROBE_ERROR_FALLBACK = 'Probe failed. Try again or enter credentials manually.';
@@ -40,87 +33,6 @@ export interface ConnectionEditorState {
runProbe: () => Promise<CompletedProbePhase>;
}
-export type PlatformConnectionType = Extract<
- ConnectionType,
- 'pve' | 'pbs' | 'pmg' | 'truenas' | 'vmware'
->;
-export type ConnectionEditorCatalogFamilyId = string;
-
-export interface ConnectionEditorCatalogTypeEntry {
- kind: 'type';
- type: PlatformConnectionType;
-}
-
-export interface ConnectionEditorCatalogFamilyEntry {
- kind: 'family';
- id: ConnectionEditorCatalogFamilyId;
- label: string;
- description: string;
- childTypes: PlatformConnectionType[];
-}
-
-export type ConnectionEditorCatalogEntry =
- | ConnectionEditorCatalogTypeEntry
- | ConnectionEditorCatalogFamilyEntry;
-
-const CONNECTION_TYPE_TO_SOURCE_PLATFORM: Record<PlatformConnectionType, string> = {
- vmware: 'vmware-vsphere',
- truenas: 'truenas',
- pve: 'proxmox-pve',
- pbs: 'proxmox-pbs',
- pmg: 'proxmox-pmg',
-};
-
-const SOURCE_PLATFORM_TO_CONNECTION_TYPE: Partial<Record<string, PlatformConnectionType>> = {
- 'vmware-vsphere': 'vmware',
- truenas: 'truenas',
- 'proxmox-pve': 'pve',
- 'proxmox-pbs': 'pbs',
- 'proxmox-pmg': 'pmg',
-};
-
-// The supported-source manifest order is reused where it applies, but the
-// add-infrastructure catalog still needs to surface the admitted vSphere path.
-const CONNECTION_EDITOR_PRIORITY_TYPES: PlatformConnectionType[] = ['vmware'];
-
-const PLATFORM_CONNECTION_TYPE_FALLBACK_ORDER: PlatformConnectionType[] = [
- 'truenas',
- 'pve',
- 'pbs',
- 'pmg',
-];
-
-const DEFAULT_CONNECTION_EDITOR_AVAILABLE_TYPES: PlatformConnectionType[] = Array.from(
- new Set([
- ...CONNECTION_EDITOR_PRIORITY_TYPES,
- ...DEFAULT_INFRASTRUCTURE_SOURCE_ORDER.flatMap((platformKey) => {
- const type = SOURCE_PLATFORM_TO_CONNECTION_TYPE[platformKey];
- return type ? [type] : [];
- }),
- ...PLATFORM_CONNECTION_TYPE_FALLBACK_ORDER,
- ]),
-);
-
-function isPlatformConnectionType(value: ConnectionType): value is PlatformConnectionType {
- return (
- value === 'pve' ||
- value === 'pbs' ||
- value === 'pmg' ||
- value === 'truenas' ||
- value === 'vmware'
- );
-}
-
-const platformTypeOrder = (type: PlatformConnectionType): number => {
- const index = DEFAULT_CONNECTION_EDITOR_AVAILABLE_TYPES.indexOf(type);
- return index === -1 ? DEFAULT_CONNECTION_EDITOR_AVAILABLE_TYPES.length : index;
-};
-
-const orderPlatformTypes = (types: readonly PlatformConnectionType[]): PlatformConnectionType[] =>
- Array.from(new Set(types)).sort(
- (left, right) => platformTypeOrder(left) - platformTypeOrder(right),
- );
-
// CONNECTION_TYPE_LABELS drives both the detected-candidate header copy and
// the manual fallback menu. Keeping one table avoids drift between probe
// results and the manual route labels.
@@ -135,77 +47,6 @@ export const CONNECTION_TYPE_LABELS: Record<ConnectionType, string> = {
kubernetes: 'Kubernetes',
};
-const buildCatalogFamilyId = (familyLabel: string): ConnectionEditorCatalogFamilyId =>
- familyLabel
- .trim()
- .toLowerCase()
- .replace(/[^a-z0-9]+/g, '-');
-
-const getCatalogFamilyLabel = (type: PlatformConnectionType): string | null =>
- getSourcePlatformFamily(CONNECTION_TYPE_TO_SOURCE_PLATFORM[type]);
-
-const describeCatalogFamily = (
- familyLabel: string,
- childTypes: readonly PlatformConnectionType[],
-): string => {
- const curatedDescription = INFRASTRUCTURE_API_FAMILY_DESCRIPTIONS[familyLabel];
- if (curatedDescription) return curatedDescription;
- return childTypes
- .map((type) => {
- const label = CONNECTION_TYPE_LABELS[type];
- const prefix = `${familyLabel} `;
- return label.startsWith(prefix) ? label.slice(prefix.length) : label;
- })
- .join(', ');
-};
-
-export const DEFAULT_CONNECTION_EDITOR_CATALOG_ENTRIES: ConnectionEditorCatalogEntry[] = (() => {
- return buildConnectionEditorCatalogEntries(DEFAULT_CONNECTION_EDITOR_AVAILABLE_TYPES);
-})();
-
-export function buildConnectionEditorCatalogEntries(
- options?: readonly ConnectionType[],
-): ConnectionEditorCatalogEntry[] {
- if (!options || options.length === 0) {
- return DEFAULT_CONNECTION_EDITOR_CATALOG_ENTRIES;
- }
-
- const availableTypes = orderPlatformTypes(options.filter(isPlatformConnectionType));
- const entries: ConnectionEditorCatalogEntry[] = [];
- const consumedTypes = new Set<PlatformConnectionType>();
-
- for (const type of availableTypes) {
- if (consumedTypes.has(type)) continue;
-
- const familyLabel = getCatalogFamilyLabel(type);
- if (!familyLabel) {
- entries.push({ kind: 'type', type });
- consumedTypes.add(type);
- continue;
- }
-
- const familyChildTypes = availableTypes.filter(
- (candidateType) => getCatalogFamilyLabel(candidateType) === familyLabel,
- );
- if (familyChildTypes.length < 2) {
- entries.push({ kind: 'type', type });
- consumedTypes.add(type);
- continue;
- }
-
- familyChildTypes.forEach((childType) => consumedTypes.add(childType));
- entries.push({
- kind: 'family',
- id: buildCatalogFamilyId(familyLabel),
- label: familyLabel,
- description: describeCatalogFamily(familyLabel, familyChildTypes),
- childTypes: familyChildTypes,
- });
- }
-
- return entries;
-}
-
// Validation on the client side is intentionally lenient: the backend is the
// real authority on what constitutes a probeable address. We only reject the
// obviously empty case so the API does not see a payload it will always
diff --git a/frontend-modern/src/components/Settings/InfrastructureSourceManager.tsx b/frontend-modern/src/components/Settings/InfrastructureSourceManager.tsx
index 1ef2254f0f..f42c7332bc 100644
--- a/frontend-modern/src/components/Settings/InfrastructureSourceManager.tsx
+++ b/frontend-modern/src/components/Settings/InfrastructureSourceManager.tsx
@@ -1,302 +1,287 @@
-import { Component, For, Show, type Accessor } from 'solid-js';
-import { Archive, Cpu, Database, Mail, Search, Server, ServerCog } from 'lucide-solid';
+import { For, Show, createMemo, type Accessor } from 'solid-js';
+import { Plus, Search, Server } from 'lucide-solid';
import type { Connection } from '@/api/connections';
import SettingsPanel from '@/components/shared/SettingsPanel';
+import {
+ Table,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableHeader,
+ TableRow,
+} from '@/components/shared/Table';
import type { InfrastructureSystemRow } from './connectionsTableModel';
-import type { AgentUninstallCommands } from './ConnectionsTable';
-import type { ConnectionRowActions } from './useConnectionRowActions';
import {
- getInfrastructureOnboardingProductPresentation,
+ getInfrastructureSourceManagerProducts,
type InfrastructureOnboardingConnectionType,
} from '@/utils/infrastructureOnboardingPresentation';
interface InfrastructureSourceManagerProps {
rows: Accessor<readonly InfrastructureSystemRow[]>;
readOnly: boolean;
- actions?: ConnectionRowActions;
- onAddType: (type: InfrastructureOnboardingConnectionType) => void;
- onEditConnection?: (connection: Connection) => void;
+ onAddSource?: (type: InfrastructureOnboardingConnectionType) => void;
onDetectFromAddress?: () => void;
- agentUninstallCommands?: AgentUninstallCommands;
- onCopyText?: (text: string) => void;
+ onOpenConnection?: (connection: Connection) => void;
}
-const buttonClass =
- 'inline-flex items-center rounded-md border border-border px-2.5 py-1.5 text-xs font-medium text-base-content transition-colors hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-60';
-const primaryButtonClass =
- 'inline-flex items-center rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:opacity-60';
-const removeButtonClass =
- 'inline-flex items-center rounded-md border border-rose-300 px-2.5 py-1.5 text-xs font-medium text-rose-700 transition-colors hover:bg-rose-50 disabled:cursor-not-allowed disabled:opacity-60 dark:border-rose-900 dark:text-rose-300 dark:hover:bg-rose-950';
-const removeConfirmClass =
- 'inline-flex items-center rounded-md bg-rose-600 px-2.5 py-1.5 text-xs font-medium text-white transition-colors hover:bg-rose-700 disabled:cursor-not-allowed disabled:opacity-60';
+const inlineButtonClass =
+ 'inline-flex items-center rounded-md border border-border px-2.5 py-1 text-xs font-medium text-base-content transition-colors hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-60';
+const addSectionButtonClass =
+ 'inline-flex items-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 childIndentClass = 'pl-4 sm:pl-6';
-const CARD_ORDER: InfrastructureOnboardingConnectionType[] = [
- 'vmware',
- 'truenas',
- 'pve',
- 'pbs',
- 'pmg',
- 'agent',
-];
+const sortRows = (rows: readonly InfrastructureSystemRow[]): InfrastructureSystemRow[] =>
+ [...rows].sort((left, right) => left.name.localeCompare(right.name));
-const CARD_ICON: Record<InfrastructureOnboardingConnectionType, Component<{ class?: string }>> = {
- vmware: ServerCog,
- truenas: Database,
- pve: Server,
- pbs: Archive,
- pmg: Mail,
- agent: Cpu,
-};
+const summarizeCoverage = (labels: readonly string[]): string => {
+ if (labels.length <= 3) {
+ return labels.join(', ');
+ }
-const EMPTY_STATE_LABEL: Record<InfrastructureOnboardingConnectionType, string> = {
- vmware: 'No VMware vCenter connections yet.',
- truenas: 'No TrueNAS SCALE connections yet.',
- pve: 'No Proxmox VE connections yet.',
- pbs: 'No Proxmox Backup Server connections yet.',
- pmg: 'No Proxmox Mail Gateway connections yet.',
- agent: 'No Pulse Agent hosts connected yet.',
+ return `${labels.slice(0, 3).join(', ')} +${labels.length - 3} more`;
};
-const ACTION_LABEL: Record<InfrastructureOnboardingConnectionType, string> = {
- vmware: 'Add VMware vCenter',
- truenas: 'Add TrueNAS',
- pve: 'Add Proxmox VE',
- pbs: 'Add Proxmox Backup Server',
- pmg: 'Add Proxmox Mail Gateway',
- agent: 'Install agent',
-};
+export const InfrastructureSourceManager: Component<InfrastructureSourceManagerProps> = (props) => {
+ const products = createMemo(() => getInfrastructureSourceManagerProducts());
+ const productRank = createMemo(() => {
+ const next = new Map<InfrastructureOnboardingConnectionType, number>();
+ products().forEach((product, index) => {
+ next.set(product.type, index);
+ });
+ return next;
+ });
+ const groupedRows = createMemo(() => {
+ const next = new Map<InfrastructureOnboardingConnectionType, InfrastructureSystemRow[]>();
+ for (const product of products()) {
+ next.set(product.type, []);
+ }
-const pathBadge = (type: InfrastructureOnboardingConnectionType): string =>
- type === 'agent' ? 'Agent path' : 'Platform API';
+ for (const row of props.rows()) {
+ const productRows = next.get(row.connection.type as InfrastructureOnboardingConnectionType);
+ if (!productRows) continue;
+ productRows.push(row);
+ }
-const additionalBadge = (type: InfrastructureOnboardingConnectionType): string | null => {
- if (type === 'vmware') return 'Available now';
- if (type === 'agent') return 'Docker + Kubernetes';
- return null;
-};
+ for (const [type, rows] of next.entries()) {
+ next.set(type, sortRows(rows));
+ }
-const additionalNote = (type: InfrastructureOnboardingConnectionType): string | null => {
- if (type === 'agent') {
- return 'Docker and Kubernetes are discovered from the host after the agent is installed.';
- }
- return null;
-};
+ return next;
+ });
+ const sortedProducts = createMemo(() =>
+ [...products()].sort((left, right) => {
+ const countDifference =
+ (groupedRows().get(right.type)?.length ?? 0) - (groupedRows().get(left.type)?.length ?? 0);
+ if (countDifference !== 0) return countDifference;
+ return (productRank().get(left.type) ?? 0) - (productRank().get(right.type) ?? 0);
+ }),
+ );
-const confirmHelpText = (isAgent: boolean): string =>
- isAgent
- ? 'Removing forgets this agent from Pulse. Uninstall it on the host as well if you want to detach it completely.'
- : 'Removing forgets this connection from Pulse; credentials on the platform itself are untouched.';
+ const rowInteractive = (row: InfrastructureSystemRow): boolean =>
+ !props.readOnly && Boolean(props.onOpenConnection) && (row.canEdit || row.isAgent);
-export const InfrastructureSourceManager: Component<InfrastructureSourceManagerProps> = (props) => {
- const rowsForType = (type: InfrastructureOnboardingConnectionType) =>
- props.rows().filter((row) => row.connection.type === type);
+ const actionColumnVisible = () => !props.readOnly;
return (
<SettingsPanel
- title="Connection types"
- description="Add and manage infrastructure sources by product type. Existing sources stay visible here while add and edit open in-place dialogs."
- icon={<Server class="h-5 w-5" strokeWidth={2} />}
+ title="Infrastructure sources"
+ description="Grouped by platform."
+ noPadding
action={
- <Show when={!props.readOnly && props.onDetectFromAddress}>
- <button type="button" onClick={props.onDetectFromAddress} class={buttonClass}>
- <Search class="mr-1.5 h-3.5 w-3.5" />
+ !props.readOnly && props.onDetectFromAddress ? (
+ <button
+ type="button"
+ onClick={props.onDetectFromAddress}
+ class="inline-flex w-full items-center justify-center gap-2 rounded-md border border-border px-3 py-2 text-sm font-medium text-base-content transition-colors hover:bg-surface-hover sm:w-auto"
+ >
+ <Search class="h-4 w-4" />
Detect from address
</button>
- </Show>
+ ) : undefined
}
+ icon={<Server class="h-5 w-5" strokeWidth={2} />}
>
- <div class="grid grid-cols-1 gap-4 xl:grid-cols-2">
- <For each={CARD_ORDER}>
- {(type) => {
- const presentation = getInfrastructureOnboardingProductPresentation(type);
- const Icon = CARD_ICON[type];
- const groupRows = () => rowsForType(type);
- const secondaryBadge = () => additionalBadge(type);
- const note = () => additionalNote(type);
+ <Table class="w-full table-fixed text-sm">
+ <TableHeader class="bg-surface-alt/60">
+ <TableRow>
+ <TableHead class="w-[24%] py-1.5 pl-3 pr-3 text-left text-[11px] font-medium text-muted whitespace-nowrap xl:w-[20%]">
+ Source
+ </TableHead>
+ <TableHead class="w-[26%] px-3 py-1.5 text-left text-[11px] font-medium text-muted whitespace-nowrap xl:w-[24%]">
+ Endpoint
+ </TableHead>
+ <TableHead class="w-[30%] px-3 py-1.5 text-left text-[11px] font-medium text-muted whitespace-nowrap xl:w-[28%]">
+ Coverage
+ </TableHead>
+ <TableHead class="w-[20%] px-3 py-1.5 text-left text-[11px] font-medium text-muted whitespace-nowrap xl:w-[16%]">
+ Status
+ </TableHead>
+ <Show when={actionColumnVisible()}>
+ <TableHead class="w-[16%] px-3 py-1.5 text-right text-[11px] font-medium text-muted whitespace-nowrap xl:w-[12%]">
+ Actions
+ </TableHead>
+ </Show>
+ </TableRow>
+ </TableHeader>
- return (
- <div class="rounded-xl border border-border bg-surface-alt p-4">
- <div class="flex flex-wrap items-start justify-between gap-3">
- <div class="flex min-w-0 items-start gap-3">
- <div class="flex h-10 w-10 flex-none items-center justify-center rounded-md border border-border bg-surface text-base-content">
- <Icon class="h-5 w-5" />
- </div>
- <div class="min-w-0 space-y-1">
- <div class="flex flex-wrap items-center gap-2">
- <h3 class="text-sm font-semibold text-base-content">{presentation.label}</h3>
- <span class="inline-flex items-center rounded-full border border-border bg-surface px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted">
- {pathBadge(type)}
- </span>
- <Show when={secondaryBadge()}>
- {(badge) => (
- <span class="inline-flex items-center rounded-full border border-blue-200 bg-blue-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-blue-800 dark:border-blue-900 dark:bg-blue-950/40 dark:text-blue-200">
- {badge()}
- </span>
- )}
- </Show>
- </div>
- <p class="text-xs text-muted">{presentation.bestFor}</p>
- </div>
- </div>
-
- <div class="flex items-center gap-2">
- <span class="rounded-full border border-border bg-surface px-2 py-0.5 text-[11px] font-medium text-base-content">
- {groupRows().length} configured
- </span>
- <Show when={!props.readOnly}>
- <button
- type="button"
- onClick={() => props.onAddType(type)}
- class={primaryButtonClass}
- >
- {ACTION_LABEL[type]}
- </button>
- </Show>
- </div>
- </div>
-
- <p class="mt-3 text-xs text-muted">{presentation.coverage}</p>
- <Show when={note()}>
- {(value) => <p class="mt-2 text-xs text-muted">{value()}</p>}
- </Show>
+ <TableBody class="divide-y divide-border-subtle bg-surface">
+ <For each={sortedProducts()}>
+ {(product) => {
+ const rows = () => groupedRows().get(product.type) ?? [];
+ const groupRowClass = () =>
+ 'bg-surface-alt hover:bg-surface-alt dark:bg-base dark:hover:bg-base';
+ const groupLabelClass = () => 'text-[15px] font-semibold text-base-content';
- <div class="mt-4 space-y-2">
+ return (
+ <>
<Show
- when={groupRows().length > 0}
+ when={actionColumnVisible()}
fallback={
- <div class="rounded-lg border border-dashed border-border bg-surface px-3 py-4 text-sm text-muted">
- {EMPTY_STATE_LABEL[type]}
- </div>
+ <TableRow class={groupRowClass()}>
+ <TableCell colspan={4} 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>
}
>
- <For each={groupRows()}>
- {(row) => {
- const pauseBusy = () => props.actions?.pendingAction(row.id) === 'pause';
- const removeBusy = () => props.actions?.pendingAction(row.id) === 'remove';
- const anyBusy = () => props.actions?.pendingAction(row.id) !== null;
- const removeConfirming = () => Boolean(props.actions?.confirmingRemove(row.id));
- const rowError = () => props.actions?.actionError(row.id) ?? null;
+ <TableRow class={groupRowClass()}>
+ <TableCell colspan={4} class="px-3 py-1.5">
+ <div class="flex items-center gap-2 whitespace-nowrap">
+ <div class="flex items-center gap-2">
+ <span class={groupLabelClass()}>{product.label}</span>
+ </div>
+ </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={`Add ${product.label}`}
+ >
+ <Plus class="h-3.5 w-3.5" />
+ Add
+ </button>
+ </Show>
+ </TableCell>
+ </TableRow>
+ </Show>
+
+ <Show when={rows().length > 0}>
+ <For each={rows()}>
+ {(row, index) => {
+ const isLast = () => index() === rows().length - 1;
return (
- <div class="rounded-lg border border-border bg-surface px-3 py-3">
- <div class="flex flex-col gap-3 xl:flex-row xl:items-start xl:justify-between">
- <div class="min-w-0 flex-1 space-y-1">
- <div class="flex flex-wrap items-center gap-2">
- <div class="min-w-0 truncate text-sm font-medium text-base-content">
- {row.name}
- </div>
- <span
- class={`inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium whitespace-nowrap ${row.statusClassName}`}
- >
- {row.statusLabel}
+ <>
+ <TableRow>
+ <TableCell class="py-1 pl-3 pr-3 align-top">
+ <div class={`min-w-0 space-y-0.5 ${childIndentClass}`}>
+ <div class="flex min-w-0 items-center gap-2 whitespace-nowrap">
+ <span aria-hidden="true" class="relative h-5 w-5 flex-none">
+ <span
+ class={`absolute left-2 top-0 w-px bg-border ${isLast() ? 'h-2.5' : 'h-5'}`}
+ />
+ <span class="absolute left-2 top-2.5 h-px w-3 bg-border" />
</span>
- </div>
- <Show when={row.host}>
- <div class="break-words text-xs text-muted">{row.host}</div>
- </Show>
- <Show when={row.subtitle}>
- <div class="break-words text-xs text-muted">{row.subtitle}</div>
- </Show>
- <div class="text-xs text-muted">Last activity: {row.lastActivityText}</div>
- <Show when={row.lastErrorMessage}>
- <div class="break-words text-xs text-rose-700 dark:text-rose-300">
- {row.lastErrorMessage}
+ <div class="min-w-0">
+ <div
+ class="truncate text-[13px] text-base-content/80"
+ title={row.name}
+ >
+ {row.name}
+ </div>
</div>
- </Show>
+ </div>
</div>
+ </TableCell>
- <Show when={!props.readOnly && props.actions}>
- <div class="flex flex-wrap items-center gap-1.5">
- <Show when={row.canEdit && props.onEditConnection}>
- <button
- type="button"
- disabled={anyBusy()}
- onClick={() => props.onEditConnection?.(row.connection)}
- class={buttonClass}
- >
- Edit
- </button>
- </Show>
- <Show when={row.canPause}>
- <button
- type="button"
- disabled={anyBusy()}
- onClick={() => void props.actions?.togglePause(row.connection)}
- class={buttonClass}
- >
- {pauseBusy()
- ? 'Working…'
- : row.enabled
- ? 'Pause'
- : 'Resume'}
- </button>
- </Show>
- <Show when={row.canRemove}>
- <button
- type="button"
- disabled={anyBusy()}
- onClick={() => void props.actions?.requestRemove(row.connection)}
- class={removeConfirming() ? removeConfirmClass : removeButtonClass}
- >
- {removeBusy()
- ? 'Removing…'
- : removeConfirming()
- ? 'Click again to confirm'
- : 'Remove'}
- </button>
- </Show>
+ <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>
- </div>
+ </TableCell>
- <Show when={removeConfirming()}>
- <div class="mt-3 space-y-2 rounded-md border border-border bg-surface-alt px-3 py-2">
- <p class="text-xs text-muted">{confirmHelpText(row.isAgent)}</p>
- <Show when={row.isAgent && props.agentUninstallCommands}>
- <div class="space-y-2">
- <div class="rounded-md border border-border bg-surface px-3 py-2">
- <div class="text-[11px] font-medium uppercase tracking-wide text-muted">
- Linux / macOS / FreeBSD
- </div>
- <div class="mt-1 break-all font-mono text-[11px] text-base-content">
- {props.agentUninstallCommands!.linux}
- </div>
- <Show when={props.onCopyText}>
- <button
- type="button"
- class={`${buttonClass} mt-2`}
- onClick={() =>
- props.onCopyText?.(props.agentUninstallCommands!.linux)
- }
- >
- Copy uninstall command
- </button>
- </Show>
- </div>
- </div>
- </Show>
+ <TableCell class="px-3 py-1 align-top">
+ <Show
+ when={row.coverageLabels.length > 0}
+ fallback={<span class="text-xs text-muted">-</span>}
+ >
+ <div
+ class="truncate whitespace-nowrap text-[12px] text-muted"
+ title={row.coverageLabels.join(', ')}
+ >
+ {summarizeCoverage(row.coverageLabels)}
+ </div>
+ </Show>
+ </TableCell>
+
+ <TableCell class="px-3 py-1 align-top">
+ <div class="flex items-center gap-1.5 whitespace-nowrap">
+ <span
+ class={`inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium whitespace-nowrap ${row.statusClassName}`}
+ >
+ {row.statusLabel}
+ </span>
+ <span class="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.connection)}
+ class={inlineButtonClass}
+ >
+ Edit
+ </button>
+ </Show>
+ </TableCell>
</Show>
+ </TableRow>
- <Show when={rowError()}>
- <div
- role="alert"
- class="mt-3 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"
+ <Show when={row.lastErrorMessage}>
+ <TableRow class="border-b border-border/80">
+ <TableCell
+ colspan={actionColumnVisible() ? 5 : 4}
+ class="bg-surface px-3 pb-1.5 pt-0"
>
- {rowError()}
- </div>
- </Show>
- </div>
+ <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>
+ </>
);
}}
</For>
</Show>
- </div>
- </div>
- );
- }}
- </For>
- </div>
+ </>
+ );
+ }}
+ </For>
+ </TableBody>
+ </Table>
</SettingsPanel>
);
};
diff --git a/frontend-modern/src/components/Settings/InfrastructureSourcePicker.tsx b/frontend-modern/src/components/Settings/InfrastructureSourcePicker.tsx
new file mode 100644
index 0000000000..28a70f22c4
--- /dev/null
+++ b/frontend-modern/src/components/Settings/InfrastructureSourcePicker.tsx
@@ -0,0 +1,108 @@
+import { Component, For, Show } from 'solid-js';
+import { Archive, Cpu, Database, Mail, Search, Server, ServerCog } from 'lucide-solid';
+import type { InfrastructureOnboardingConnectionType } from '@/utils/infrastructureOnboardingPresentation';
+import {
+ getInfrastructureSourcePickerGroups,
+ getInfrastructureOnboardingProductPresentation,
+} from '@/utils/infrastructureOnboardingPresentation';
+
+interface InfrastructureSourcePickerProps {
+ onSelectType: (type: InfrastructureOnboardingConnectionType) => void;
+ onDetectFromAddress?: () => void;
+}
+
+const detectButtonClass =
+ 'inline-flex items-center rounded-md border border-border px-3 py-2 text-sm font-medium text-base-content transition-colors hover:bg-surface-hover';
+
+const CARD_ICON: Record<InfrastructureOnboardingConnectionType, Component<{ class?: string }>> = {
+ vmware: ServerCog,
+ truenas: Database,
+ pve: Server,
+ pbs: Archive,
+ pmg: Mail,
+ agent: Cpu,
+};
+
+export const InfrastructureSourcePicker: Component<InfrastructureSourcePickerProps> = (props) => {
+ const groups = () => getInfrastructureSourcePickerGroups();
+
+ return (
+ <div class="space-y-6 p-4">
+ <section class="rounded-xl border border-border bg-surface-alt p-4">
+ <div class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
+ <div class="space-y-1">
+ <div class="text-sm font-semibold text-base-content">Choose a source type</div>
+ <p class="text-sm text-muted">
+ Add the kind of infrastructure you want Pulse to connect. Existing sources stay
+ visible on the page behind this dialog so you can open one, close it, and keep
+ managing the same list.
+ </p>
+ </div>
+ <Show when={props.onDetectFromAddress}>
+ <button
+ type="button"
+ onClick={props.onDetectFromAddress}
+ class={detectButtonClass}
+ >
+ <Search class="mr-2 h-4 w-4" />
+ Detect from address
+ </button>
+ </Show>
+ </div>
+ </section>
+
+ <For each={groups()}>
+ {(group) => (
+ <section class="space-y-3">
+ <div class="space-y-1">
+ <h3 class="text-sm font-semibold text-base-content">{group.label}</h3>
+ <p class="text-xs text-muted">{group.description}</p>
+ </div>
+
+ <div class="grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3">
+ <For each={group.products}>
+ {(product) => {
+ const Icon = CARD_ICON[product.type];
+ const details = getInfrastructureOnboardingProductPresentation(product.type);
+ return (
+ <button
+ type="button"
+ onClick={() => props.onSelectType(product.type)}
+ class="group flex h-full flex-col gap-3 rounded-xl border border-border bg-surface p-4 text-left transition-colors hover:border-blue-500 hover:bg-blue-50/40 dark:hover:bg-blue-950/20"
+ >
+ <div class="flex items-start gap-3">
+ <div
+ aria-hidden="true"
+ class="flex h-10 w-10 flex-none items-center justify-center rounded-md border border-border bg-surface-alt text-base-content"
+ >
+ <Icon class="h-5 w-5" />
+ </div>
+ <div class="min-w-0 space-y-1">
+ <div class="flex flex-wrap items-center gap-2">
+ <div class="text-sm font-semibold text-base-content">
+ {details.label}
+ </div>
+ <Show when={details.governanceState === 'admitted'}>
+ <span class="inline-flex items-center rounded-full border border-blue-200 bg-blue-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-blue-800 dark:border-blue-900 dark:bg-blue-950/40 dark:text-blue-200">
+ Available now
+ </span>
+ </Show>
+ </div>
+ <div class="text-xs text-muted">{details.catalogDescription}</div>
+ </div>
+ </div>
+
+ <div class="text-[11px] text-muted">{details.bestFor}</div>
+ </button>
+ );
+ }}
+ </For>
+ </div>
+ </section>
+ )}
+ </For>
+ </div>
+ );
+};
+
+export default InfrastructureSourcePicker;
diff --git a/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx b/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx
index f0fdf48118..8b71ac6ed4 100644
--- a/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx
+++ b/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx
@@ -6,7 +6,7 @@ import { copyToClipboard } from '@/utils/clipboard';
import { notificationStore } from '@/stores/notifications';
import { Dialog } from '@/components/shared/Dialog';
import { AgentProfilesPanel } from './AgentProfilesPanel';
-import { ConnectionsTable, type AgentUninstallCommands } from './ConnectionsTable';
+import type { AgentUninstallCommands } from './ConnectionsTable';
import { ConnectionEditor } from './ConnectionEditor/ConnectionEditor';
import { NodeCredentialSlot } from './ConnectionEditor/CredentialSlots/NodeCredentialSlot';
import { TrueNASCredentialSlot } from './ConnectionEditor/CredentialSlots/TrueNASCredentialSlot';
@@ -17,11 +17,13 @@ import type { VMwareConnection } from '@/api/vmware';
import type { NodeConfigWithStatus } from '@/types/nodes';
import { InfrastructureInstallerSection } from './InfrastructureInstallerSection';
import { InfrastructureSourceManager } from './InfrastructureSourceManager';
+import { InfrastructureSourcePicker } from './InfrastructureSourcePicker';
import {
buildInfrastructureOnboardingPath,
buildInfrastructureWorkspacePath,
deriveAddStepFromLocation,
type InfrastructureAddStep,
+ type InfrastructurePanelStep,
} from './infrastructureWorkspaceModel';
import type { InfrastructurePlatformSettingsProps } from './proxmoxSettingsModel';
import { useConnectionsLedger } from './useConnectionsLedger';
@@ -30,11 +32,21 @@ import {
InfrastructureOperationsStateProvider,
useInfrastructureOperationsContext,
} from './useInfrastructureOperationsState';
-import { getInfrastructureOnboardingProductPresentation } from '@/utils/infrastructureOnboardingPresentation';
+import {
+ clearSharedInfrastructureOnboardingMetricsTracker,
+ getSharedInfrastructureOnboardingMetricsTracker,
+ type InfrastructureOnboardingMetricsTracker,
+} from '@/utils/infrastructureOnboardingMetrics';
+import {
+ getInfrastructureOnboardingProductPresentation,
+ type InfrastructureOnboardingConnectionType,
+} from '@/utils/infrastructureOnboardingPresentation';
export type InfrastructureWorkspaceProps = InfrastructurePlatformSettingsProps;
-const ADD_STEP_TO_TYPE: Record<InfrastructureAddStep, ConnectionType> = {
+type ManagedAddTypeStep = Exclude<InfrastructureAddStep, 'detect'>;
+
+const ADD_STEP_TO_TYPE: Record<ManagedAddTypeStep, ConnectionType> = {
agent: 'agent',
pve: 'pve',
pbs: 'pbs',
@@ -45,10 +57,31 @@ const ADD_STEP_TO_TYPE: Record<InfrastructureAddStep, ConnectionType> = {
const closeButtonClass =
'inline-flex h-9 w-9 items-center justify-center rounded-md border border-border text-base-content transition-colors hover:bg-surface-hover';
+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 createOpenedOnboardingTracker = (): InfrastructureOnboardingMetricsTracker => {
+ const tracker = getSharedInfrastructureOnboardingMetricsTracker();
+ tracker.recordOpened();
+ return tracker;
+};
const describeManagedSourceType = (type: ConnectionType | null): string => {
if (!type) return 'Infrastructure';
- return getInfrastructureOnboardingProductPresentation(type as InfrastructureAddStep).label;
+ if (
+ type === 'agent' ||
+ type === 'vmware' ||
+ type === 'truenas' ||
+ type === 'pve' ||
+ type === 'pbs' ||
+ type === 'pmg'
+ ) {
+ return getInfrastructureOnboardingProductPresentation(type as InfrastructureOnboardingConnectionType)
+ .label;
+ }
+ if (type === 'docker') return 'Docker';
+ if (type === 'kubernetes') return 'Kubernetes';
+ return type;
};
const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> = (props) => {
@@ -61,14 +94,18 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
const [showAgentProfiles, setShowAgentProfiles] = createSignal(false);
const [editingConnection, setEditingConnection] = createSignal<Connection | null>(null);
const readOnly = createMemo(() => presentationPolicyIsReadOnly());
- const routeStep = createMemo(() => {
+ const routeStep = createMemo<InfrastructurePanelStep | null>(() => {
if (readOnly()) return null;
return deriveAddStepFromLocation(location.pathname, location.search ?? '');
});
+ const [addFlowTracker, setAddFlowTracker] =
+ createSignal<InfrastructureOnboardingMetricsTracker | null>(
+ routeStep() ? createOpenedOnboardingTracker() : null,
+ );
const activeAddType = createMemo<ConnectionType | null>(() => {
const step = routeStep();
- if (!step || step === 'pick') return null;
- return ADD_STEP_TO_TYPE[step];
+ if (!step || step === 'pick' || step === 'detect') return null;
+ return ADD_STEP_TO_TYPE[step as ManagedAddTypeStep];
});
const findEditableNode = (connection: Connection): NodeConfigWithStatus | null => {
@@ -125,12 +162,17 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
setShowAgentProfiles(false);
};
- const openAddFlow = (type: InfrastructureAddStep | 'pick') => {
- navigate(buildInfrastructureOnboardingPath(type), { scroll: false });
+ const openAddFlow = (step: InfrastructurePanelStep) => {
+ if (!addFlowTracker()) {
+ setAddFlowTracker(createOpenedOnboardingTracker());
+ }
+ navigate(buildInfrastructureOnboardingPath(step), { scroll: false });
};
const closeAddFlow = () => {
resetInlineEditorState();
+ setAddFlowTracker(null);
+ clearSharedInfrastructureOnboardingMetricsTracker();
navigateToWorkspace(Boolean(routeStep()));
};
@@ -143,14 +185,42 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
setEditingConnection(null);
};
+ const handleAddSaved = () => {
+ ledger.reload();
+ closeAddFlow();
+ };
+
const handleEditSaved = () => {
ledger.reload();
closeEditFlow();
};
+ const recordCatalogSelection = (type: InfrastructureOnboardingConnectionType) => {
+ const tracker = addFlowTracker();
+ if (!tracker) return;
+ tracker.recordPathSelected(type === 'agent' ? 'agent' : 'api');
+ if (type !== 'agent') {
+ tracker.recordCatalogSelected(type);
+ }
+ };
+
createEffect(() => {
- if (routeStep() !== 'pick') return;
- setShowAgentProfiles(false);
+ if (activeAddType() !== 'agent') {
+ setShowAgentProfiles(false);
+ }
+ });
+
+ createEffect(() => {
+ const step = routeStep();
+ const tracker = addFlowTracker();
+ if (step && !tracker) {
+ setAddFlowTracker(createOpenedOnboardingTracker());
+ return;
+ }
+ if (!step && tracker) {
+ setAddFlowTracker(null);
+ clearSharedInfrastructureOnboardingMetricsTracker();
+ }
});
createEffect(() => {
@@ -180,6 +250,15 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
editingNode={editingNode ?? null}
onCancel={editingRow ? closeEditFlow : closeAddFlow}
onSaved={editingRow ? handleEditSaved : handleAddSaved}
+ onToggleEnabled={
+ editingRow
+ ? () => {
+ void rowActions.togglePause(editingRow);
+ }
+ : undefined
+ }
+ togglePending={connectionId ? rowActions.pendingAction(connectionId) === 'pause' : false}
+ connectionEnabled={editingRow?.enabled}
onDelete={
editingRow
? () => {
@@ -194,9 +273,178 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
);
};
- const handleAddSaved = () => {
- ledger.reload();
- closeAddFlow();
+ const renderAgentAddSlot = () => (
+ <div class="space-y-4">
+ <div class="flex items-center justify-end">
+ <button
+ type="button"
+ onClick={() => setShowAgentProfiles((value) => !value)}
+ class="inline-flex items-center rounded-md border border-border px-2.5 py-1 text-xs font-medium text-base-content transition-colors hover:bg-surface-hover"
+ >
+ {showAgentProfiles() ? 'Hide agent profiles' : 'Manage agent profiles'}
+ </button>
+ </div>
+ <Show when={showAgentProfiles()}>
+ <div class="rounded-xl border border-border bg-surface p-4 shadow-sm">
+ <div class="mb-4 space-y-1">
+ <div class="text-base font-semibold text-base-content">Agent profiles</div>
+ <div class="text-sm text-muted">
+ Manage reusable install defaults for agent-based systems.
+ </div>
+ </div>
+ <AgentProfilesPanel />
+ </div>
+ </Show>
+ <InfrastructureInstallerSection />
+ </div>
+ );
+
+ const renderAgentConnectionDetails = (connection: Connection) => {
+ const pausePending = () => rowActions.pendingAction(connection.id) === 'pause';
+ const removePending = () => rowActions.pendingAction(connection.id) === 'remove';
+ const removeConfirming = () => rowActions.confirmingRemove(connection.id);
+ const error = () => rowActions.actionError(connection.id);
+
+ return (
+ <div class="space-y-6 p-4">
+ <section class="rounded-xl border border-border bg-surface p-4">
+ <div class="flex flex-wrap items-start justify-between gap-4">
+ <div class="space-y-1">
+ <div class="text-[11px] font-medium uppercase tracking-wide text-muted">
+ Pulse Agent
+ </div>
+ <div class="text-lg font-semibold text-base-content">{connection.name}</div>
+ <Show when={connection.address}>
+ <div class="break-words text-sm text-muted">{connection.address}</div>
+ </Show>
+ </div>
+ <span class="inline-flex items-center rounded-full border border-border bg-surface-alt px-2.5 py-1 text-xs font-medium text-base-content">
+ {connection.enabled ? 'Enabled' : 'Paused'}
+ </span>
+ </div>
+
+ <div class="mt-4 grid gap-3 sm:grid-cols-2">
+ <div class="rounded-lg border border-border bg-surface-alt px-3 py-3">
+ <div class="text-[11px] font-medium uppercase tracking-wide text-muted">
+ Connection state
+ </div>
+ <div class="mt-1 text-sm text-base-content">{connection.state}</div>
+ </div>
+ <div class="rounded-lg border border-border bg-surface-alt px-3 py-3">
+ <div class="text-[11px] font-medium uppercase tracking-wide text-muted">
+ Last seen
+ </div>
+ <div class="mt-1 text-sm text-base-content">
+ {connection.lastSeen ? connection.lastSeen : 'No activity yet'}
+ </div>
+ </div>
+ </div>
+
+ <Show when={connection.lastError?.message}>
+ <div class="mt-4 rounded-md border border-rose-300 bg-rose-50 px-4 py-3 text-sm text-rose-800 dark:border-rose-900 dark:bg-rose-950 dark:text-rose-200">
+ {connection.lastError?.message}
+ </div>
+ </Show>
+ </section>
+
+ <section class="rounded-xl border border-border bg-surface p-4">
+ <div class="space-y-3">
+ <div class="space-y-1">
+ <div class="text-sm font-semibold text-base-content">Uninstall commands</div>
+ <p class="text-xs text-muted">
+ Removing the source forgets it from Pulse. Uninstall the agent on the host as well
+ if you want to detach it completely.
+ </p>
+ </div>
+
+ <div class="grid gap-3 lg:grid-cols-2">
+ <div class="rounded-lg border border-border bg-surface-alt px-3 py-3">
+ <div class="text-[11px] font-medium uppercase tracking-wide text-muted">
+ Linux / macOS / FreeBSD
+ </div>
+ <div class="mt-1 break-all font-mono text-[11px] text-base-content">
+ {agentUninstallCommands().linux}
+ </div>
+ <button
+ type="button"
+ onClick={() => void handleCopy(agentUninstallCommands().linux)}
+ class={`${buttonClass} mt-3`}
+ >
+ Copy uninstall command
+ </button>
+ </div>
+
+ <div class="rounded-lg border border-border bg-surface-alt px-3 py-3">
+ <div class="text-[11px] font-medium uppercase tracking-wide text-muted">
+ Windows PowerShell
+ </div>
+ <div class="mt-1 break-all font-mono text-[11px] text-base-content">
+ {agentUninstallCommands().windows}
+ </div>
+ <button
+ type="button"
+ onClick={() => void handleCopy(agentUninstallCommands().windows)}
+ class={`${buttonClass} mt-3`}
+ >
+ Copy uninstall command
+ </button>
+ </div>
+ </div>
+ </div>
+ </section>
+
+ <Show when={removeConfirming()}>
+ <div class="rounded-md border border-border bg-surface-alt px-4 py-3 text-xs text-muted">
+ Click remove again to confirm. Pulse will forget this agent, but it will still be
+ installed on the host until you run the uninstall command.
+ </div>
+ </Show>
+
+ <Show when={error()}>
+ {(message) => (
+ <div
+ role="alert"
+ class="rounded-md border border-rose-300 bg-rose-50 px-4 py-3 text-sm text-rose-800 dark:border-rose-900 dark:bg-rose-950 dark:text-rose-200"
+ >
+ {message()}
+ </div>
+ )}
+ </Show>
+
+ <div class="flex flex-col-reverse gap-2 sm:flex-row sm:justify-end">
+ <button
+ type="button"
+ onClick={() => void rowActions.togglePause(connection)}
+ disabled={pausePending() || removePending()}
+ class={buttonClass}
+ >
+ {pausePending()
+ ? connection.enabled
+ ? 'Pausing…'
+ : 'Resuming…'
+ : connection.enabled
+ ? 'Pause connection'
+ : 'Resume connection'}
+ </button>
+ <button
+ type="button"
+ onClick={() => void rowActions.requestRemove(connection)}
+ disabled={pausePending() || removePending()}
+ class={
+ removeConfirming()
+ ? 'inline-flex min-h-10 sm:min-h-9 items-center justify-center rounded-md bg-rose-600 px-3 py-2 text-sm font-medium text-white transition-colors hover:bg-rose-700 disabled:cursor-not-allowed disabled:opacity-60'
+ : 'inline-flex min-h-10 sm:min-h-9 items-center justify-center rounded-md border border-rose-300 px-3 py-2 text-sm font-medium text-rose-700 transition-colors hover:bg-rose-50 disabled:cursor-not-allowed disabled:opacity-60 dark:border-rose-900 dark:text-rose-300 dark:hover:bg-rose-950'
+ }
+ >
+ {removePending()
+ ? 'Removing…'
+ : removeConfirming()
+ ? 'Click again to confirm'
+ : 'Remove source'}
+ </button>
+ </div>
+ </div>
+ );
};
const renderConnectionSlot = (context: {
@@ -255,6 +503,9 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
editingConnection={vmware}
onCancel={context.onCancel}
onSaved={context.onSaved}
+ onToggleEnabled={() => void rowActions.togglePause(connection)}
+ togglePending={rowActions.pendingAction(connection.id) === 'pause'}
+ connectionEnabled={connection.enabled}
onDelete={() => void rowActions.requestRemove(connection)}
deletePending={rowActions.pendingAction(connection.id) === 'remove'}
deleteConfirming={rowActions.confirmingRemove(connection.id)}
@@ -281,6 +532,9 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
editingConnection={truenas}
onCancel={context.onCancel}
onSaved={context.onSaved}
+ onToggleEnabled={() => void rowActions.togglePause(connection)}
+ togglePending={rowActions.pendingAction(connection.id) === 'pause'}
+ connectionEnabled={connection.enabled}
onDelete={() => void rowActions.requestRemove(connection)}
deletePending={rowActions.pendingAction(connection.id) === 'remove'}
deleteConfirming={rowActions.confirmingRemove(connection.id)}
@@ -319,31 +573,7 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
/>
);
case 'agent':
- return (
- <div class="space-y-4">
- <div class="flex items-center justify-end">
- <button
- type="button"
- onClick={() => setShowAgentProfiles((value) => !value)}
- class="inline-flex items-center rounded-md border border-border px-2.5 py-1 text-xs font-medium text-base-content transition-colors hover:bg-surface-hover"
- >
- {showAgentProfiles() ? 'Hide agent profiles' : 'Manage agent profiles'}
- </button>
- </div>
- <Show when={showAgentProfiles()}>
- <div class="rounded-xl border border-border bg-surface p-4 shadow-sm">
- <div class="mb-4 space-y-1">
- <div class="text-base font-semibold text-base-content">Agent profiles</div>
- <div class="text-sm text-muted">
- Manage reusable install defaults for agent-based systems.
- </div>
- </div>
- <AgentProfilesPanel />
- </div>
- </Show>
- <InfrastructureInstallerSection />
- </div>
- );
+ return renderAgentAddSlot();
default:
return (
<div class="text-sm text-muted">
@@ -356,23 +586,27 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
const addDialogTitle = createMemo(() => {
const step = routeStep();
if (!step || step === 'pick') return 'Add infrastructure';
+ if (step === 'detect') return 'Detect infrastructure source';
return `Add ${describeManagedSourceType(activeAddType())}`;
});
const addDialogDescription = createMemo(() => {
const step = routeStep();
if (!step || step === 'pick') {
- return 'Detect a source from its address, or choose the source type you want to add.';
+ return 'Choose the source type you want to add.';
+ }
+ if (step === 'detect') {
+ return 'Probe an address and let Pulse open the matching credential flow when it recognizes the platform.';
}
const presentation = getInfrastructureOnboardingProductPresentation(
- activeAddType() as InfrastructureAddStep,
+ activeAddType() as InfrastructureOnboardingConnectionType,
);
return `${presentation.bestFor}. ${presentation.coverage}.`;
});
const editDialogTitle = createMemo(() => {
const connection = editingConnection();
- if (!connection) return 'Edit connection';
+ if (!connection) return 'Edit source';
return `Edit ${connection.name}`;
});
@@ -391,74 +625,81 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
<InfrastructureSourceManager
rows={rows}
readOnly={readOnly()}
- actions={readOnly() ? undefined : rowActions}
- onAddType={(type) => openAddFlow(type as InfrastructureAddStep)}
- onEditConnection={readOnly() ? undefined : (connection) => setEditingConnection(connection)}
- onDetectFromAddress={readOnly() ? undefined : () => openAddFlow('pick')}
- agentUninstallCommands={agentUninstallCommands()}
- onCopyText={(text) => void handleCopy(text)}
+ onAddSource={
+ readOnly()
+ ? undefined
+ : (type) => openAddFlow(type === 'agent' ? 'agent' : (type as ManagedAddTypeStep))
+ }
+ onDetectFromAddress={readOnly() ? undefined : () => openAddFlow('detect')}
+ onOpenConnection={readOnly() ? undefined : (connection) => setEditingConnection(connection)}
/>
- <ConnectionsTable rows={rows} />
+ <Show when={routeStep() !== null}>
+ <Dialog
+ isOpen={true}
+ onClose={closeAddFlow}
+ ariaLabel={addDialogTitle()}
+ panelClass={isAgentDialog() ? 'max-w-6xl' : 'max-w-5xl'}
+ >
+ <div class="flex h-full flex-col">
+ <div class="flex items-start justify-between gap-4 border-b border-border bg-surface-alt px-4 py-4 sm:px-6">
+ <div class="space-y-1">
+ <h2 class="text-base font-semibold text-base-content">{addDialogTitle()}</h2>
+ <p class="text-sm text-muted">{addDialogDescription()}</p>
+ </div>
+ <button
+ type="button"
+ onClick={closeAddFlow}
+ class={closeButtonClass}
+ aria-label="Close add infrastructure dialog"
+ >
+ <X class="h-4 w-4" />
+ </button>
+ </div>
- <Show when={routeStep()}>
- {(stepAccessor) => {
- const step = stepAccessor();
- return (
- <Dialog
- isOpen={true}
- onClose={closeAddFlow}
- ariaLabel={addDialogTitle()}
- panelClass={isAgentDialog() ? 'max-w-6xl' : 'max-w-5xl'}
- >
- <div class="flex h-full flex-col">
- <div class="flex items-start justify-between gap-4 border-b border-border bg-surface-alt px-4 py-4 sm:px-6">
- <div class="space-y-1">
- <h2 class="text-base font-semibold text-base-content">{addDialogTitle()}</h2>
- <p class="text-sm text-muted">{addDialogDescription()}</p>
- </div>
- <button
- type="button"
- onClick={closeAddFlow}
- class={closeButtonClass}
- aria-label="Close add infrastructure dialog"
- >
- <X class="h-4 w-4" />
- </button>
- </div>
+ <div class="min-h-0 flex-1 overflow-y-auto">
+ <Switch>
+ <Match when={routeStep() === 'pick'}>
+ <InfrastructureSourcePicker
+ onSelectType={(type) => {
+ recordCatalogSelection(type);
+ openAddFlow(type === 'agent' ? 'agent' : (type as ManagedAddTypeStep));
+ }}
+ onDetectFromAddress={() => openAddFlow('detect')}
+ />
+ </Match>
- <div class="min-h-0 flex-1 overflow-y-auto">
- <Switch>
- <Match when={step === 'pick'}>
- <ConnectionEditor
- mode="add"
- onClose={closeAddFlow}
- onSaved={handleAddSaved}
- renderCredentialSlot={({ type, onCancel, onSaved }) =>
- renderConnectionSlot({ mode: 'add', type, onCancel, onSaved })
- }
- />
- </Match>
+ <Match when={routeStep() === 'detect'}>
+ <ConnectionEditor
+ mode="add"
+ onboardingMetricsTracker={addFlowTracker()}
+ onBackToCatalog={() => openAddFlow('pick')}
+ onClose={closeAddFlow}
+ onSaved={handleAddSaved}
+ renderCredentialSlot={({ type, onCancel, onSaved }) =>
+ renderConnectionSlot({ mode: 'add', type, onCancel, onSaved })
+ }
+ />
+ </Match>
- <Match when={Boolean(activeAddType())}>
- <ConnectionEditor
- mode="add"
- initialType={activeAddType() ?? undefined}
- showSlotHeader={false}
- trackInitialCatalogSelection={activeAddType() !== 'agent'}
- onClose={closeAddFlow}
- onSaved={handleAddSaved}
- renderCredentialSlot={({ type, onCancel, onSaved }) =>
- renderConnectionSlot({ mode: 'add', type, onCancel, onSaved })
- }
- />
- </Match>
- </Switch>
- </div>
- </div>
- </Dialog>
- );
- }}
+ <Match when={Boolean(activeAddType())}>
+ <ConnectionEditor
+ mode="add"
+ initialType={activeAddType() ?? undefined}
+ showSlotHeader={false}
+ trackInitialCatalogSelection={activeAddType() !== 'agent'}
+ onboardingMetricsTracker={addFlowTracker()}
+ onClose={closeAddFlow}
+ onSaved={handleAddSaved}
+ renderCredentialSlot={({ type, onCancel, onSaved }) =>
+ renderConnectionSlot({ mode: 'add', type, onCancel, onSaved })
+ }
+ />
+ </Match>
+ </Switch>
+ </div>
+ </div>
+ </Dialog>
</Show>
<Show when={editingConnection()}>
@@ -469,7 +710,7 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
isOpen={true}
onClose={closeEditFlow}
ariaLabel={editDialogTitle()}
- panelClass={connection.type === 'agent' ? 'max-w-6xl' : 'max-w-5xl'}
+ panelClass={connection.type === 'agent' ? 'max-w-5xl' : 'max-w-5xl'}
>
<div class="flex h-full flex-col">
<div class="flex items-start justify-between gap-4 border-b border-border bg-surface-alt px-4 py-4 sm:px-6">
@@ -488,16 +729,23 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
</div>
<div class="min-h-0 flex-1 overflow-y-auto">
- <ConnectionEditor
- mode="edit"
- initialType={connection.type}
- showSlotHeader={false}
- onClose={closeEditFlow}
- onSaved={handleEditSaved}
- renderCredentialSlot={({ type, onCancel, onSaved }) =>
- renderConnectionSlot({ mode: 'edit', type, onCancel, onSaved })
+ <Show
+ when={connection.type === 'agent'}
+ fallback={
+ <ConnectionEditor
+ mode="edit"
+ initialType={connection.type}
+ showSlotHeader={false}
+ onClose={closeEditFlow}
+ onSaved={handleEditSaved}
+ renderCredentialSlot={({ type, onCancel, onSaved }) =>
+ renderConnectionSlot({ mode: 'edit', type, onCancel, onSaved })
+ }
+ />
}
- />
+ >
+ {renderAgentConnectionDetails(connection)}
+ </Show>
</div>
</div>
</Dialog>
diff --git a/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx b/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx
index 1ec2100c58..9b475c337b 100644
--- a/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx
@@ -1,4 +1,4 @@
-import { cleanup, fireEvent, render, screen, waitFor } from '@solidjs/testing-library';
+import { cleanup, fireEvent, render, screen, waitFor, within } from '@solidjs/testing-library';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import type { Connection } from '@/api/connections';
import { InfrastructureWorkspace } from '../InfrastructureWorkspace';
@@ -12,6 +12,29 @@ const connectionState = vi.hoisted(() => ({
}));
const navigateSpy = vi.hoisted(() => vi.fn());
const presentationPolicyIsReadOnlyMock = vi.hoisted(() => vi.fn(() => false));
+const onboardingMetricsTrackers = vi.hoisted(
+ () =>
+ [] as Array<{
+ recordOpened: ReturnType<typeof vi.fn>;
+ recordPathSelected: ReturnType<typeof vi.fn>;
+ recordProbeResult: ReturnType<typeof vi.fn>;
+ recordCatalogSelected: ReturnType<typeof vi.fn>;
+ recordCredentialsOpened: ReturnType<typeof vi.fn>;
+ }>,
+);
+const createInfrastructureOnboardingMetricsTrackerMock = vi.hoisted(() =>
+ vi.fn(() => {
+ const tracker = {
+ recordOpened: vi.fn(),
+ recordPathSelected: vi.fn(),
+ recordProbeResult: vi.fn(),
+ recordCatalogSelected: vi.fn(),
+ recordCredentialsOpened: vi.fn(),
+ };
+ onboardingMetricsTrackers.push(tracker);
+ return tracker;
+ }),
+);
vi.mock('@solidjs/router', async () => {
const actual = await vi.importActual<typeof import('@solidjs/router')>('@solidjs/router');
@@ -92,13 +115,9 @@ vi.mock('../AgentProfilesPanel', () => ({
}));
vi.mock('@/utils/infrastructureOnboardingMetrics', () => ({
- createInfrastructureOnboardingMetricsTracker: () => ({
- recordOpened: vi.fn(),
- recordPathSelected: vi.fn(),
- recordProbeResult: vi.fn(),
- recordCatalogSelected: vi.fn(),
- recordCredentialsOpened: vi.fn(),
- }),
+ createInfrastructureOnboardingMetricsTracker: createInfrastructureOnboardingMetricsTrackerMock,
+ getSharedInfrastructureOnboardingMetricsTracker: createInfrastructureOnboardingMetricsTrackerMock,
+ clearSharedInfrastructureOnboardingMetricsTracker: vi.fn(),
}));
const connectionFixture = (overrides: Partial<Connection> = {}): Connection => ({
@@ -183,6 +202,8 @@ describe('InfrastructureWorkspace', () => {
navigateSpy.mockReset();
presentationPolicyIsReadOnlyMock.mockReset();
presentationPolicyIsReadOnlyMock.mockReturnValue(false);
+ createInfrastructureOnboardingMetricsTrackerMock.mockClear();
+ onboardingMetricsTrackers.length = 0;
routeState.pathname = '/settings/infrastructure';
routeState.search = '';
connectionState.connections = [connectionFixture()];
@@ -195,80 +216,140 @@ describe('InfrastructureWorkspace', () => {
const renderWorkspace = (propOverrides: Record<string, unknown> = {}) =>
render(() => (<InfrastructureWorkspace {...{ ...baseProps(), ...propOverrides }} />) as any);
- it('renders the source-manager landing and keeps the monitored systems summary below it', async () => {
+ it('renders the instance-first source manager as the only landing surface', async () => {
renderWorkspace();
await waitFor(() =>
- expect(screen.getByRole('heading', { name: 'Connection types' })).toBeInTheDocument(),
+ expect(screen.getByText('Infrastructure sources')).toBeInTheDocument(),
);
- expect(screen.getByRole('button', { name: 'Detect from address' })).toBeInTheDocument();
- expect(screen.getByRole('button', { name: 'Add VMware vCenter' })).toBeInTheDocument();
- expect(screen.getByRole('button', { name: 'Add TrueNAS' })).toBeInTheDocument();
- expect(screen.getByRole('heading', { name: 'Monitored systems' })).toBeInTheDocument();
- expect(screen.getAllByText('zeus').length).toBeGreaterThan(0);
+ expect(screen.getByRole('button', { name: /Detect from address/i })).toBeInTheDocument();
+ expect(screen.getByText('VMware vCenter')).toBeInTheDocument();
+ expect(screen.getByText('TrueNAS SCALE')).toBeInTheDocument();
+ expect(screen.getByText('Proxmox VE')).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: /Add Proxmox VE/i })).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: /Edit/i })).toBeInTheDocument();
+ expect(screen.queryByRole('heading', { name: 'Monitored systems' })).not.toBeInTheDocument();
});
- it('opens the detect dialog through the canonical onboarding route', () => {
+ it('opens the detect dialog from the source manager header action', () => {
renderWorkspace();
- fireEvent.click(screen.getByRole('button', { name: 'Detect from address' }));
+ fireEvent.click(screen.getByRole('button', { name: /Detect from address/i }));
- expect(navigateSpy).toHaveBeenCalledWith('/settings/infrastructure?add=pick', {
+ expect(navigateSpy).toHaveBeenCalledWith('/settings/infrastructure?add=detect', {
scroll: false,
});
});
- it('opens a type-specific add route from the source cards', () => {
+ it('opens a type-specific add route from the matching platform section', () => {
renderWorkspace();
- fireEvent.click(screen.getByRole('button', { name: 'Add TrueNAS' }));
+ fireEvent.click(screen.getByRole('button', { name: /Add TrueNAS SCALE/i }));
expect(navigateSpy).toHaveBeenCalledWith('/settings/infrastructure?add=truenas', {
scroll: false,
});
+ expect(createInfrastructureOnboardingMetricsTrackerMock).toHaveBeenCalledTimes(1);
+ expect(onboardingMetricsTrackers[0]?.recordOpened).toHaveBeenCalledTimes(1);
+ });
+
+ it('renders the route-backed picker dialog when the pick query is present', async () => {
+ routeState.search = '?add=pick';
+ renderWorkspace();
+
+ await waitFor(() => expect(screen.getByRole('dialog')).toBeInTheDocument());
+ const dialog = screen.getByRole('dialog');
+ expect(screen.getAllByText('Add infrastructure').length).toBeGreaterThan(0);
+ expect(screen.getByText('Choose the source type you want to add.')).toBeInTheDocument();
+ expect(within(dialog).getByText('Choose a source type')).toBeInTheDocument();
+ expect(within(dialog).getByRole('button', { name: 'Detect from address' })).toBeInTheDocument();
+ expect(within(dialog).getByText('Virtualization')).toBeInTheDocument();
+ expect(within(dialog).getByRole('button', { name: /TrueNAS SCALE/i })).toBeInTheDocument();
});
- it('renders the route-backed detect dialog when the canonical pick query is present', async () => {
+ it('routes the picker detect action into the detect dialog', async () => {
routeState.search = '?add=pick';
renderWorkspace();
await waitFor(() => expect(screen.getByRole('dialog')).toBeInTheDocument());
- expect(screen.getByText('Add infrastructure')).toBeInTheDocument();
- expect(screen.getByText('Choose how Pulse should connect')).toBeInTheDocument();
- expect(screen.getByRole('button', { name: /Probe address/i })).toBeInTheDocument();
+ fireEvent.click(within(screen.getByRole('dialog')).getByRole('button', { name: 'Detect from address' }));
+
+ expect(navigateSpy).toHaveBeenCalledWith('/settings/infrastructure?add=detect', {
+ scroll: false,
+ });
});
- it('renders the route-backed agent dialog when the canonical agent query is present', async () => {
+ it('routes the picker source cards into direct type-specific dialogs', async () => {
+ routeState.search = '?add=pick';
+ renderWorkspace();
+
+ await waitFor(() => expect(screen.getByRole('dialog')).toBeInTheDocument());
+ fireEvent.click(within(screen.getByRole('dialog')).getByRole('button', { name: /TrueNAS SCALE/i }));
+
+ expect(navigateSpy).toHaveBeenCalledWith('/settings/infrastructure?add=truenas', {
+ scroll: false,
+ });
+ });
+
+ it('renders the detect dialog as a secondary utility flow', async () => {
+ routeState.search = '?add=detect';
+ renderWorkspace();
+
+ await waitFor(() => expect(screen.getByRole('dialog')).toBeInTheDocument());
+ expect(screen.getByText('Detect infrastructure source')).toBeInTheDocument();
+ expect(
+ screen.getByText(
+ 'Probe an address and let Pulse open the matching credential flow when it recognizes the platform.',
+ ),
+ ).toBeInTheDocument();
+ expect(screen.getAllByText('Detect from address').length).toBeGreaterThan(0);
+ expect(within(screen.getByRole('dialog')).getByRole('button', { name: /Back to source types/i })).toBeInTheDocument();
+ expect(within(screen.getByRole('dialog')).getByRole('button', { name: /Probe address/i })).toBeInTheDocument();
+ });
+
+ it('renders the route-backed agent dialog when the agent query is present', async () => {
routeState.search = '?add=agent';
renderWorkspace();
await waitFor(() => expect(screen.getByRole('dialog')).toBeInTheDocument());
- expect(screen.getByText('Add Pulse Agent')).toBeInTheDocument();
+ expect(screen.getAllByText('Add Pulse Agent').length).toBeGreaterThan(0);
expect(screen.getByTestId('install-section')).toBeInTheDocument();
});
- it('opens the edit dialog directly from an existing source row', async () => {
+ it('creates one onboarding tracker for a direct type route before the add dialog mounts', async () => {
+ routeState.search = '?add=truenas';
+ renderWorkspace();
+
+ await waitFor(() => expect(screen.getByRole('dialog')).toBeInTheDocument());
+ expect(createInfrastructureOnboardingMetricsTrackerMock).toHaveBeenCalledTimes(1);
+ expect(onboardingMetricsTrackers).toHaveLength(1);
+ expect(onboardingMetricsTrackers[0]?.recordOpened).toHaveBeenCalledTimes(1);
+ });
+
+ it('opens the edit dialog directly from an existing source card', async () => {
renderWorkspace({
pveNodes: () => [{ name: 'zeus', host: 'https://10.0.0.1:8006' } as any],
});
- await waitFor(() => expect(screen.getAllByText('zeus').length).toBeGreaterThan(0));
- fireEvent.click(screen.getAllByRole('button', { name: 'Edit' })[0]);
+ await waitFor(() => expect(screen.getByRole('button', { name: /^Edit$/i })).toBeInTheDocument());
+ fireEvent.click(screen.getByRole('button', { name: /^Edit$/i }));
await waitFor(() => expect(screen.getByRole('dialog')).toBeInTheDocument());
expect(screen.getByText('Edit zeus')).toBeInTheDocument();
expect(screen.getByTestId('proxmox-section')).toBeInTheDocument();
});
- it('hides source-manager actions and route-backed dialogs in read-only mode', () => {
+ it('hides the add flow and source-manager actions in read-only mode', () => {
presentationPolicyIsReadOnlyMock.mockReturnValue(true);
routeState.search = '?add=agent';
renderWorkspace();
- expect(screen.queryByRole('button', { name: 'Detect from address' })).toBeNull();
- expect(screen.queryByRole('button', { name: 'Add VMware vCenter' })).toBeNull();
+ expect(screen.queryByRole('button', { name: /Detect from address/i })).toBeNull();
+ expect(screen.queryByRole('button', { name: /Add Proxmox VE/i })).toBeNull();
+ expect(screen.queryByRole('button', { name: /^Edit$/i })).toBeNull();
expect(screen.queryByRole('dialog')).toBeNull();
expect(screen.queryByTestId('install-section')).toBeNull();
- expect(screen.getByRole('heading', { name: 'Monitored systems' })).toBeInTheDocument();
+ expect(screen.getByText('Infrastructure sources')).toBeInTheDocument();
+ expect(screen.queryByRole('heading', { name: 'Monitored systems' })).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 de30461751..688775015f 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
@@ -7,6 +7,7 @@ import settingsNavigationHookSource from '../useSettingsNavigation.ts?raw';
import settingsPanelRegistryContextSource from '../settingsPanelRegistryContext.tsx?raw';
import infrastructureWorkspaceSource from '../InfrastructureWorkspace.tsx?raw';
import infrastructureSourceManagerSource from '../InfrastructureSourceManager.tsx?raw';
+import infrastructureSourcePickerSource from '../InfrastructureSourcePicker.tsx?raw';
import infrastructureWorkspaceModelSource from '../infrastructureWorkspaceModel.ts?raw';
import connectionsTableSource from '../ConnectionsTable.tsx?raw';
import connectionEditorSource from '../ConnectionEditor/ConnectionEditor.tsx?raw';
@@ -38,9 +39,7 @@ describe('settings architecture guardrails', () => {
it('keeps infrastructure onboarding route-backed under the shared settings shell', () => {
expect(settingsHeaderMetaSource).toContain("'infrastructure-systems': {");
- expect(settingsHeaderMetaSource).toContain(
- 'Manage platform connections, Pulse Agent installs, and monitored systems.',
- );
+ expect(settingsHeaderMetaSource).toContain('Manage infrastructure sources.');
expect(settingsHeaderMetaSource).toContain("'organization-access': {");
expect(settingsHeaderMetaSource).toContain(
'Manage organization invitations, member roles, and ownership transfers.',
@@ -95,75 +94,82 @@ describe('settings architecture guardrails', () => {
expect(infrastructureWorkspaceSource).toContain(
"import { InfrastructureSourceManager } from './InfrastructureSourceManager';",
);
- expect(infrastructureWorkspaceSource).toContain("import { Dialog } from '@/components/shared/Dialog';");
+ expect(infrastructureWorkspaceSource).toContain(
+ "import { InfrastructureSourcePicker } from './InfrastructureSourcePicker';",
+ );
+ expect(infrastructureWorkspaceSource).toContain(
+ "import { Dialog } from '@/components/shared/Dialog';",
+ );
expect(infrastructureWorkspaceSource).toContain('NodeCredentialSlot');
expect(infrastructureWorkspaceSource).toContain('TrueNASCredentialSlot');
expect(infrastructureWorkspaceSource).toContain('VMwareCredentialSlot');
expect(infrastructureWorkspaceSource).toContain(
- 'navigate(buildInfrastructureOnboardingPath(type), { scroll: false });',
+ ": (type) => openAddFlow(type === 'agent' ? 'agent' : (type as ManagedAddTypeStep))",
);
expect(infrastructureWorkspaceSource).toContain(
- '<InfrastructureSourceManager',
+ "onDetectFromAddress={readOnly() ? undefined : () => openAddFlow('detect')}",
);
+ expect(infrastructureWorkspaceSource).toContain('<InfrastructureSourceManager');
+ expect(infrastructureWorkspaceSource).toContain('<InfrastructureSourcePicker');
+ expect(infrastructureWorkspaceSource).not.toContain('<ConnectionsTable rows={rows} />');
+ expect(infrastructureWorkspaceSource).toContain("showSlotHeader={false}");
expect(infrastructureWorkspaceSource).toContain(
- '<ConnectionsTable rows={rows} />',
+ "trackInitialCatalogSelection={activeAddType() !== 'agent'}",
);
- expect(infrastructureWorkspaceSource).toContain("showSlotHeader={false}");
- expect(infrastructureWorkspaceSource).toContain('trackInitialCatalogSelection={activeAddType() !== \'agent\'}');
+ expect(infrastructureWorkspaceSource).toContain("onDetectFromAddress={() => openAddFlow('detect')}");
+ expect(infrastructureWorkspaceSource).toContain("onBackToCatalog={() => openAddFlow('pick')}");
+ expect(infrastructureWorkspaceSource).toContain('recordCatalogSelection(type);');
+ expect(infrastructureWorkspaceSource).toContain('renderAgentConnectionDetails');
expect(infrastructureWorkspaceSource).not.toContain('InfrastructureOperationsController');
expect(infrastructureWorkspaceSource).not.toContain('PlatformConnectionsWorkspace');
+ expect(infrastructureSourceManagerSource).toContain('Infrastructure sources');
expect(infrastructureSourceManagerSource).toContain('Detect from address');
- expect(infrastructureSourceManagerSource).toContain('Connection types');
- expect(infrastructureSourceManagerSource).toContain('{groupRows().length} configured');
+ expect(infrastructureSourceManagerSource).toContain('getInfrastructureSourceManagerProducts');
+ expect(infrastructureSourceManagerSource).toContain('TableHeader');
+ expect(infrastructureSourceManagerSource).toContain('aria-label={`Add ${product.label}`}');
+ expect(infrastructureSourceManagerSource).toContain('Edit');
+ expect(infrastructureSourceManagerSource).not.toContain('Connection types');
+ expect(infrastructureSourcePickerSource).toContain('Choose a source type');
+ expect(infrastructureSourcePickerSource).toContain('Detect from address');
+ expect(infrastructureSourcePickerSource).toContain('getInfrastructureSourcePickerGroups');
+ expect(infrastructureSourcePickerSource).toContain('group.label');
});
- it('keeps the platform-first add dialog and inline credential bodies on the shared editor model', () => {
+ it('keeps the detect-first editor and inline credential bodies on the shared editor model', () => {
expect(connectionEditorSource).toContain(
"import { AddressProbeStep } from './AddressProbeStep';",
);
- expect(connectionEditorSource).toContain(
- "from '@/utils/infrastructureOnboardingPresentation';",
- );
+ expect(connectionEditorSource).toContain("from '@/utils/infrastructureOnboardingPresentation';");
expect(connectionsTableSource).toContain(
"from '@/utils/infrastructureOnboardingPresentation';",
);
- expect(connectionEditorSource).toContain('buildConnectionEditorCatalogEntries');
- expect(connectionEditorSource).toContain('selectedFamilyId');
expect(connectionEditorSource).toContain('<AddressProbeStep');
- expect(connectionEditorSource).toContain('Choose how Pulse should connect');
- expect(connectionEditorSource).toContain('Connect a supported platform');
- expect(connectionEditorSource).toContain('Choose a {family.label} product');
- expect(connectionEditorSource).toContain('Back to platforms');
- expect(connectionEditorSource).toContain('Available now');
- expect(connectionEditorSource).toContain('other supported services');
- expect(connectionEditorSource).toContain('connects them when available');
- expect(connectionEditorSource).not.toContain('On supported Proxmox hosts');
- expect(connectionEditorSource).not.toContain('register them automatically');
- expect(connectionEditorSource).not.toContain('auto-registers the node');
- expect(connectionEditorSource).not.toContain('Recommended');
+ expect(connectionEditorSource).toContain('Detect from address');
+ expect(connectionEditorSource).toContain('Address probe');
+ expect(connectionEditorSource).toContain('Back to source types');
+ expect(connectionEditorSource).toContain('Back to detect');
+ expect(connectionEditorSource).toContain('What happens next');
+ expect(connectionEditorSource).not.toContain('buildConnectionEditorCatalogEntries');
+ expect(connectionEditorSource).not.toContain('selectedFamilyId');
+ expect(connectionEditorSource).not.toContain('Choose how Pulse should connect');
+ expect(connectionEditorSource).not.toContain('Connect a supported platform');
+ expect(connectionEditorSource).not.toContain('Choose a {family.label} product');
+ expect(connectionEditorSource).not.toContain('Back to platforms');
expect(connectionEditorSource).not.toContain('NodeModal');
expect(addressProbeStepSource).toContain('Probe address');
- // The no-match branch must name the agent alternative so a user who
- // probed bare-metal Linux / Unraid / FreeBSD is not left in a
- // Platform-API-only dead end.
expect(addressProbeStepSource).toContain('install Pulse Agent instead');
+ expect(addressProbeStepSource).toContain('Choose a source type instead');
expect(addressProbeStepSource).toContain('bare-metal Linux');
expect(addressProbeStepSource).toContain('supported API-backed platform');
expect(connectionEditorStateSource).toContain('ConnectionsAPI.probe(value)');
expect(connectionEditorStateSource).toContain('export const CONNECTION_TYPE_LABELS');
- expect(connectionEditorStateSource).toContain('DEFAULT_INFRASTRUCTURE_SOURCE_ORDER');
- expect(connectionEditorStateSource).toContain('getSourcePlatformFamily');
- expect(connectionEditorStateSource).toContain(
- 'export const DEFAULT_CONNECTION_EDITOR_CATALOG_ENTRIES',
- );
- expect(connectionEditorStateSource).toContain(
- 'export function buildConnectionEditorCatalogEntries',
- );
- expect(connectionEditorStateSource).not.toContain('PROXMOX_FAMILY_TYPES');
+ expect(connectionEditorStateSource).not.toContain('DEFAULT_CONNECTION_EDITOR_CATALOG_ENTRIES');
+ expect(connectionEditorStateSource).not.toContain('buildConnectionEditorCatalogEntries');
+ expect(connectionEditorStateSource).not.toContain('getSourcePlatformFamily');
expect(infrastructureOnboardingPresentationSource).toContain('getSourcePlatformManifestEntry');
- expect(infrastructureOnboardingPresentationSource).toContain('currentAdmissionPath');
+ expect(infrastructureOnboardingPresentationSource).toContain('getInfrastructureSourcePickerGroups');
expect(infrastructureOnboardingPresentationSource).toContain(
'getInfrastructureSupportSummaryBadges',
);
diff --git a/frontend-modern/src/components/Settings/infrastructureWorkspaceModel.ts b/frontend-modern/src/components/Settings/infrastructureWorkspaceModel.ts
index 6b87d7aa4f..6ee71106f4 100644
--- a/frontend-modern/src/components/Settings/infrastructureWorkspaceModel.ts
+++ b/frontend-modern/src/components/Settings/infrastructureWorkspaceModel.ts
@@ -1,4 +1,11 @@
-export type InfrastructureAddStep = 'agent' | 'pve' | 'pbs' | 'pmg' | 'truenas' | 'vmware';
+export type InfrastructureAddStep =
+ | 'agent'
+ | 'detect'
+ | 'pve'
+ | 'pbs'
+ | 'pmg'
+ | 'truenas'
+ | 'vmware';
export type InfrastructurePanelStep = 'pick' | InfrastructureAddStep;
const INFRASTRUCTURE_BASE_PATH = '/settings/infrastructure';
@@ -19,6 +26,7 @@ export function normalizeInfrastructurePanelStep(
): InfrastructurePanelStep | null {
switch ((value || '').trim()) {
case 'pick':
+ case 'detect':
case 'agent':
case 'pve':
case 'pbs':
diff --git a/frontend-modern/src/components/Settings/settingsHeaderMeta.ts b/frontend-modern/src/components/Settings/settingsHeaderMeta.ts
index c83c9a00e9..7b04e18a59 100644
--- a/frontend-modern/src/components/Settings/settingsHeaderMeta.ts
+++ b/frontend-modern/src/components/Settings/settingsHeaderMeta.ts
@@ -9,7 +9,7 @@ import {
export const SETTINGS_HEADER_META: SettingsHeaderMetaMap = {
'infrastructure-systems': {
title: 'Infrastructure',
- description: 'Manage platform connections, Pulse Agent installs, and monitored systems.',
+ description: 'Manage infrastructure sources.',
},
'system-general': {
title: 'General',
diff --git a/frontend-modern/src/utils/__tests__/infrastructureOnboardingMetrics.test.ts b/frontend-modern/src/utils/__tests__/infrastructureOnboardingMetrics.test.ts
index 573aa7241d..4b80dcab16 100644
--- a/frontend-modern/src/utils/__tests__/infrastructureOnboardingMetrics.test.ts
+++ b/frontend-modern/src/utils/__tests__/infrastructureOnboardingMetrics.test.ts
@@ -15,11 +15,16 @@ vi.mock('@/utils/upgradeMetrics', () => ({
},
}));
-import { createInfrastructureOnboardingMetricsTracker } from '@/utils/infrastructureOnboardingMetrics';
+import {
+ clearSharedInfrastructureOnboardingMetricsTracker,
+ createInfrastructureOnboardingMetricsTracker,
+ getSharedInfrastructureOnboardingMetricsTracker,
+} from '@/utils/infrastructureOnboardingMetrics';
describe('infrastructureOnboardingMetrics', () => {
beforeEach(() => {
trackUpgradeMetricEventMock.mockClear();
+ clearSharedInfrastructureOnboardingMetricsTracker();
});
it('deduplicates flow-scoped onboarding steps inside one flow', () => {
@@ -84,4 +89,21 @@ describe('infrastructureOnboardingMetrics', () => {
expect(firstProbe.capability).toBe('no-match');
expect(secondProbe.capability).toBe('no-match');
});
+
+ it('reuses the shared tracker until the flow is cleared', () => {
+ const firstTracker = getSharedInfrastructureOnboardingMetricsTracker();
+ const secondTracker = getSharedInfrastructureOnboardingMetricsTracker();
+
+ expect(firstTracker).toBe(secondTracker);
+
+ firstTracker.recordOpened();
+ secondTracker.recordOpened();
+
+ expect(trackUpgradeMetricEventMock).toHaveBeenCalledTimes(1);
+
+ clearSharedInfrastructureOnboardingMetricsTracker();
+ const thirdTracker = getSharedInfrastructureOnboardingMetricsTracker();
+
+ expect(thirdTracker).not.toBe(firstTracker);
+ });
});
diff --git a/frontend-modern/src/utils/__tests__/infrastructureOnboardingPresentation.test.ts b/frontend-modern/src/utils/__tests__/infrastructureOnboardingPresentation.test.ts
index 13c416e616..df483f23df 100644
--- a/frontend-modern/src/utils/__tests__/infrastructureOnboardingPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/infrastructureOnboardingPresentation.test.ts
@@ -3,7 +3,9 @@ import {
getInfrastructureApiProductsByGovernanceState,
getInfrastructureAutoDetectLabels,
getInfrastructureEmptyStateDetail,
+ getInfrastructureEmptyStateSummary,
getInfrastructureOnboardingProductPresentation,
+ getInfrastructureSourcePickerGroups,
getInfrastructureSupportSummaryBadges,
} from '@/utils/infrastructureOnboardingPresentation';
@@ -25,7 +27,44 @@ describe('infrastructureOnboardingPresentation', () => {
).toEqual(['VMware vCenter']);
});
- it('derives auto-detect copy and main-page support summary from the shared helper', () => {
+ it('derives picker groups, auto-detect copy, and landing summaries from the shared helper', () => {
+ expect(getInfrastructureSourcePickerGroups()).toEqual([
+ {
+ id: 'virtualization',
+ label: 'Virtualization',
+ description: 'Hypervisors, VM inventory, and cluster health.',
+ types: ['vmware', 'pve'],
+ products: [
+ expect.objectContaining({ type: 'vmware', label: 'VMware vCenter' }),
+ expect.objectContaining({ type: 'pve', label: 'Proxmox VE' }),
+ ],
+ },
+ {
+ id: 'storage',
+ label: 'Storage',
+ description: 'Storage appliances and dataset visibility.',
+ types: ['truenas'],
+ products: [expect.objectContaining({ type: 'truenas', label: 'TrueNAS SCALE' })],
+ },
+ {
+ id: 'backup-mail',
+ label: 'Backup and Mail',
+ description: 'Backup infrastructure and mail-gateway operations.',
+ types: ['pbs', 'pmg'],
+ products: [
+ expect.objectContaining({ type: 'pbs', label: 'Proxmox Backup Server' }),
+ expect.objectContaining({ type: 'pmg', label: 'Proxmox Mail Gateway' }),
+ ],
+ },
+ {
+ id: 'host-monitoring',
+ label: 'Host monitoring',
+ description: 'Machine telemetry and local service discovery.',
+ types: ['agent'],
+ products: [expect.objectContaining({ type: 'agent', label: 'Pulse Agent' })],
+ },
+ ]);
+
expect(getInfrastructureAutoDetectLabels()).toEqual([
'VMware vCenter',
'TrueNAS SCALE',
@@ -48,7 +87,12 @@ describe('infrastructureOnboardingPresentation', () => {
installPath: ['Linux', 'FreeBSD', 'Unraid', 'Pulse Agent hosts', 'Docker', 'Kubernetes'],
});
- expect(getInfrastructureEmptyStateDetail()).toContain('Supported today: TrueNAS SCALE');
+ expect(getInfrastructureEmptyStateSummary()).toBe(
+ 'Add infrastructure sources to start monitoring your environment.',
+ );
+ expect(getInfrastructureEmptyStateDetail()).toContain('Source types available: VMware vCenter');
+ expect(getInfrastructureEmptyStateDetail()).toContain('Pulse Agent');
+ expect(getInfrastructureEmptyStateDetail()).toContain('Docker and Kubernetes are discovered');
expect(getInfrastructureEmptyStateDetail()).toContain('VMware vCenter is also available now.');
});
});
diff --git a/frontend-modern/src/utils/infrastructureOnboardingMetrics.ts b/frontend-modern/src/utils/infrastructureOnboardingMetrics.ts
index 66a65424cf..2c273b405d 100644
--- a/frontend-modern/src/utils/infrastructureOnboardingMetrics.ts
+++ b/frontend-modern/src/utils/infrastructureOnboardingMetrics.ts
@@ -7,6 +7,8 @@ export type InfrastructureOnboardingProbeOutcome = 'detected' | 'no-match' | 'er
export const INFRASTRUCTURE_ONBOARDING_METRICS_SURFACE = 'settings_infrastructure_add';
let onboardingFlowCounter = 0;
+const sharedTrackers = new Map<string, InfrastructureOnboardingMetricsTracker>();
+const SHARED_FLOW_STORAGE_KEY_PREFIX = 'pulse.infrastructure-onboarding.flow';
function createOnboardingFlowId(): string {
const uuid = globalThis.crypto?.randomUUID?.();
@@ -32,8 +34,8 @@ export interface InfrastructureOnboardingMetricsTracker {
export function createInfrastructureOnboardingMetricsTracker(
surface = INFRASTRUCTURE_ONBOARDING_METRICS_SURFACE,
+ flowId = createOnboardingFlowId(),
): InfrastructureOnboardingMetricsTracker {
- const flowId = createOnboardingFlowId();
const selectedPaths = new Set<InfrastructureOnboardingPath>();
const selectedCatalogTypes = new Set<ConnectionType>();
const openedCredentialTypes = new Set<ConnectionType>();
@@ -95,3 +97,47 @@ export function createInfrastructureOnboardingMetricsTracker(
},
};
}
+
+function sharedFlowStorageKey(surface: string): string {
+ return `${SHARED_FLOW_STORAGE_KEY_PREFIX}:${surface}`;
+}
+
+function readSharedFlowId(surface: string): string | null {
+ try {
+ return globalThis.sessionStorage?.getItem(sharedFlowStorageKey(surface)) ?? null;
+ } catch {
+ return null;
+ }
+}
+
+function writeSharedFlowId(surface: string, flowId: string): void {
+ try {
+ globalThis.sessionStorage?.setItem(sharedFlowStorageKey(surface), flowId);
+ } catch {
+ // Session storage persistence is best-effort only.
+ }
+}
+
+export function getSharedInfrastructureOnboardingMetricsTracker(
+ surface = INFRASTRUCTURE_ONBOARDING_METRICS_SURFACE,
+): InfrastructureOnboardingMetricsTracker {
+ const tracker = sharedTrackers.get(surface);
+ if (tracker) return tracker;
+
+ const flowId = readSharedFlowId(surface) ?? createOnboardingFlowId();
+ writeSharedFlowId(surface, flowId);
+ const nextTracker = createInfrastructureOnboardingMetricsTracker(surface, flowId);
+ sharedTrackers.set(surface, nextTracker);
+ return nextTracker;
+}
+
+export function clearSharedInfrastructureOnboardingMetricsTracker(
+ surface = INFRASTRUCTURE_ONBOARDING_METRICS_SURFACE,
+): void {
+ sharedTrackers.delete(surface);
+ try {
+ globalThis.sessionStorage?.removeItem(sharedFlowStorageKey(surface));
+ } catch {
+ // Session storage persistence is best-effort only.
+ }
+}
diff --git a/frontend-modern/src/utils/infrastructureOnboardingPresentation.ts b/frontend-modern/src/utils/infrastructureOnboardingPresentation.ts
index 33bd4724de..bcfeef708c 100644
--- a/frontend-modern/src/utils/infrastructureOnboardingPresentation.ts
+++ b/frontend-modern/src/utils/infrastructureOnboardingPresentation.ts
@@ -19,6 +19,13 @@ export interface InfrastructureOnboardingProductPresentation {
governanceState: PlatformGovernanceState;
}
+export interface InfrastructureSourcePickerGroupPresentation {
+ id: 'virtualization' | 'storage' | 'backup-mail' | 'host-monitoring';
+ label: string;
+ description: string;
+ types: InfrastructureOnboardingConnectionType[];
+}
+
interface BaseProductPresentation {
label: string;
bestFor: string;
@@ -104,6 +111,11 @@ const API_PRODUCT_ORDER: InfrastructureOnboardingConnectionType[] = [
'pmg',
];
+const SOURCE_MANAGER_PRODUCT_ORDER: InfrastructureOnboardingConnectionType[] = [
+ ...API_PRODUCT_ORDER,
+ 'agent',
+];
+
export const INFRASTRUCTURE_ONBOARDING_PATHS: Record<
'api' | 'agent',
InfrastructureOnboardingPathPresentation
@@ -140,9 +152,32 @@ export const INFRASTRUCTURE_AGENT_DISCOVERY_LABELS = [
export const INFRASTRUCTURE_AGENT_HOST_LABELS = ['Linux', 'FreeBSD', 'Unraid'] as const;
-export const INFRASTRUCTURE_API_FAMILY_DESCRIPTIONS: Partial<Record<string, string>> = {
- Proxmox: 'Virtualization, backup jobs, and mail-gateway health',
-};
+const SOURCE_PICKER_GROUPS: InfrastructureSourcePickerGroupPresentation[] = [
+ {
+ id: 'virtualization',
+ label: 'Virtualization',
+ description: 'Hypervisors, VM inventory, and cluster health.',
+ types: ['vmware', 'pve'],
+ },
+ {
+ id: 'storage',
+ label: 'Storage',
+ description: 'Storage appliances and dataset visibility.',
+ types: ['truenas'],
+ },
+ {
+ id: 'backup-mail',
+ label: 'Backup and Mail',
+ description: 'Backup infrastructure and mail-gateway operations.',
+ types: ['pbs', 'pmg'],
+ },
+ {
+ id: 'host-monitoring',
+ label: 'Host monitoring',
+ description: 'Machine telemetry and local service discovery.',
+ types: ['agent'],
+ },
+];
export const getInfrastructureOnboardingProductPresentation = (
type: InfrastructureOnboardingConnectionType,
@@ -156,6 +191,10 @@ export const getInfrastructureApiProductPresentations =
(): InfrastructureOnboardingProductPresentation[] =>
API_PRODUCT_ORDER.map((type) => getInfrastructureOnboardingProductPresentation(type));
+export const getInfrastructureSourceManagerProducts =
+ (): InfrastructureOnboardingProductPresentation[] =>
+ SOURCE_MANAGER_PRODUCT_ORDER.map((type) => getInfrastructureOnboardingProductPresentation(type));
+
export const getInfrastructureApiProductsByGovernanceState = (
governanceState: PlatformGovernanceState,
): InfrastructureOnboardingProductPresentation[] =>
@@ -163,6 +202,17 @@ export const getInfrastructureApiProductsByGovernanceState = (
(product) => product.governanceState === governanceState,
);
+export const getInfrastructureSourcePickerGroups =
+ (): Array<
+ InfrastructureSourcePickerGroupPresentation & {
+ products: InfrastructureOnboardingProductPresentation[];
+ }
+ > =>
+ SOURCE_PICKER_GROUPS.map((group) => ({
+ ...group,
+ products: group.types.map((type) => getInfrastructureOnboardingProductPresentation(type)),
+ }));
+
export const getInfrastructureAutoDetectLabels = (): string[] =>
getInfrastructureApiProductPresentations()
.filter((product) => product.autoDetect)
@@ -184,7 +234,7 @@ export const getInfrastructureSupportSummaryBadges = (): {
});
export const getInfrastructureEmptyStateSummary = (): string =>
- 'Connect supported platforms by API, or install Pulse Agent on a host for machine telemetry and local runtime discovery.';
+ 'Add infrastructure sources to start monitoring your environment.';
export const getInfrastructureEmptyStateDetail = (): string =>
- 'Supported today: TrueNAS SCALE, Proxmox VE, Proxmox Backup Server, Proxmox Mail Gateway, Pulse Agent hosts, Docker, and Kubernetes. VMware vCenter is also available now.';
+ 'Source types available: VMware vCenter, TrueNAS SCALE, Proxmox VE, Proxmox Backup Server, Proxmox Mail Gateway, and Pulse Agent. Docker and Kubernetes are discovered from supported agent hosts. VMware vCenter is also available now.';
diff --git a/tests/integration/tests/68-infrastructure-onboarding.spec.ts b/tests/integration/tests/68-infrastructure-onboarding.spec.ts
index 14668cf8a2..4ffd0c996b 100644
--- a/tests/integration/tests/68-infrastructure-onboarding.spec.ts
+++ b/tests/integration/tests/68-infrastructure-onboarding.spec.ts
@@ -92,18 +92,20 @@ function countUpgradeEvents(
type: string,
capability?: string,
): number {
- return events.filter((event) => {
- if (event.surface !== 'settings_infrastructure_add') {
- return false;
- }
- if (event.type !== type) {
- return false;
- }
- if (capability !== undefined && event.capability !== capability) {
- return false;
- }
- return true;
- }).length;
+ const matchingKeys = new Set<string>();
+
+ for (const event of events) {
+ if (event.surface !== 'settings_infrastructure_add') continue;
+ if (event.type !== type) continue;
+ if (capability !== undefined && event.capability !== capability) continue;
+
+ matchingKeys.add(
+ event.idempotency_key ??
+ `${event.type}:${event.surface}:${event.capability ?? ''}:${matchingKeys.size}`,
+ );
+ }
+
+ return matchingKeys.size;
}
async function scrollToBottom(page: Page): Promise<void> {
@@ -165,7 +167,7 @@ async function auditHorizontalOverflow(page: Page): Promise<OverflowAudit> {
test.describe('Infrastructure onboarding', () => {
test.setTimeout(180_000);
- test('desktop manager landing keeps connection types visible without opening onboarding state', async ({
+ test('desktop landing shows platform sections before any onboarding flow opens', async ({
page,
}, testInfo) => {
test.skip(
@@ -179,18 +181,21 @@ test.describe('Infrastructure onboarding', () => {
await page.goto('/settings/infrastructure', { waitUntil: 'domcontentloaded' });
await page.waitForURL(/\/settings\/infrastructure(?:\?.*)?$/, { timeout: 15_000 });
- await expect(page.getByText('Connection types', { exact: true })).toBeVisible();
- await expect(page.getByRole('button', { name: 'Detect from address', exact: true })).toBeVisible();
- await expect(page.getByRole('button', { name: 'Add VMware vCenter', exact: true })).toBeVisible();
- await expect(page.getByRole('button', { name: 'Add TrueNAS', exact: true })).toBeVisible();
- await expect(page.getByText('Monitored systems', { exact: true })).toBeVisible();
+ await expect(page.getByText('Infrastructure sources', { exact: true })).toBeVisible();
+ await expect(page.getByText('VMware vCenter', { exact: true })).toBeVisible();
+ await expect(page.getByText('TrueNAS SCALE', { exact: true })).toBeVisible();
+ await expect(page.getByText('Proxmox VE', { exact: true })).toBeVisible();
+ await expect(page.getByRole('button', { name: /Add TrueNAS SCALE/i })).toBeVisible();
+ await expect(page.getByRole('button', { name: /Detect from address/i })).toBeVisible();
+ await expect(page.getByText('Monitored systems', { exact: true })).toHaveCount(0);
+ await expect(page.getByText('Connection types', { exact: true })).toHaveCount(0);
await expect
.poll(() => countUpgradeEvents(metricEvents, 'infrastructure_onboarding_opened'))
.toBe(0);
});
- test('desktop direct source add opens a manager-backed dialog and records catalog-driven onboarding', async ({
+ test('desktop per-platform add opens the matching modal and records direct type onboarding', async ({
page,
}, testInfo) => {
test.skip(
@@ -204,14 +209,17 @@ test.describe('Infrastructure onboarding', () => {
await page.goto('/settings/infrastructure', { waitUntil: 'domcontentloaded' });
await page.waitForURL(/\/settings\/infrastructure(?:\?.*)?$/, { timeout: 15_000 });
- await page.getByRole('button', { name: 'Add TrueNAS', exact: true }).click();
+ await page.getByRole('button', { name: /Add TrueNAS SCALE/i }).click();
await page.waitForURL(/\/settings\/infrastructure\?add=truenas$/, { timeout: 15_000 });
- await expect(page.getByText('Connection types', { exact: true })).toBeVisible();
+ await expect(page.getByText('Infrastructure sources', { exact: true })).toBeVisible();
await expect(page.getByRole('dialog')).toBeVisible();
- await expect(page.getByText('Add TrueNAS SCALE', { exact: true })).toBeVisible();
- await expect(page.getByRole('button', { name: 'Close add infrastructure dialog', exact: true })).toBeVisible();
- await expect(page.getByRole('button', { name: /Back to catalog/i })).toHaveCount(0);
+ await expect(
+ page.getByRole('dialog').getByRole('heading', { name: 'Add TrueNAS SCALE', exact: true }),
+ ).toBeVisible();
+ await expect(
+ page.getByRole('button', { name: 'Close add infrastructure dialog', exact: true }),
+ ).toBeVisible();
await expect
.poll(() => countUpgradeEvents(metricEvents, 'infrastructure_onboarding_opened'))
@@ -233,7 +241,7 @@ test.describe('Infrastructure onboarding', () => {
.toBe(1);
});
- test('desktop no-match probe records the agent fallback path and credential handoff', async ({
+ test('desktop detect utility records no-match agent fallback from the landing header action', async ({
page,
}, testInfo) => {
test.skip(
@@ -263,8 +271,8 @@ test.describe('Infrastructure onboarding', () => {
await page.goto('/settings/infrastructure', { waitUntil: 'domcontentloaded' });
await page.waitForURL(/\/settings\/infrastructure(?:\?.*)?$/, { timeout: 15_000 });
- await page.getByRole('button', { name: 'Detect from address', exact: true }).click();
- await page.waitForURL(/\/settings\/infrastructure\?add=pick$/, { timeout: 15_000 });
+ await page.getByRole('button', { name: /Detect from address/i }).click();
+ await page.waitForURL(/\/settings\/infrastructure\?add=detect$/, { timeout: 15_000 });
await page.getByLabel('Address').fill('baremetal.lab');
await page.getByRole('button', { name: 'Probe address', exact: true }).click();
@@ -283,7 +291,7 @@ test.describe('Infrastructure onboarding', () => {
.toBe(1);
await page.getByRole('button', { name: 'install Pulse Agent instead', exact: true }).click();
- await expect(page.getByRole('button', { name: /Back to catalog/i })).toBeVisible();
+ await expect(page.getByRole('button', { name: /Back to detect/i })).toBeVisible();
await expect
.poll(() =>
@@ -297,7 +305,7 @@ test.describe('Infrastructure onboarding', () => {
.toBe(1);
});
- test('mobile add flow keeps the onboarding surface inside the viewport', async ({
+ test('mobile landing and grouped platform tables stay inside the viewport', async ({
page,
}, testInfo) => {
test.skip(
@@ -309,8 +317,9 @@ test.describe('Infrastructure onboarding', () => {
await page.goto('/settings/infrastructure', { waitUntil: 'domcontentloaded' });
await page.waitForURL(/\/settings\/infrastructure(?:\?.*)?$/, { timeout: 15_000 });
- await expect(page.getByText('Connection types', { exact: true })).toBeVisible();
- await expect(page.getByRole('button', { name: 'Add TrueNAS', exact: true })).toBeVisible();
+ await expect(page.getByText('Infrastructure sources', { exact: true })).toBeVisible();
+ await expect(page.getByText('Pulse Agent', { exact: true })).toBeVisible();
+ await expect(page.getByRole('button', { name: /Add Pulse Agent/i })).toBeVisible();
await scrollToBottom(page);
const audit = await auditHorizontalOverflow(page);