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.

Move dashboard storage recovery widgets into lane owners

rcourtman2d38c00c9719
diff --git a/docs/release-control/v6/internal/subsystems/registry.json b/docs/release-control/v6/internal/subsystems/registry.json
index 68eb50fc87..af203a911d 100644
--- a/docs/release-control/v6/internal/subsystems/registry.json
+++ b/docs/release-control/v6/internal/subsystems/registry.json
@@ -2887,6 +2887,8 @@
"internal/recovery/"
],
"owned_files": [
+ "frontend-modern/src/components/Recovery/DashboardRecoveryStatusPanel.tsx",
+ "frontend-modern/src/components/Storage/DashboardStoragePanel.tsx",
"frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts",
"frontend-modern/src/hooks/useDashboardRecovery.ts",
"frontend-modern/src/hooks/useRecoveryPoints.ts",
@@ -2894,8 +2896,6 @@
"frontend-modern/src/hooks/useRecoveryPointsSeries.ts",
"frontend-modern/src/hooks/useRecoveryRollups.ts",
"frontend-modern/src/pages/Dashboard.tsx",
- "frontend-modern/src/pages/DashboardPanels/RecoveryStatusPanel.tsx",
- "frontend-modern/src/pages/DashboardPanels/StoragePanel.tsx",
"frontend-modern/src/pages/RecoveryRoute.tsx",
"frontend-modern/src/pages/Storage.tsx",
"frontend-modern/src/types/recovery.ts",
@@ -2967,12 +2967,12 @@
"frontend-modern/src/components/Recovery/"
],
"match_files": [
+ "frontend-modern/src/components/Recovery/DashboardRecoveryStatusPanel.tsx",
"frontend-modern/src/hooks/useDashboardRecovery.ts",
"frontend-modern/src/hooks/useRecoveryPoints.ts",
"frontend-modern/src/hooks/useRecoveryPointsFacets.ts",
"frontend-modern/src/hooks/useRecoveryPointsSeries.ts",
"frontend-modern/src/hooks/useRecoveryRollups.ts",
- "frontend-modern/src/pages/DashboardPanels/RecoveryStatusPanel.tsx",
"frontend-modern/src/pages/RecoveryRoute.tsx",
"frontend-modern/src/types/recovery.ts",
"frontend-modern/src/utils/dashboardRecoveryPresentation.ts",
@@ -3008,12 +3008,13 @@
"frontend-modern/src/features/storageBackups/"
],
"match_files": [
- "frontend-modern/src/pages/DashboardPanels/StoragePanel.tsx",
+ "frontend-modern/src/components/Storage/DashboardStoragePanel.tsx",
"frontend-modern/src/pages/Storage.tsx"
],
"allow_same_subsystem_tests": false,
"test_prefixes": [],
"exact_files": [
+ "frontend-modern/src/components/Storage/__tests__/DashboardStoragePanel.test.tsx",
"frontend-modern/src/components/Storage/__tests__/DiskList.test.tsx",
"frontend-modern/src/components/Storage/__tests__/Storage.test.tsx",
"frontend-modern/src/components/Storage/__tests__/StorageControls.test.tsx",
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 1fc40b4431..0c53bca9b7 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -41,8 +41,8 @@ querying, and the operator-facing storage health presentation layer.
16. `frontend-modern/src/pages/RecoveryRoute.tsx`
17. `frontend-modern/src/pages/Dashboard.tsx`
18. `frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts`
-19. `frontend-modern/src/pages/DashboardPanels/RecoveryStatusPanel.tsx`
-20. `frontend-modern/src/pages/DashboardPanels/StoragePanel.tsx`
+19. `frontend-modern/src/components/Recovery/DashboardRecoveryStatusPanel.tsx`
+20. `frontend-modern/src/components/Storage/DashboardStoragePanel.tsx`
21. `frontend-modern/src/types/recovery.ts`
22. `frontend-modern/src/utils/recoveryTablePresentation.ts`
23. `frontend-modern/src/utils/textPresentation.ts`
@@ -222,14 +222,14 @@ That same rule applies to the dashboard recovery entry points too:
`frontend-modern/src/hooks/useDashboardRecovery.ts`,
`frontend-modern/src/pages/Dashboard.tsx`,
`frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts`,
-`frontend-modern/src/pages/DashboardPanels/RecoveryStatusPanel.tsx`, and
+`frontend-modern/src/components/Recovery/DashboardRecoveryStatusPanel.tsx`, and
`frontend-modern/src/utils/dashboardRecoveryPresentation.ts` must stay on
explicit direct dashboard/recovery proof routing instead of inheriting
coverage only through the full recovery route or broader dashboard shells.
The storage dashboard entry point must be treated the same way on the storage
side: `frontend-modern/src/pages/Dashboard.tsx`,
`frontend-modern/src/features/dashboardOverview/dashboardWidgets.ts`, and
-`frontend-modern/src/pages/DashboardPanels/StoragePanel.tsx` must stay on
+`frontend-modern/src/components/Storage/DashboardStoragePanel.tsx` must stay on
explicit direct dashboard/storage proof routing instead of borrowing release-
control coverage only from the broader storage page and model surfaces.
That route shell now also composes the recent-alerts widget directly from the
diff --git a/frontend-modern/src/pages/DashboardPanels/RecoveryStatusPanel.tsx b/frontend-modern/src/components/Recovery/DashboardRecoveryStatusPanel.tsx
similarity index 94%
rename from frontend-modern/src/pages/DashboardPanels/RecoveryStatusPanel.tsx
rename to frontend-modern/src/components/Recovery/DashboardRecoveryStatusPanel.tsx
index 5638d1e374..4e95ae21a8 100644
--- a/frontend-modern/src/pages/DashboardPanels/RecoveryStatusPanel.tsx
+++ b/frontend-modern/src/components/Recovery/DashboardRecoveryStatusPanel.tsx
@@ -12,11 +12,11 @@ import {
} from '@/utils/dashboardRecoveryPresentation';
import type { DashboardRecoverySummary } from '@/hooks/useDashboardRecovery';
-interface RecoveryStatusPanelProps {
+interface DashboardRecoveryStatusPanelProps {
recovery: DashboardRecoverySummary;
}
-export function RecoveryStatusPanel(props: RecoveryStatusPanelProps) {
+export function DashboardRecoveryStatusPanel(props: DashboardRecoveryStatusPanelProps) {
const latestAgeMs = createMemo(() => {
const ts = props.recovery.latestEventTimestamp;
if (typeof ts !== 'number' || !Number.isFinite(ts)) return null;
@@ -86,4 +86,4 @@ export function RecoveryStatusPanel(props: RecoveryStatusPanelProps) {
);
}
-export default RecoveryStatusPanel;
+export default DashboardRecoveryStatusPanel;
diff --git a/frontend-modern/src/components/Recovery/__tests__/DashboardRecoveryStatusPanel.test.tsx b/frontend-modern/src/components/Recovery/__tests__/DashboardRecoveryStatusPanel.test.tsx
new file mode 100644
index 0000000000..dbd67d5a20
--- /dev/null
+++ b/frontend-modern/src/components/Recovery/__tests__/DashboardRecoveryStatusPanel.test.tsx
@@ -0,0 +1,37 @@
+import { render, screen } from '@solidjs/testing-library';
+import { describe, expect, it } from 'vitest';
+import { DashboardRecoveryStatusPanel } from '@/components/Recovery/DashboardRecoveryStatusPanel';
+import type { DashboardRecoverySummary } from '@/hooks/useDashboardRecovery';
+
+describe('DashboardRecoveryStatusPanel', () => {
+ it('renders the empty state when no recovery data exists', () => {
+ const recovery: DashboardRecoverySummary = {
+ totalProtected: 0,
+ byOutcome: {},
+ latestEventTimestamp: null,
+ hasData: false,
+ };
+
+ render(() => <DashboardRecoveryStatusPanel recovery={recovery} />);
+
+ expect(screen.getByText('No recovery data available')).toBeInTheDocument();
+ });
+
+ it('renders summary counts and stale messaging for old recovery activity', () => {
+ const recovery: DashboardRecoverySummary = {
+ totalProtected: 3,
+ byOutcome: { success: 2, failed: 1 },
+ latestEventTimestamp: Date.now() - 25 * 60 * 60_000,
+ hasData: true,
+ };
+
+ render(() => <DashboardRecoveryStatusPanel recovery={recovery} />);
+
+ expect(screen.getByRole('heading', { name: 'Recovery Status' })).toBeInTheDocument();
+ expect(screen.getByText('3')).toBeInTheDocument();
+ expect(screen.getByText('2')).toBeInTheDocument();
+ expect(screen.getByText('success')).toBeInTheDocument();
+ expect(screen.getByText('failed')).toBeInTheDocument();
+ expect(screen.getByText('Last recovery point over 24 hours ago')).toBeInTheDocument();
+ });
+});
diff --git a/frontend-modern/src/pages/DashboardPanels/StoragePanel.tsx b/frontend-modern/src/components/Storage/DashboardStoragePanel.tsx
similarity index 95%
rename from frontend-modern/src/pages/DashboardPanels/StoragePanel.tsx
rename to frontend-modern/src/components/Storage/DashboardStoragePanel.tsx
index 0261c853f5..06fa6d9626 100644
--- a/frontend-modern/src/pages/DashboardPanels/StoragePanel.tsx
+++ b/frontend-modern/src/components/Storage/DashboardStoragePanel.tsx
@@ -16,13 +16,13 @@ import {
getDashboardStorageIssueBadges,
} from '@/utils/dashboardStoragePresentation';
-interface StoragePanelProps {
+interface DashboardStoragePanelProps {
storage: DashboardOverview['storage'];
storageTrend: TrendData | null;
loading: boolean;
}
-export function StoragePanel(props: StoragePanelProps) {
+export function DashboardStoragePanel(props: DashboardStoragePanelProps) {
const capacityPercent = () =>
computeDashboardStorageCapacityPercent(props.storage.totalUsed, props.storage.totalCapacity);
const hasTrend = () => !!props.storageTrend && props.storageTrend.points.length >= 2;
@@ -83,4 +83,4 @@ export function StoragePanel(props: StoragePanelProps) {
);
}
-export default StoragePanel;
+export default DashboardStoragePanel;
diff --git a/frontend-modern/src/components/Storage/__tests__/DashboardStoragePanel.test.tsx b/frontend-modern/src/components/Storage/__tests__/DashboardStoragePanel.test.tsx
new file mode 100644
index 0000000000..f1267017f6
--- /dev/null
+++ b/frontend-modern/src/components/Storage/__tests__/DashboardStoragePanel.test.tsx
@@ -0,0 +1,49 @@
+import { render, screen } from '@solidjs/testing-library';
+import { describe, expect, it } from 'vitest';
+import { DashboardStoragePanel } from '@/components/Storage/DashboardStoragePanel';
+import type { DashboardOverview } from '@/hooks/useDashboardOverview';
+import type { TrendData } from '@/hooks/useDashboardTrends';
+
+describe('DashboardStoragePanel', () => {
+ it('renders the empty state when no storage resources exist', () => {
+ const storage: DashboardOverview['storage'] = {
+ total: 0,
+ totalCapacity: 0,
+ totalUsed: 0,
+ warningCount: 0,
+ criticalCount: 0,
+ };
+
+ render(() => <DashboardStoragePanel storage={storage} storageTrend={null} loading={false} />);
+
+ expect(screen.getByText('No storage resources')).toBeInTheDocument();
+ });
+
+ it('renders storage usage, issue badges, and the 24h delta', () => {
+ const storage: DashboardOverview['storage'] = {
+ total: 2,
+ totalCapacity: 4000,
+ totalUsed: 2000,
+ warningCount: 1,
+ criticalCount: 1,
+ };
+ const storageTrend: TrendData = {
+ points: [
+ { timestamp: 1, value: 40 },
+ { timestamp: 2, value: 50 },
+ ],
+ delta: 10,
+ currentValue: 50,
+ };
+
+ render(() => (
+ <DashboardStoragePanel storage={storage} storageTrend={storageTrend} loading={false} />
+ ));
+
+ expect(screen.getByRole('heading', { name: /Storage/i })).toBeInTheDocument();
+ expect(screen.getByText('50%')).toBeInTheDocument();
+ expect(screen.getByText('1 warnings')).toBeInTheDocument();
+ expect(screen.getByText('1 critical')).toBeInTheDocument();
+ expect(screen.getByText('24h: +10.0%')).toBeInTheDocument();
+ });
+});
diff --git a/frontend-modern/src/pages/Dashboard.tsx b/frontend-modern/src/pages/Dashboard.tsx
index fbaa247c0c..39b3b4dfe5 100644
--- a/frontend-modern/src/pages/Dashboard.tsx
+++ b/frontend-modern/src/pages/Dashboard.tsx
@@ -30,8 +30,9 @@ import {
TrendCharts,
} from '@/features/dashboardOverview';
import { RecentAlertsPanel } from '@/components/Alerts/RecentAlertsPanel';
+import { DashboardRecoveryStatusPanel } from '@/components/Recovery/DashboardRecoveryStatusPanel';
+import { DashboardStoragePanel } from '@/components/Storage/DashboardStoragePanel';
import type { DashboardWidgetDef, DashboardWidgetId } from '@/features/dashboardOverview/dashboardWidgets';
-import { RecoveryStatusPanel, StoragePanel } from './DashboardPanels';
export default function Dashboard() {
const { connected, reconnecting, reconnect, activeAlerts } = useWebSocket();
@@ -129,10 +130,10 @@ export default function Dashboard() {
/>
);
case 'recovery':
- return <RecoveryStatusPanel recovery={recoverySummary()} />;
+ return <DashboardRecoveryStatusPanel recovery={recoverySummary()} />;
case 'storage':
return (
- <StoragePanel
+ <DashboardStoragePanel
storage={overview().storage}
storageTrend={trends().storage.capacity}
loading={trends().loading}
diff --git a/frontend-modern/src/pages/DashboardPanels/index.ts b/frontend-modern/src/pages/DashboardPanels/index.ts
deleted file mode 100644
index 8d2e272442..0000000000
--- a/frontend-modern/src/pages/DashboardPanels/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export { RecoveryStatusPanel } from './RecoveryStatusPanel';
-export { StoragePanel } from './StoragePanel';
diff --git a/frontend-modern/src/pages/__tests__/DashboardPage.test.tsx b/frontend-modern/src/pages/__tests__/DashboardPage.test.tsx
index f80aaead94..db283fe660 100644
--- a/frontend-modern/src/pages/__tests__/DashboardPage.test.tsx
+++ b/frontend-modern/src/pages/__tests__/DashboardPage.test.tsx
@@ -136,6 +136,13 @@ describe('Dashboard page module contract', () => {
);
});
+ it('routes storage and recovery dashboard widgets through storage-recovery owners', () => {
+ expect(dashboardPageSource).toContain(
+ "from '@/components/Recovery/DashboardRecoveryStatusPanel'",
+ );
+ expect(dashboardPageSource).toContain("from '@/components/Storage/DashboardStoragePanel'");
+ });
+
it('renders loading skeleton blocks when resources are loading', () => {
unifiedLoading = true;
diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
index 110e1763c7..27c667f973 100644
--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
@@ -108,8 +108,8 @@ import problemResourcesTableSource from '@/features/dashboardOverview/ProblemRes
import problemResourcePresentationSource from '@/utils/problemResourcePresentation.ts?raw';
import kpiStripSource from '@/features/dashboardOverview/KPIStrip.tsx?raw';
import recentAlertsPanelSource from '@/components/Alerts/RecentAlertsPanel.tsx?raw';
-import storagePanelSource from '@/pages/DashboardPanels/StoragePanel.tsx?raw';
-import recoveryStatusPanelSource from '@/pages/DashboardPanels/RecoveryStatusPanel.tsx?raw';
+import storagePanelSource from '@/components/Storage/DashboardStoragePanel.tsx?raw';
+import recoveryStatusPanelSource from '@/components/Recovery/DashboardRecoveryStatusPanel.tsx?raw';
import guestRowSource from '@/components/Dashboard/GuestRow.tsx?raw';
import guestRowCellsSource from '@/components/Dashboard/GuestRowCells.tsx?raw';
import guestRowModelSource from '@/components/Dashboard/guestRowModel.tsx?raw';
diff --git a/scripts/release_control/canonical_completion_guard_test.py b/scripts/release_control/canonical_completion_guard_test.py
index 41185fb368..4d1dfe19cf 100644
--- a/scripts/release_control/canonical_completion_guard_test.py
+++ b/scripts/release_control/canonical_completion_guard_test.py
@@ -910,7 +910,7 @@ class CanonicalCompletionGuardTest(unittest.TestCase):
def test_recovery_status_panel_change_requires_storage_recovery_contract(self):
required = infer_impacted_subsystems(
- ["frontend-modern/src/pages/DashboardPanels/RecoveryStatusPanel.tsx"]
+ ["frontend-modern/src/components/Recovery/DashboardRecoveryStatusPanel.tsx"]
)
self.assertEqual(set(required), {"storage-recovery"})
recovery = required["storage-recovery"]
@@ -920,7 +920,7 @@ class CanonicalCompletionGuardTest(unittest.TestCase):
)
self.assertEqual(
recovery["touched_runtime_files"],
- ["frontend-modern/src/pages/DashboardPanels/RecoveryStatusPanel.tsx"],
+ ["frontend-modern/src/components/Recovery/DashboardRecoveryStatusPanel.tsx"],
)
def test_dashboard_recovery_presentation_change_requires_storage_recovery_contract(self):
@@ -940,7 +940,7 @@ class CanonicalCompletionGuardTest(unittest.TestCase):
def test_storage_panel_change_requires_storage_recovery_contract(self):
required = infer_impacted_subsystems(
- ["frontend-modern/src/pages/DashboardPanels/StoragePanel.tsx"]
+ ["frontend-modern/src/components/Storage/DashboardStoragePanel.tsx"]
)
self.assertEqual(set(required), {"storage-recovery"})
@@ -951,7 +951,7 @@ class CanonicalCompletionGuardTest(unittest.TestCase):
)
self.assertEqual(
recovery["touched_runtime_files"],
- ["frontend-modern/src/pages/DashboardPanels/StoragePanel.tsx"],
+ ["frontend-modern/src/components/Storage/DashboardStoragePanel.tsx"],
)
self.assertEqual(
recovery["verification_requirements"],
@@ -960,11 +960,12 @@ class CanonicalCompletionGuardTest(unittest.TestCase):
"id": "storage-product-surface",
"label": "storage product surface proof",
"touched_runtime_files": [
- "frontend-modern/src/pages/DashboardPanels/StoragePanel.tsx"
+ "frontend-modern/src/components/Storage/DashboardStoragePanel.tsx"
],
"allow_same_subsystem_tests": False,
"test_prefixes": [],
"exact_files": [
+ "frontend-modern/src/components/Storage/__tests__/DashboardStoragePanel.test.tsx",
"frontend-modern/src/components/Storage/__tests__/DiskList.test.tsx",
"frontend-modern/src/components/Storage/__tests__/Storage.test.tsx",
"frontend-modern/src/components/Storage/__tests__/StorageControls.test.tsx",
diff --git a/scripts/release_control/subsystem_lookup_test.py b/scripts/release_control/subsystem_lookup_test.py
index 93fd9e4792..4f73591ec7 100644
--- a/scripts/release_control/subsystem_lookup_test.py
+++ b/scripts/release_control/subsystem_lookup_test.py
@@ -437,7 +437,7 @@ class SubsystemLookupTest(unittest.TestCase):
self.assertEqual(match["verification_requirement"]["id"], "recovery-product-surface")
def test_lookup_paths_assigns_recovery_status_panel_to_storage_recovery(self) -> None:
- result = lookup_paths(["frontend-modern/src/pages/DashboardPanels/RecoveryStatusPanel.tsx"])
+ result = lookup_paths(["frontend-modern/src/components/Recovery/DashboardRecoveryStatusPanel.tsx"])
self.assertEqual(result["unowned_runtime_files"], [])
self.assertEqual(
{item["subsystem"] for item in result["impacted_subsystems"]},
@@ -473,7 +473,7 @@ class SubsystemLookupTest(unittest.TestCase):
self.assertEqual(match["verification_requirement"]["id"], "recovery-product-surface")
def test_lookup_paths_assigns_storage_panel_to_storage_recovery(self) -> None:
- result = lookup_paths(["frontend-modern/src/pages/DashboardPanels/StoragePanel.tsx"])
+ result = lookup_paths(["frontend-modern/src/components/Storage/DashboardStoragePanel.tsx"])
self.assertEqual(result["unowned_runtime_files"], [])
self.assertEqual(
{item["subsystem"] for item in result["impacted_subsystems"]},
@@ -492,6 +492,7 @@ class SubsystemLookupTest(unittest.TestCase):
self.assertEqual(
match["verification_requirement"]["exact_files"],
[
+ "frontend-modern/src/components/Storage/__tests__/DashboardStoragePanel.test.tsx",
"frontend-modern/src/components/Storage/__tests__/DiskList.test.tsx",
"frontend-modern/src/components/Storage/__tests__/Storage.test.tsx",
"frontend-modern/src/components/Storage/__tests__/StorageControls.test.tsx",