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.

Route empty dashboard state to install

rcourtman4bec0bde511a
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index adb2b6a5a5..2fbfb0fe0b 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -177,6 +177,12 @@ work extends shared components instead of creating new local variants.
path to `/settings/infrastructure/install`, not to reporting/control, so
the shell does not send first-time operators to the wrong infrastructure
subview by default.
+9. Keep dashboard onboarding copy on the shared presentation owner in
+ `frontend-modern/src/utils/dashboardEmptyStatePresentation.ts`. Both the
+ infrastructure empty state and the dashboard route's no-resources state
+ must name the canonical install workspace explicitly and expose the same
+ first-host next step instead of falling back to passive “nothing here yet”
+ wording.
## Current State
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 997ecbfc29..6b8deac9fa 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -104,6 +104,11 @@ querying, and the operator-facing storage health presentation layer.
4. Preserve the dependency split: API payload ownership stays in `api-contracts`, settings shell ownership stays in `frontend-primitives`, and canonical resource truth stays in `unified-resources`
5. Keep recovery history table width budgeting derived from the canonical column specs in `frontend-modern/src/utils/recoveryTablePresentation.ts`, not from raw visible-column counts, so normalized subject labels and optional column sets cannot drift the right-edge badges and controls off-screen
6. Keep at least one browser-level desktop recovery proof in the governed `recovery-product-surface` policy so right-edge column visibility and wrapper-fit regressions are caught at rendered layout time instead of only through unit-level width math
+7. Keep the dashboard route's no-resources state on an explicit first-session
+ handoff. `frontend-modern/src/pages/Dashboard.tsx` may stay storage/recovery-
+ owned for dashboard composition, but when no resources have reported yet it
+ must route operators to `/settings/infrastructure/install` instead of
+ leaving the dashboard as a passive dead end.
## Current State
diff --git a/frontend-modern/src/pages/Dashboard.tsx b/frontend-modern/src/pages/Dashboard.tsx
index 34d4e1826d..fe2028fb41 100644
--- a/frontend-modern/src/pages/Dashboard.tsx
+++ b/frontend-modern/src/pages/Dashboard.tsx
@@ -8,7 +8,9 @@ import {
createSignal,
onCleanup,
} from 'solid-js';
+import { useNavigate } from '@solidjs/router';
import { useWebSocket } from '@/App';
+import { buildInfrastructureWorkspacePath } from '@/components/Settings/infrastructureWorkspaceModel';
import { useUnifiedResources } from '@/hooks/useUnifiedResources';
import { useDashboardOverview } from '@/hooks/useDashboardOverview';
import { useDashboardTrends } from '@/hooks/useDashboardTrends';
@@ -34,6 +36,7 @@ import { DashboardRecoveryStatusPanel } from '@/components/Recovery/DashboardRec
import { DashboardStoragePanel } from '@/components/Storage/DashboardStoragePanel';
import type { DashboardWidgetDef, DashboardWidgetId } from '@/features/dashboardOverview/dashboardWidgets';
export default function Dashboard() {
+ const navigate = useNavigate();
const { connected, reconnecting, reconnect, activeAlerts } = useWebSocket();
// REST-backed resources: instant first paint, no WebSocket wait.
@@ -260,6 +263,13 @@ export default function Dashboard() {
{dashboardNoResourcesState().title}
</h2>
<p class="mt-2 text-sm text-muted">{dashboardNoResourcesState().description}</p>
+ <button
+ type="button"
+ onClick={() => navigate(buildInfrastructureWorkspacePath('install'))}
+ class="mt-4 inline-flex items-center rounded-md border border-transparent bg-blue-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-blue-700"
+ >
+ {dashboardNoResourcesState().actionLabel}
+ </button>
</section>
</Match>
diff --git a/frontend-modern/src/pages/__tests__/DashboardPage.test.tsx b/frontend-modern/src/pages/__tests__/DashboardPage.test.tsx
index 916f77b6bf..3002f82636 100644
--- a/frontend-modern/src/pages/__tests__/DashboardPage.test.tsx
+++ b/frontend-modern/src/pages/__tests__/DashboardPage.test.tsx
@@ -1,4 +1,4 @@
-import { render, screen } from '@solidjs/testing-library';
+import { fireEvent, render, screen } from '@solidjs/testing-library';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import type { DashboardOverview } from '@/hooks/useDashboardOverview';
import type { DashboardRecoverySummary } from '@/hooks/useDashboardRecovery';
@@ -11,6 +11,7 @@ let unifiedError: unknown = undefined;
let wsConnected = true;
let wsReconnecting = false;
const reconnectSpy = vi.fn();
+const navigateSpy = vi.hoisted(() => vi.fn());
const recoverySummaryMock: DashboardRecoverySummary = {
totalProtected: 3,
byOutcome: { success: 2, failed: 1 },
@@ -64,6 +65,14 @@ vi.mock('@/App', () => ({
}),
}));
+vi.mock('@solidjs/router', async () => {
+ const actual = await vi.importActual<typeof import('@solidjs/router')>('@solidjs/router');
+ return {
+ ...actual,
+ useNavigate: () => navigateSpy,
+ };
+});
+
vi.mock('@/hooks/useUnifiedResources', () => ({
useUnifiedResources: () => ({
resources: () => unifiedResources,
@@ -115,6 +124,7 @@ describe('Dashboard page module contract', () => {
wsConnected = true;
wsReconnecting = false;
reconnectSpy.mockReset();
+ navigateSpy.mockReset();
overviewMock.storage.total = 0;
overviewMock.storage.totalCapacity = 0;
overviewMock.storage.totalUsed = 0;
@@ -156,6 +166,21 @@ describe('Dashboard page module contract', () => {
expect(screen.getAllByTestId('dashboard-skeleton-block').length).toBeGreaterThan(0);
});
+ it('routes the empty dashboard state to infrastructure install', () => {
+ render(() => <DashboardPage />);
+
+ expect(screen.getByRole('heading', { name: 'No resources yet' })).toBeInTheDocument();
+ expect(
+ screen.getByText(
+ 'Start by opening Settings → Infrastructure → Install on a host and connecting the first system you want Pulse to monitor. Your dashboard overview will appear here once that system starts reporting.',
+ ),
+ ).toBeInTheDocument();
+
+ fireEvent.click(screen.getByRole('button', { name: 'Open infrastructure install' }));
+
+ expect(navigateSpy).toHaveBeenCalledWith('/settings/infrastructure/install');
+ });
+
it('renders the governed storage and recovery dashboard panels', () => {
unifiedResources = [{ id: 'resource-1' }];
overviewMock.storage.total = 4;
diff --git a/frontend-modern/src/utils/__tests__/dashboardEmptyStatePresentation.test.ts b/frontend-modern/src/utils/__tests__/dashboardEmptyStatePresentation.test.ts
index 933a8accc9..914b81eb1d 100644
--- a/frontend-modern/src/utils/__tests__/dashboardEmptyStatePresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/dashboardEmptyStatePresentation.test.ts
@@ -79,7 +79,8 @@ describe('dashboardEmptyStatePresentation', () => {
expect(getDashboardNoResourcesState()).toEqual({
title: 'No resources yet',
description:
- 'Once connected platforms report resources, your dashboard overview will appear here.',
+ 'Start by opening Settings → Infrastructure → Install on a host and connecting the first system you want Pulse to monitor. Your dashboard overview will appear here once that system starts reporting.',
+ actionLabel: 'Open infrastructure install',
});
});
});
diff --git a/frontend-modern/src/utils/dashboardEmptyStatePresentation.ts b/frontend-modern/src/utils/dashboardEmptyStatePresentation.ts
index 493182296b..e109a4cda8 100644
--- a/frontend-modern/src/utils/dashboardEmptyStatePresentation.ts
+++ b/frontend-modern/src/utils/dashboardEmptyStatePresentation.ts
@@ -58,6 +58,8 @@ export function getDashboardUnavailableState() {
export function getDashboardNoResourcesState() {
return {
title: 'No resources yet',
- description: 'Once connected platforms report resources, your dashboard overview will appear here.',
+ description:
+ 'Start by opening Settings → Infrastructure → Install on a host and connecting the first system you want Pulse to monitor. Your dashboard overview will appear here once that system starts reporting.',
+ actionLabel: 'Open infrastructure install',
} as const;
}