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.

infra: foreground the agent on the Add landing

rcourtman6f60732f9244
diff --git a/frontend-modern/src/components/Settings/ConnectionEditor/ConnectionEditor.tsx b/frontend-modern/src/components/Settings/ConnectionEditor/ConnectionEditor.tsx
index 096f829ac2..05041f067d 100644
--- a/frontend-modern/src/components/Settings/ConnectionEditor/ConnectionEditor.tsx
+++ b/frontend-modern/src/components/Settings/ConnectionEditor/ConnectionEditor.tsx
@@ -99,44 +99,6 @@ export const ConnectionEditor: Component<ConnectionEditorProps> = (props) => {
onInstallAgent={() => chooseManualType('agent')}
/>
- <section class="space-y-3">
- <div class="flex items-center gap-3 text-xs font-semibold uppercase tracking-wide text-muted">
- <span class="h-px flex-1 bg-border" aria-hidden="true" />
- Or connect a remote platform API
- <span class="h-px flex-1 bg-border" aria-hidden="true" />
- </div>
-
- <div class="grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3">
- <For each={platformOptions()}>
- {(type) => {
- const meta = PLATFORM_TILE_META[type];
- const Icon = meta?.icon ?? Server;
- const label = CONNECTION_TYPE_LABELS[type] ?? type;
- return (
- <button
- type="button"
- onClick={() => chooseManualType(type)}
- 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">{label}</div>
- </div>
- <Show when={meta?.description}>
- <div class="text-xs text-muted">{meta!.description}</div>
- </Show>
- </button>
- );
- }}
- </For>
- </div>
- </section>
-
<section class="space-y-3">
<div class="flex items-center gap-3 text-xs font-semibold uppercase tracking-wide text-muted">
<span class="h-px flex-1 bg-border" aria-hidden="true" />
@@ -147,7 +109,7 @@ export const ConnectionEditor: Component<ConnectionEditorProps> = (props) => {
<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"
+ class="group flex w-full items-start gap-4 rounded-lg border-2 border-blue-300 bg-blue-50/40 p-4 text-left transition-colors hover:border-blue-500 hover:bg-blue-50 dark:border-blue-800 dark:bg-blue-950/20 dark:hover:border-blue-600 dark:hover:bg-blue-950/40"
>
<div
aria-hidden="true"
@@ -156,16 +118,19 @@ export const ConnectionEditor: Component<ConnectionEditorProps> = (props) => {
<Cpu class="h-5 w-5" />
</div>
<div class="flex-1 space-y-1.5">
- <div class="flex items-center gap-2">
+ <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-blue-200 bg-blue-50 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-blue-700 dark:border-blue-900 dark:bg-blue-950/60 dark:text-blue-300">
+ <div class="rounded-full border border-blue-300 bg-blue-100 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-blue-800 dark:border-blue-700 dark:bg-blue-900/60 dark:text-blue-200">
+ Recommended
+ </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">
<span class="font-medium text-base-content">On a Proxmox host, this is the
fastest path.</span> The agent creates the PVE / PBS API token itself and
- auto-registers the node — no address or credentials to paste above.
+ auto-registers the node — no address or credentials to paste.
</div>
<div class="text-xs text-muted">
It also reports CPU temperature, disk SMART, systemd services, and network
@@ -176,12 +141,53 @@ export const ConnectionEditor: Component<ConnectionEditorProps> = (props) => {
</div>
<div
aria-hidden="true"
- class="flex-none self-center text-muted transition-colors group-hover:text-blue-600 dark:group-hover:text-blue-400"
+ class="flex-none self-center text-blue-600 transition-colors group-hover:text-blue-700 dark:text-blue-400 dark:group-hover:text-blue-300"
>
<ArrowRight class="h-4 w-4" />
</div>
</button>
</section>
+
+ <section class="space-y-3">
+ <div class="flex items-center gap-3 text-xs font-semibold uppercase tracking-wide text-muted">
+ <span class="h-px flex-1 bg-border" aria-hidden="true" />
+ Or connect a platform API directly
+ <span class="h-px flex-1 bg-border" aria-hidden="true" />
+ </div>
+ <p class="text-xs text-muted">
+ For VMware, TrueNAS, PMG, or a remote Proxmox you can't install the agent on.
+ </p>
+
+ <div class="grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3">
+ <For each={platformOptions()}>
+ {(type) => {
+ const meta = PLATFORM_TILE_META[type];
+ const Icon = meta?.icon ?? Server;
+ const label = CONNECTION_TYPE_LABELS[type] ?? type;
+ return (
+ <button
+ type="button"
+ onClick={() => chooseManualType(type)}
+ 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">{label}</div>
+ </div>
+ <Show when={meta?.description}>
+ <div class="text-xs text-muted">{meta!.description}</div>
+ </Show>
+ </button>
+ );
+ }}
+ </For>
+ </div>
+ </section>
</div>
}
>
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
index f74a7404f4..7b004c2d84 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
@@ -82,11 +82,19 @@ describe('settings architecture guardrails', () => {
expect(connectionEditorSource).not.toContain("'agent'] =");
expect(connectionEditorSource).toContain('<AddressProbeStep');
expect(connectionEditorSource).toContain('Or install the agent on the host');
- // Honest framing: the agent auto-registers PVE/PBS when installed on a
- // Proxmox node, so the card must surface that shortcut rather than
- // pretending the agent is only for host metrics.
+ expect(connectionEditorSource).toContain('Or connect a platform API directly');
+ // The agent card sits above the platform grid and is marked Recommended
+ // because it auto-registers PVE/PBS and covers the host-telemetry path
+ // the platform APIs can't reach. Guarding the ordering here prevents a
+ // drift back to "agent as a fifth tile."
+ const agentSectionIdx = connectionEditorSource.indexOf('Or install the agent on the host');
+ const platformSectionIdx = connectionEditorSource.indexOf('Or connect a platform API directly');
+ expect(agentSectionIdx).toBeGreaterThan(-1);
+ expect(platformSectionIdx).toBeGreaterThan(-1);
+ expect(agentSectionIdx).toBeLessThan(platformSectionIdx);
expect(connectionEditorSource).toContain('On a Proxmox host, this is the');
expect(connectionEditorSource).toContain('auto-registers the node');
+ expect(connectionEditorSource).toContain('Recommended');
// The agent install path is a first-class ledger-header action, not a
// subtext offramp inside the editor — make sure it doesn't drift back.
expect(connectionEditorSource).not.toContain('Install the Unified Agent on a host');