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.

Drop dead Storage standalone chrome and orphaned subcomponent pipeline

rcourtman23227ef20f43
diff --git a/frontend-modern/src/components/Storage/Storage.tsx b/frontend-modern/src/components/Storage/Storage.tsx
index 5034bee83c..c5bb85bfc3 100644
--- a/frontend-modern/src/components/Storage/Storage.tsx
+++ b/frontend-modern/src/components/Storage/Storage.tsx
@@ -1,31 +1,18 @@
-import { Component, Show, createEffect } from 'solid-js';
-import StorageCephSection from '@/components/Storage/StorageCephSection';
+import { Component, createEffect } from 'solid-js';
import StorageContentCard from '@/components/Storage/StorageContentCard';
-import StoragePageBanners from '@/components/Storage/StoragePageBanners';
import StoragePageControls from '@/components/Storage/StoragePageControls';
-import StoragePageSummary from '@/components/Storage/StoragePageSummary';
import { StorageViewSegmentedControl } from '@/components/Storage/StorageViewSegmentedControl';
-import { PageHeader } from '@/components/shared/PageHeader';
-import { StickySummarySection } from '@/components/shared/StickySummarySection';
-import { DEFAULT_STORAGE_SELECTED_NODE_ID, isStorageRecordCeph } from './storagePageState';
+import { DEFAULT_STORAGE_SELECTED_NODE_ID } from './storagePageState';
import { useStoragePageModel } from './useStoragePageModel';
type StorageProps = {
- embedded?: boolean;
- tableOnly?: boolean;
forcedView?: 'pools' | 'disks';
forcedSourceFilter?: string;
- // Mirrors the WorkloadsSurface platform-page contract: when a platform
- // page mounts StorageSurface inside its own chrome, set
- // `showFilterToolbar` so the canonical StoragePageControls row stays
- // visible alongside the table even when `tableOnly` hides the summary
- // section. The page owns source scope via `forcedSourceFilter`; the
- // controls toolbar still exposes search, status, grouping, and sort to
- // the operator. `suppressSourceFilter` drops the redundant Source chip
- // from the controls toolbar since the platform page already locks source
- // scope through `forcedSourceFilter`; `suppressNodeFilter` lets platform
- // pages use search for host/node scoping, matching their overview pages.
- showFilterToolbar?: boolean;
+ // `suppressSourceFilter` drops the redundant Source chip from the
+ // controls toolbar since the platform page already locks source scope
+ // through `forcedSourceFilter`. `suppressNodeFilter` lets platform
+ // pages use the search input for host/node scoping, matching their
+ // overview-page filter contract.
suppressSourceFilter?: boolean;
suppressNodeFilter?: boolean;
filterAriaLabel?: string;
@@ -36,16 +23,6 @@ type StorageProps = {
const Storage: Component<StorageProps> = (props) => {
const {
kioskMode,
- reconnect,
- summaryTimeRange,
- setSummaryTimeRange,
- storageSummaryCollapsed,
- setStorageSummaryCollapsed,
- storageGrowthBySeriesId,
- storageGrowthColumnLabel,
- storageSummaryData,
- storageSummaryLoaded,
- storageSummaryFetchFailed,
selectedNodeId,
setSelectedNodeId,
view,
@@ -72,16 +49,12 @@ const Storage: Component<StorageProps> = (props) => {
storageFilterGroupBy,
sourceFilterOptions,
nodeFilterOptions,
- activeBannerKind,
- cephSummaryStats,
clearPinnedSummaryScope,
- filteredRecords,
activeSummaryStorageGroupScope,
activeSummaryStorageResourceId,
focusedSummaryStorageGroupScope,
focusedSummaryStorageGroupId,
hoveredSummaryStorageGroupScope,
- nodeOptions,
physicalDisks,
nodes,
groupedRecords,
@@ -89,23 +62,20 @@ const Storage: Component<StorageProps> = (props) => {
toggleGroup,
expandedPoolId,
setExpandedPoolId,
+ storageGrowthBySeriesId,
+ storageGrowthColumnLabel,
nodeOnlineByLabel,
highlightedRecordId,
getRecordAlertState,
- chartHoverSync,
hoveredStorageResourceId,
isLoadingPools,
- focusedStorageResourceId,
- jumpToActiveStorageRow,
selectedDiskId,
- setChartHoverSync,
setClearSurfaceRootRef,
setFocusedStorageGroupScope,
setHoveredStorageGroupScope,
setHoveredStorageResourceId,
setSelectedDiskId,
setSummaryTableRootRef,
- shouldShowJumpToActiveStorageRow,
} = useStoragePageModel({
forcedSourceFilter: () => props.forcedSourceFilter,
});
@@ -132,116 +102,50 @@ const Storage: Component<StorageProps> = (props) => {
}
});
- // Namespace saved views per platform context. Standalone /storage uses the
- // bare "storage" key; a platform-embedded storage tab (which forces a
- // single source via forcedSourceFilter) gets its own scope so views
- // saved on the Proxmox tab do not appear on /storage and vice versa.
- const savedViewsKey = (() => {
- const scope = (props.forcedSourceFilter ?? '').trim().toLowerCase();
- return scope ? `storage-${scope}` : 'storage';
- })();
+ // Namespace saved views per platform context. Every live consumer is a
+ // platform-embedded storage tab that locks source scope via
+ // forcedSourceFilter; views never leak across platforms.
+ const savedViewsKey = `storage-${(props.forcedSourceFilter ?? '').trim().toLowerCase()}`;
return (
<div ref={setClearSurfaceRootRef} class="space-y-4" data-testid="storage-page">
- <Show when={!props.embedded}>
- <PageHeader
- title="Storage"
- description="Review capacity, topology, protection, and physical media across connected storage platforms."
- />
- </Show>
-
- <Show when={!props.tableOnly && !storageSummaryCollapsed()}>
- <StickySummarySection desktopOnly={false} stickyDesktopOnly>
- <div class="space-y-2">
- <StoragePageSummary
- filteredRecords={filteredRecords}
- search={search}
- sourceFilter={sourceFilter}
- healthFilter={healthFilter}
- diskRoleFilter={diskRoleFilter}
- diskGroupFilter={diskGroupFilter}
- selectedNodeId={selectedNodeId}
- nodeOptions={nodeOptions}
- physicalDisks={physicalDisks}
- summaryTimeRange={summaryTimeRange}
- setSummaryTimeRange={setSummaryTimeRange}
- storageSummaryData={storageSummaryData}
- storageSummaryLoaded={storageSummaryLoaded}
- storageSummaryFetchFailed={storageSummaryFetchFailed}
- hoveredResourceId={hoveredStorageResourceId}
- hoveredGroupScope={hoveredSummaryStorageGroupScope}
- focusedResourceId={focusedStorageResourceId}
- focusedGroupScope={focusedSummaryStorageGroupScope}
- chartHoverSync={chartHoverSync}
- onChartHoverSyncChange={setChartHoverSync}
- showJumpToActiveRow={shouldShowJumpToActiveStorageRow}
- onJumpToActiveRow={jumpToActiveStorageRow}
- onScopeToDegradedPools={() => {
- setView('pools');
- setStorageFilterStatus('attention');
- }}
- onScopeToFailingDisks={() => {
- setView('disks');
- setStorageFilterStatus('attention');
- }}
- />
- </div>
- </StickySummarySection>
- </Show>
-
- <Show when={!props.tableOnly}>
- <StorageCephSection
- view={view}
- summary={cephSummaryStats}
- filteredRecords={filteredRecords}
- isCephRecord={isStorageRecordCeph}
- />
- </Show>
-
<div class="space-y-4" data-testid="storage-interaction-surface">
- <Show when={props.showFilterToolbar || !props.tableOnly}>
- <div data-summary-clear-ignore>
- <StoragePageControls
- kioskMode={kioskMode}
- savedViewsKey={savedViewsKey}
- view={view}
- setView={setView}
- search={search}
- setSearch={setSearch}
- filterAriaLabel={props.filterAriaLabel}
- searchPlaceholder={props.filterSearchPlaceholder}
- searchEmptyMessage={props.filterSearchEmptyMessage}
- groupBy={groupBy}
- setGroupBy={setGroupBy}
- sortKey={sortKey}
- setSortKey={setSortKey}
- sortDirection={sortDirection}
- setSortDirection={setSortDirection}
- statusFilter={storageFilterStatus}
- setStatusFilter={setStorageFilterStatus}
- sourceFilter={sourceFilter}
- setSourceFilter={setSourceFilter}
- sourceOptions={sourceFilterOptions}
- suppressSourceFilter={props.suppressSourceFilter || Boolean(props.forcedSourceFilter)}
- suppressNodeFilter={props.suppressNodeFilter}
- diskRoleFilter={diskRoleFilter}
- setDiskRoleFilter={setDiskRoleFilter}
- diskRoleOptions={diskRoleOptions}
- diskGroupFilter={diskGroupFilter}
- setDiskGroupFilter={setDiskGroupFilter}
- diskGroupOptions={diskGroupOptions}
- nodeFilterOptions={nodeFilterOptions()}
- selectedNodeId={selectedNodeId}
- setSelectedNodeId={setSelectedNodeId}
- storageFilterGroupBy={storageFilterGroupBy}
- chartsCollapsed={storageSummaryCollapsed}
- onChartsToggle={() => setStorageSummaryCollapsed((collapsed) => !collapsed)}
- />
- </div>
- </Show>
- <Show when={!props.tableOnly}>
- <StoragePageBanners kind={activeBannerKind} reconnect={reconnect} />
- </Show>
+ <div data-summary-clear-ignore>
+ <StoragePageControls
+ kioskMode={kioskMode}
+ savedViewsKey={savedViewsKey}
+ view={view}
+ setView={setView}
+ search={search}
+ setSearch={setSearch}
+ filterAriaLabel={props.filterAriaLabel}
+ searchPlaceholder={props.filterSearchPlaceholder}
+ searchEmptyMessage={props.filterSearchEmptyMessage}
+ groupBy={groupBy}
+ setGroupBy={setGroupBy}
+ sortKey={sortKey}
+ setSortKey={setSortKey}
+ sortDirection={sortDirection}
+ setSortDirection={setSortDirection}
+ statusFilter={storageFilterStatus}
+ setStatusFilter={setStorageFilterStatus}
+ sourceFilter={sourceFilter}
+ setSourceFilter={setSourceFilter}
+ sourceOptions={sourceFilterOptions}
+ suppressSourceFilter={props.suppressSourceFilter || Boolean(props.forcedSourceFilter)}
+ suppressNodeFilter={props.suppressNodeFilter}
+ diskRoleFilter={diskRoleFilter}
+ setDiskRoleFilter={setDiskRoleFilter}
+ diskRoleOptions={diskRoleOptions}
+ diskGroupFilter={diskGroupFilter}
+ setDiskGroupFilter={setDiskGroupFilter}
+ diskGroupOptions={diskGroupOptions}
+ nodeFilterOptions={nodeFilterOptions()}
+ selectedNodeId={selectedNodeId}
+ setSelectedNodeId={setSelectedNodeId}
+ storageFilterGroupBy={storageFilterGroupBy}
+ />
+ </div>
<StorageContentCard
view={view}
@@ -283,7 +187,7 @@ const Storage: Component<StorageProps> = (props) => {
selectedDiskId={selectedDiskId}
setSelectedDiskId={setSelectedDiskId}
actions={
- props.tableOnly && !props.forcedView && !kioskMode() ? (
+ !props.forcedView && !kioskMode() ? (
<StorageViewSegmentedControl value={view()} onChange={setView} />
) : undefined
}
diff --git a/frontend-modern/src/components/Storage/StorageCephSection.tsx b/frontend-modern/src/components/Storage/StorageCephSection.tsx
deleted file mode 100644
index 4ba39012e4..0000000000
--- a/frontend-modern/src/components/Storage/StorageCephSection.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import { Component, Show } from 'solid-js';
-import StorageCephSummaryCard from '@/components/Storage/StorageCephSummaryCard';
-import type { CephSummaryStats } from '@/features/storageBackups/cephSummaryPresentation';
-import type { StorageRecord } from '@/features/storageBackups/models';
-import { useStorageCephSectionModel } from './useStorageCephSectionModel';
-
-type StorageCephSectionProps = {
- view: () => 'pools' | 'disks';
- summary: () => CephSummaryStats | null;
- filteredRecords: () => StorageRecord[];
- isCephRecord: (record: StorageRecord) => boolean;
-};
-
-export const StorageCephSection: Component<StorageCephSectionProps> = (props) => {
- const model = useStorageCephSectionModel({
- view: props.view,
- summary: props.summary,
- filteredRecords: props.filteredRecords,
- isCephRecord: props.isCephRecord,
- });
-
- return (
- <Show when={model.showSummary()}>
- <StorageCephSummaryCard summary={props.summary()!} />
- </Show>
- );
-};
-
-export default StorageCephSection;
diff --git a/frontend-modern/src/components/Storage/StoragePageBanner.tsx b/frontend-modern/src/components/Storage/StoragePageBanner.tsx
deleted file mode 100644
index 78c396c75a..0000000000
--- a/frontend-modern/src/components/Storage/StoragePageBanner.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import { Component, JSX, Show } from 'solid-js';
-import { Card } from '@/components/shared/Card';
-import {
- STORAGE_BANNER_ACTION_BUTTON_CLASS,
- STORAGE_PAGE_BANNER_ROW_CLASS,
- STORAGE_PAGE_BANNER_TEXT_CLASS,
- type StoragePageBannerKind,
-} from '@/features/storageBackups/storagePagePresentation';
-import { useStoragePageBannerModel } from './useStoragePageBannerModel';
-
-type StoragePageBannerProps = {
- kind: StoragePageBannerKind;
- onAction?: JSX.EventHandlerUnion<HTMLButtonElement, MouseEvent>;
-};
-
-export const StoragePageBanner: Component<StoragePageBannerProps> = (props) => {
- const model = useStoragePageBannerModel({
- kind: () => props.kind,
- });
-
- return (
- <Card padding="sm" tone="warning">
- <div class={STORAGE_PAGE_BANNER_ROW_CLASS}>
- <span class={STORAGE_PAGE_BANNER_TEXT_CLASS}>{model.message()}</span>
- <Show when={model.actionLabel()}>
- {(label) => (
- <button
- type="button"
- onClick={props.onAction}
- class={STORAGE_BANNER_ACTION_BUTTON_CLASS}
- >
- {label()}
- </button>
- )}
- </Show>
- </div>
- </Card>
- );
-};
-
-export default StoragePageBanner;
diff --git a/frontend-modern/src/components/Storage/StoragePageBanners.tsx b/frontend-modern/src/components/Storage/StoragePageBanners.tsx
deleted file mode 100644
index 2c8a6d4b2e..0000000000
--- a/frontend-modern/src/components/Storage/StoragePageBanners.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import { Component, Match, Switch } from 'solid-js';
-import StoragePageBanner from '@/components/Storage/StoragePageBanner';
-import { useStoragePageBannersModel } from './useStoragePageBannersModel';
-
-type StoragePageBannersProps = {
- kind: () => 'reconnecting' | 'fetch-error' | 'disconnected' | 'waiting-for-data' | null;
- reconnect: () => void;
-};
-
-export const StoragePageBanners: Component<StoragePageBannersProps> = (props) => {
- const model = useStoragePageBannersModel({
- kind: props.kind,
- });
-
- return (
- <Switch>
- <Match when={model.reconnectActionKind() === 'reconnecting'}>
- <StoragePageBanner kind="reconnecting" onAction={props.reconnect} />
- </Match>
- <Match when={props.kind() === 'fetch-error'}>
- <StoragePageBanner kind="fetch-error" />
- </Match>
- <Match when={model.reconnectActionKind() === 'disconnected'}>
- <StoragePageBanner kind="disconnected" onAction={props.reconnect} />
- </Match>
- <Match when={props.kind() === 'waiting-for-data'}>
- <StoragePageBanner kind="waiting-for-data" />
- </Match>
- </Switch>
- );
-};
-
-export default StoragePageBanners;
diff --git a/frontend-modern/src/components/Storage/StoragePageControls.tsx b/frontend-modern/src/components/Storage/StoragePageControls.tsx
index 3ec63fa5b0..f9b90d2cd2 100644
--- a/frontend-modern/src/components/Storage/StoragePageControls.tsx
+++ b/frontend-modern/src/components/Storage/StoragePageControls.tsx
@@ -1,7 +1,6 @@
import { Component, JSX, Show, createMemo } from 'solid-js';
import { FilterBar, type FilterDef } from '@/components/shared/FilterBar';
import { Subtabs } from '@/components/shared/Subtabs';
-import { ChartVisibilityToggleButton } from '@/components/shared/FilterToolbar';
import { useBreakpoint } from '@/hooks/useBreakpoint';
import { STORAGE_KEYS } from '@/utils/localStorage';
import {
@@ -68,8 +67,6 @@ type StoragePageControlsProps = {
selectedNodeId: () => string;
setSelectedNodeId: (value: string) => void;
storageFilterGroupBy: () => StorageGroupKey;
- chartsCollapsed?: () => boolean;
- onChartsToggle?: () => void;
// Mirrors the WorkloadsFilter `suppressPlatformFilter` contract: when a
// platform page mounts StorageSurface with `forcedSourceFilter`, the
// Source filter chip is redundant (it is already locked by the page)
@@ -351,12 +348,6 @@ export const StoragePageControls: Component<StoragePageControlsProps> = (props)
</svg>
</button>
</div>
- <Show when={props.onChartsToggle}>
- <ChartVisibilityToggleButton
- collapsed={props.chartsCollapsed?.() ?? false}
- onToggle={() => props.onChartsToggle?.()}
- />
- </Show>
</>
}
onClearAll={handleClearAll}
diff --git a/frontend-modern/src/components/Storage/StoragePageSummary.tsx b/frontend-modern/src/components/Storage/StoragePageSummary.tsx
deleted file mode 100644
index 4f5ae4d8c7..0000000000
--- a/frontend-modern/src/components/Storage/StoragePageSummary.tsx
+++ /dev/null
@@ -1,77 +0,0 @@
-import { Component } from 'solid-js';
-import StorageSummary from '@/components/Storage/StorageSummary';
-import type { StorageSummaryChartsResponse } from '@/api/charts';
-import type { SummaryTimeRange } from '@/components/shared/summaryTimeRange';
-import type { Resource } from '@/types/resource';
-import type { StorageHealthFilter, StorageRecord } from '@/features/storageBackups/models';
-import type { SummarySeriesGroupScope } from '@/components/shared/summaryCardInteraction';
-import type { StoragePageNodeOption } from './storagePageState';
-import { useStoragePageSummary } from './useStoragePageSummary';
-import type { SummaryChartHoverSync } from '@/components/shared/contextualFocus';
-
-type StoragePageSummaryProps = {
- filteredRecords: () => StorageRecord[];
- search: () => string;
- sourceFilter: () => string;
- healthFilter: () => StorageHealthFilter;
- diskRoleFilter: () => string;
- diskGroupFilter: () => string;
- selectedNodeId: () => string;
- nodeOptions: () => StoragePageNodeOption[];
- physicalDisks: () => Resource[];
- summaryTimeRange: () => SummaryTimeRange;
- setSummaryTimeRange: (range: SummaryTimeRange) => void;
- storageSummaryData: () => StorageSummaryChartsResponse | null;
- storageSummaryLoaded: () => boolean;
- storageSummaryFetchFailed: () => boolean;
- hoveredResourceId: () => string | null;
- hoveredGroupScope: () => SummarySeriesGroupScope | null;
- focusedResourceId: () => string | null;
- focusedGroupScope: () => SummarySeriesGroupScope | null;
- chartHoverSync: () => SummaryChartHoverSync | null;
- onChartHoverSyncChange: (value: SummaryChartHoverSync | null) => void;
- showJumpToActiveRow: () => boolean;
- onJumpToActiveRow: () => void;
- onScopeToDegradedPools?: () => void;
- onScopeToFailingDisks?: () => void;
-};
-
-export const StoragePageSummary: Component<StoragePageSummaryProps> = (props) => {
- const { poolCount, diskCount, poolsDegraded, disksFailing } = useStoragePageSummary({
- filteredRecords: props.filteredRecords,
- search: props.search,
- sourceFilter: props.sourceFilter,
- healthFilter: props.healthFilter,
- diskRoleFilter: props.diskRoleFilter,
- diskGroupFilter: props.diskGroupFilter,
- selectedNodeId: props.selectedNodeId,
- nodeOptions: props.nodeOptions,
- physicalDisks: props.physicalDisks,
- });
-
- return (
- <StorageSummary
- poolCount={poolCount()}
- diskCount={diskCount()}
- poolsDegraded={poolsDegraded()}
- disksFailing={disksFailing()}
- data={props.storageSummaryData()}
- loaded={props.storageSummaryLoaded()}
- fetchFailed={props.storageSummaryFetchFailed()}
- timeRange={props.summaryTimeRange()}
- onTimeRangeChange={props.setSummaryTimeRange}
- hoveredResourceId={props.hoveredResourceId()}
- hoveredGroupScope={props.hoveredGroupScope()}
- focusedResourceId={props.focusedResourceId()}
- focusedGroupScope={props.focusedGroupScope()}
- chartHoverSync={props.chartHoverSync()}
- onChartHoverSyncChange={props.onChartHoverSyncChange}
- showJumpToActiveRow={props.showJumpToActiveRow()}
- onJumpToActiveRow={props.onJumpToActiveRow}
- onScopeToDegradedPools={props.onScopeToDegradedPools}
- onScopeToFailingDisks={props.onScopeToFailingDisks}
- />
- );
-};
-
-export default StoragePageSummary;
diff --git a/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx b/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
index d320ea1f52..4d49ccb291 100644
--- a/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
+++ b/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
@@ -362,13 +362,6 @@ vi.mock('@/components/Storage/DiskList', () => ({
}));
describe('Storage platform-page embed contract', () => {
- it('exposes showFilterToolbar on StorageProps so platform pages keep StoragePageControls visible under tableOnly', async () => {
- const storageSource = (await import('../Storage.tsx?raw')).default;
- expect(storageSource).toContain('showFilterToolbar?: boolean;');
- expect(storageSource).toContain('suppressNodeFilter?: boolean;');
- expect(storageSource).toContain('props.showFilterToolbar || !props.tableOnly');
- });
-
it('auto-suppresses the Source filter chip whenever forcedSourceFilter is set', async () => {
const storageSource = (await import('../Storage.tsx?raw')).default;
expect(storageSource).toContain(
@@ -547,150 +540,6 @@ describe('Storage', () => {
storageSummarySpy.mockRestore();
});
- it('routes hovered pool rows into the shared summary highlight contract and keeps the summary sticky only on desktop widths', async () => {
- const storageSummarySpy = vi.spyOn(ChartsAPI, 'getStorageSummaryCharts').mockResolvedValue({
- pools: {
- 'pool:alpha': {
- name: 'Alpha-Store',
- usage: [
- { timestamp: Date.now() - 60_000, value: 45 },
- { timestamp: Date.now(), value: 47 },
- ],
- used: [
- { timestamp: Date.now() - 60_000, value: 450 },
- { timestamp: Date.now(), value: 470 },
- ],
- avail: [
- { timestamp: Date.now() - 60_000, value: 550 },
- { timestamp: Date.now(), value: 530 },
- ],
- },
- 'pool:beta': {
- name: 'Beta-Store',
- usage: [
- { timestamp: Date.now() - 60_000, value: 68 },
- { timestamp: Date.now(), value: 70 },
- ],
- used: [
- { timestamp: Date.now() - 60_000, value: 680 },
- { timestamp: Date.now(), value: 700 },
- ],
- avail: [
- { timestamp: Date.now() - 60_000, value: 320 },
- { timestamp: Date.now(), value: 300 },
- ],
- },
- },
- disks: {},
- stats: {
- oldestDataTimestamp: Date.now() - 60_000,
- },
- });
-
- hookResources = [
- buildStorageResource('storage-display-alpha', 'Alpha-Store', 'pve1', {
- metricsTarget: {
- resourceType: 'storage',
- resourceId: 'pool:alpha',
- },
- }),
- buildStorageResource('storage-display-beta', 'Beta-Store', 'pve2', {
- metricsTarget: {
- resourceType: 'storage',
- resourceId: 'pool:beta',
- },
- }),
- ];
-
- render(() => <Storage />);
-
- const summary = await screen.findByTestId('storage-summary');
- const stickyWrapper = summary.closest('[data-sticky-summary="true"]');
- expect(stickyWrapper).toHaveAttribute('data-sticky-summary-desktop-only', 'false');
- expect(stickyWrapper).toHaveAttribute('data-sticky-summary-sticky-desktop-only', 'true');
- expect(stickyWrapper?.className).toContain('static');
- expect(stickyWrapper?.className).toContain('lg:sticky');
- expect(stickyWrapper?.className).toContain('top-0');
-
- const alphaRow = document.querySelector('tr[data-summary-series-id="pool:alpha"]')!;
- expect(alphaRow).toHaveAttribute('data-summary-series-id', 'pool:alpha');
- expect(alphaRow).toHaveAttribute('data-summary-row-active', 'false');
-
- fireEvent.pointerEnter(alphaRow, { pointerType: 'mouse' });
-
- await waitFor(() => {
- expect(alphaRow).toHaveAttribute('data-summary-row-active', 'true');
- expect(alphaRow.className).not.toContain('bg-sky-50');
- expect(alphaRow.className).not.toContain('ring-sky-400/25');
- expect(
- summary.querySelectorAll(
- '[data-highlight-series-active="true"][data-highlight-series-id="pool:alpha"]',
- ).length,
- ).toBe(3);
- expect(
- summary.querySelectorAll(
- '[data-highlight-series-active="true"][data-highlight-series-id="pool:alpha"][data-active-series-display="isolate"][data-rendered-series-count="1"]',
- ).length,
- ).toBe(3);
- expect(summary.querySelectorAll('[data-summary-card-state="inactive"]').length).toBe(0);
- });
-
- fireEvent.pointerLeave(alphaRow, { pointerType: 'mouse' });
-
- await waitFor(() => {
- expect(alphaRow).toHaveAttribute('data-summary-row-active', 'false');
- expect(summary.querySelectorAll('[data-highlight-series-active="true"]').length).toBe(0);
- expect(summary.querySelectorAll('[data-summary-card-state="inactive"]').length).toBe(0);
- });
-
- const poolUsageChart = screen
- .getByText('Storage Usage')
- .closest('[data-summary-card-state]')
- ?.querySelector('svg');
- expect(poolUsageChart).not.toBeNull();
- if (!poolUsageChart) {
- storageSummarySpy.mockRestore();
- return;
- }
-
- (
- poolUsageChart as unknown as {
- getBoundingClientRect: () => DOMRect;
- }
- ).getBoundingClientRect = () =>
- ({
- left: 0,
- top: 0,
- width: 200,
- height: 50,
- right: 200,
- bottom: 50,
- x: 0,
- y: 0,
- toJSON: () => ({}),
- }) as unknown as DOMRect;
-
- fireEvent.mouseMove(poolUsageChart, { clientX: 199, clientY: 26 });
-
- await waitFor(() => {
- expect(
- summary.querySelectorAll(
- '[data-highlight-series-active="true"][data-highlight-series-id="pool:alpha"]',
- ).length,
- ).toBe(3);
- expect(summary.querySelectorAll('[data-summary-card-state="inactive"]').length).toBe(0);
- });
-
- fireEvent.mouseLeave(poolUsageChart);
-
- await waitFor(() => {
- expect(summary.querySelectorAll('[data-highlight-series-active="true"]').length).toBe(0);
- expect(summary.querySelectorAll('[data-summary-card-state="inactive"]').length).toBe(0);
- });
-
- storageSummarySpy.mockRestore();
- });
-
it('renders compact table columns and supports sort/group controls', async () => {
hookResources = [
buildStorageResource('storage-1', 'Alpha-Store', 'pve1', {
@@ -1030,68 +879,6 @@ describe('Storage', () => {
});
});
- it('shows ceph summary card and pool expand chevron', async () => {
- hookResources = [
- buildStorageResource('storage-ceph', 'Ceph-Pool-1', 'pve1', {
- storageType: 'cephfs',
- platformId: 'cluster-main',
- current: 35,
- used: 350,
- free: 650,
- total: 1_000,
- }),
- ];
-
- nodeResources = [
- ...nodeResources,
- {
- id: 'ceph-1',
- type: 'ceph',
- name: 'Primary Ceph',
- displayName: 'Primary Ceph',
- platformId: 'cluster-main',
- platformType: 'proxmox-pve',
- sourceType: 'api',
- status: 'online',
- disk: { current: 35, total: 1_000, used: 350, free: 650 },
- lastSeen: Date.now(),
- platformData: {
- proxmox: { instance: 'cluster-main' },
- ceph: {
- healthStatus: 'HEALTH_WARN',
- healthMessage: '1 OSD nearfull',
- numMons: 3,
- numMgrs: 2,
- numOsds: 6,
- numOsdsUp: 6,
- numOsdsIn: 6,
- numPGs: 256,
- pools: [
- {
- name: 'rbd',
- storedBytes: 350,
- availableBytes: 650,
- objects: 10_000,
- percentUsed: 35,
- },
- ],
- services: [],
- },
- },
- } as Resource,
- ];
-
- render(() => <Storage />);
-
- expect(screen.getByText('Ceph Summary')).toBeInTheDocument();
- expect(screen.getByText('Primary Ceph')).toBeInTheDocument();
-
- // All pools now have a toggle details button (not just Ceph)
- const toggleBtn = screen.getByRole('button', { name: 'Expand Ceph-Pool-1' });
- expect(toggleBtn).toBeInTheDocument();
- fireEvent.click(toggleBtn);
- });
-
it('uses canonical storage metrics target ids for expanded pool history charts', async () => {
const metricsHistorySpy = vi.spyOn(ChartsAPI, 'getMetricsHistory').mockResolvedValue({
resourceType: 'storage',
@@ -1196,91 +983,6 @@ describe('Storage', () => {
});
});
- it('keeps storage summary page-scoped when a focused pool is expanded', async () => {
- const storageSummarySpy = vi.spyOn(ChartsAPI, 'getStorageSummaryCharts').mockResolvedValue({
- pools: {
- 'pool:alpha': {
- name: 'Alpha-Store',
- usage: [
- { timestamp: Date.now() - 60_000, value: 45 },
- { timestamp: Date.now(), value: 47 },
- ],
- used: [],
- avail: [],
- },
- 'pool:beta': {
- name: 'Beta-Store',
- usage: [
- { timestamp: Date.now() - 60_000, value: 58 },
- { timestamp: Date.now(), value: 60 },
- ],
- used: [
- { timestamp: Date.now() - 60_000, value: 680 },
- { timestamp: Date.now(), value: 700 },
- ],
- avail: [
- { timestamp: Date.now() - 60_000, value: 320 },
- { timestamp: Date.now(), value: 300 },
- ],
- },
- },
- disks: {},
- stats: {
- oldestDataTimestamp: Date.now() - 60_000,
- },
- });
-
- hookResources = [
- buildStorageResource('storage-display-alpha', 'Alpha-Store', 'pve1', {
- metricsTarget: {
- resourceType: 'storage',
- resourceId: 'pool:alpha',
- },
- }),
- buildStorageResource('storage-display-beta', 'Beta-Store', 'pve2', {
- metricsTarget: {
- resourceType: 'storage',
- resourceId: 'pool:beta',
- },
- }),
- ];
-
- render(() => <Storage />);
-
- const summary = await screen.findByTestId('storage-summary');
-
- fireEvent.click(screen.getByRole('button', { name: 'Expand Alpha-Store' }));
-
- await waitFor(() => {
- expect(
- summary.querySelectorAll(
- '[data-highlight-series-active="true"][data-highlight-series-id="pool:alpha"]',
- ).length,
- ).toBe(1);
- expect(summary.querySelectorAll('[data-summary-card-state="inactive"]').length).toBe(2);
- expect(
- screen
- .getByText('Used Capacity')
- .closest('[data-summary-card-state]')
- ?.textContent?.includes('No history yet'),
- ).toBe(false);
- expect(
- screen
- .getByText('Available Space')
- .closest('[data-summary-card-state]')
- ?.textContent?.includes('No history yet'),
- ).toBe(false);
- expect(
- screen
- .getByText('Storage Usage')
- .closest('[data-summary-card-state]')
- ?.getAttribute('data-summary-card-state'),
- ).toBe('active');
- });
-
- storageSummarySpy.mockRestore();
- });
-
it('shows compact synchronized readouts on sibling storage cards without duplicating the source card tooltip', async () => {
const storageSummarySpy = vi.spyOn(ChartsAPI, 'getStorageSummaryCharts').mockResolvedValue({
pools: {
@@ -1388,183 +1090,6 @@ describe('Storage', () => {
storageSummarySpy.mockRestore();
});
- it('offers a deliberate jump affordance when the focused storage row is off-screen', async () => {
- const storageSummarySpy = vi.spyOn(ChartsAPI, 'getStorageSummaryCharts').mockResolvedValue({
- pools: {
- 'pool:alpha': {
- name: 'Alpha-Store',
- usage: [
- { timestamp: Date.now() - 60_000, value: 45 },
- { timestamp: Date.now(), value: 47 },
- ],
- used: [
- { timestamp: Date.now() - 60_000, value: 450 },
- { timestamp: Date.now(), value: 470 },
- ],
- avail: [
- { timestamp: Date.now() - 60_000, value: 550 },
- { timestamp: Date.now(), value: 530 },
- ],
- },
- },
- disks: {},
- stats: {
- oldestDataTimestamp: Date.now() - 60_000,
- },
- });
-
- hookResources = [
- buildStorageResource('storage-display-alpha', 'Alpha-Store', 'pve1', {
- metricsTarget: {
- resourceType: 'storage',
- resourceId: 'pool:alpha',
- },
- }),
- ];
-
- render(() => <Storage />);
-
- await screen.findByTestId('storage-summary');
- const alphaRow = document.querySelector(
- 'tr[data-summary-series-id="pool:alpha"]',
- ) as HTMLTableRowElement;
- expect(alphaRow).toBeTruthy();
-
- alphaRow.getBoundingClientRect = vi.fn(() => ({
- top: window.innerHeight + 120,
- bottom: window.innerHeight + 168,
- left: 0,
- right: 480,
- width: 480,
- height: 48,
- x: 0,
- y: window.innerHeight + 120,
- toJSON: () => ({}),
- })) as unknown as typeof alphaRow.getBoundingClientRect;
- alphaRow.scrollIntoView = vi.fn();
-
- fireEvent.click(screen.getByRole('button', { name: 'Expand Alpha-Store' }));
-
- await waitFor(() => {
- expect(screen.getByRole('button', { name: 'Jump to row' })).toBeInTheDocument();
- });
-
- fireEvent.click(screen.getByRole('button', { name: 'Jump to row' }));
-
- expect(alphaRow.scrollIntoView).toHaveBeenCalledWith({
- behavior: 'smooth',
- block: 'center',
- });
-
- storageSummarySpy.mockRestore();
- });
-
- it('reveals opened pool detail without hard-centering the focused row', async () => {
- const storageSummarySpy = vi.spyOn(ChartsAPI, 'getStorageSummaryCharts').mockResolvedValue({
- pools: {
- 'pool:alpha': {
- name: 'Alpha-Store',
- usage: [
- { timestamp: Date.now() - 60_000, value: 45 },
- { timestamp: Date.now(), value: 47 },
- ],
- used: [
- { timestamp: Date.now() - 60_000, value: 450 },
- { timestamp: Date.now(), value: 470 },
- ],
- avail: [
- { timestamp: Date.now() - 60_000, value: 550 },
- { timestamp: Date.now(), value: 530 },
- ],
- },
- },
- disks: {},
- stats: {
- oldestDataTimestamp: Date.now() - 60_000,
- },
- });
-
- const scrollToSpy = vi.fn();
- Object.defineProperty(window, 'innerHeight', {
- configurable: true,
- value: 800,
- });
- Object.defineProperty(window, 'scrollY', {
- configurable: true,
- value: 180,
- });
- Object.defineProperty(window, 'scrollTo', {
- configurable: true,
- value: scrollToSpy,
- });
-
- const rowRect = {
- top: 680,
- bottom: 728,
- left: 0,
- right: 480,
- width: 480,
- height: 48,
- x: 0,
- y: 680,
- toJSON: () => ({}),
- } satisfies DOMRect;
- const detailRect = {
- top: 732,
- bottom: 1012,
- left: 0,
- right: 480,
- width: 480,
- height: 280,
- x: 0,
- y: 732,
- toJSON: () => ({}),
- } satisfies DOMRect;
- const rectSpy = vi
- .spyOn(HTMLElement.prototype, 'getBoundingClientRect')
- .mockImplementation(function mockRect(this: HTMLElement) {
- if (this.dataset.summarySeriesId === 'pool:alpha') {
- return rowRect;
- }
- if (this.dataset.inlineDetailFor === 'pool:alpha') {
- return detailRect;
- }
- return {
- top: 0,
- bottom: 32,
- left: 0,
- right: 32,
- width: 32,
- height: 32,
- x: 0,
- y: 0,
- toJSON: () => ({}),
- } satisfies DOMRect;
- });
-
- hookResources = [
- buildStorageResource('storage-display-alpha', 'Alpha-Store', 'pve1', {
- metricsTarget: {
- resourceType: 'storage',
- resourceId: 'pool:alpha',
- },
- }),
- ];
-
- render(() => <Storage />);
-
- await screen.findByTestId('storage-summary');
- fireEvent.click(screen.getByRole('button', { name: 'Expand Alpha-Store' }));
-
- await waitFor(() => {
- expect(document.querySelector('[data-inline-detail-for="pool:alpha"]')).toBeTruthy();
- expect(scrollToSpy).toHaveBeenCalledWith({ top: 636, behavior: 'smooth' });
- });
-
- rectSpy.mockRestore();
- storageSummarySpy.mockRestore();
- });
-
it('restores canonical TrueNAS source filters from the storage route', async () => {
nodeResources = [
{
@@ -1750,16 +1275,6 @@ describe('Storage', () => {
).not.toBeInTheDocument();
});
- it('shows warning when v2 fetch reports an error', () => {
- hookError = new Error('network');
-
- render(() => <Storage />);
-
- expect(
- screen.getByText('Unable to refresh storage resources. Showing latest available data.'),
- ).toBeInTheDocument();
- });
-
it('switches to physical disks view', () => {
render(() => <Storage />);
@@ -1877,7 +1392,7 @@ describe('Storage', () => {
buildStorageResource('storage-1', 'Local-LVM-PVE1', 'pve1'),
];
- render(() => <Storage embedded tableOnly forcedSourceFilter="proxmox-pve" />);
+ render(() => <Storage forcedSourceFilter="proxmox-pve" />);
const viewOptions = screen.getByRole('group', { name: 'Storage table view' });
expect(within(viewOptions).getByRole('button', { name: 'Storage' })).toHaveAttribute(
@@ -1951,9 +1466,6 @@ describe('Storage', () => {
render(() => (
<Storage
- embedded
- tableOnly
- showFilterToolbar
forcedSourceFilter="vmware-vsphere"
suppressNodeFilter
filterAriaLabel="vSphere datastore filters"
@@ -1977,51 +1489,6 @@ describe('Storage', () => {
expect(screen.getByText('archive-cold')).toBeInTheDocument();
});
- it('supports Proxmox platform table embedding without standalone page chrome', async () => {
- mockLocationPath = '/proxmox/storage';
- hookResources = [
- buildPhysicalDiskResource('sda', 'node-1', 'pve1'),
- buildStorageResource('storage-1', 'Local-LVM-PVE1', 'pve1'),
- ];
-
- render(() => (
- <Storage embedded tableOnly forcedSourceFilter="proxmox-pve" forcedView="disks" />
- ));
-
- await waitFor(() => {
- expect(screen.getByTestId('disk-list')).toHaveTextContent('disk-view:all:');
- });
- expect(
- screen.queryByText(
- 'Review capacity, topology, protection, and physical media across connected storage platforms.',
- ),
- ).not.toBeInTheDocument();
- expect(screen.queryByTestId('storage-summary')).not.toBeInTheDocument();
- expect(screen.queryByText('Ceph')).not.toBeInTheDocument();
- expect(screen.queryByRole('tablist', { name: 'Storage view' })).not.toBeInTheDocument();
- expect(screen.queryByRole('group', { name: 'Storage table view' })).not.toBeInTheDocument();
- });
-
- it('collapses and restores storage charts from the shared toolbar toggle', async () => {
- hookResources = [buildStorageResource('storage-1', 'Local-LVM-PVE1', 'pve1')];
-
- render(() => <Storage />);
-
- expect(await screen.findByTestId('storage-summary')).toBeInTheDocument();
-
- const chartsButton = screen.getByRole('button', { name: /charts/i });
- fireEvent.click(chartsButton);
-
- await waitFor(() => {
- expect(screen.queryByTestId('storage-summary')).not.toBeInTheDocument();
- });
- expect(window.localStorage.getItem(STORAGE_KEYS.STORAGE_SUMMARY_COLLAPSED)).toBe('true');
-
- fireEvent.click(screen.getByRole('button', { name: /charts/i }));
-
- expect(await screen.findByTestId('storage-summary')).toBeInTheDocument();
- });
-
it('shows loading placeholder when pool resources are loading', () => {
hookLoading = true;
diff --git a/frontend-modern/src/components/Storage/__tests__/useStorageCephSectionModel.test.ts b/frontend-modern/src/components/Storage/__tests__/useStorageCephSectionModel.test.ts
deleted file mode 100644
index 043020bef6..0000000000
--- a/frontend-modern/src/components/Storage/__tests__/useStorageCephSectionModel.test.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-import { renderHook } from '@solidjs/testing-library';
-import { createSignal } from 'solid-js';
-import { describe, expect, it } from 'vitest';
-import type { CephSummaryStats } from '@/features/storageBackups/cephSummaryPresentation';
-import type { StorageRecord } from '@/features/storageBackups/models';
-import { useStorageCephSectionModel } from '@/components/Storage/useStorageCephSectionModel';
-
-describe('useStorageCephSectionModel', () => {
- it('derives canonical Ceph summary visibility', () => {
- const [view] = createSignal<'pools' | 'disks'>('pools');
- const [summary] = createSignal<CephSummaryStats | null>({
- totalBytes: 100,
- usedBytes: 50,
- availableBytes: 50,
- usagePercent: 50,
- clusters: [
- {
- id: 'ceph-1',
- instance: 'cluster-a',
- name: 'ceph-1',
- totalBytes: 100,
- usedBytes: 50,
- availableBytes: 50,
- usagePercent: 50,
- health: 'HEALTH_OK',
- healthMessage: '',
- numMons: 1,
- numMgrs: 1,
- numOsds: 3,
- numOsdsUp: 3,
- numOsdsIn: 3,
- numPGs: 64,
- pools: [],
- services: [],
- lastUpdated: 0,
- },
- ],
- });
- const [filteredRecords] = createSignal<StorageRecord[]>([
- {
- id: 'storage-ceph',
- name: 'ceph-store',
- category: 'pool',
- health: 'healthy',
- source: { platform: 'generic', family: 'onprem', origin: 'resource', adapterId: 'test' },
- location: { label: 'ceph-1', scope: 'cluster' },
- capacity: { totalBytes: 100, usedBytes: 50, freeBytes: 50, usagePercent: 50 },
- capabilities: [],
- observedAt: 0,
- } as StorageRecord,
- ]);
-
- const { result } = renderHook(() =>
- useStorageCephSectionModel({
- view,
- summary,
- filteredRecords,
- isCephRecord: () => true,
- }),
- );
-
- expect(result.showSummary()).toBe(true);
- });
-});
diff --git a/frontend-modern/src/components/Storage/__tests__/useStoragePageBannerModel.test.ts b/frontend-modern/src/components/Storage/__tests__/useStoragePageBannerModel.test.ts
deleted file mode 100644
index 6b2da8e201..0000000000
--- a/frontend-modern/src/components/Storage/__tests__/useStoragePageBannerModel.test.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { describe, expect, it } from 'vitest';
-import { createRoot } from 'solid-js';
-import { useStoragePageBannerModel } from '@/components/Storage/useStoragePageBannerModel';
-
-describe('useStoragePageBannerModel', () => {
- it('returns canonical banner copy and actions', () => {
- createRoot((dispose) => {
- const reconnecting = useStoragePageBannerModel({
- kind: () => 'reconnecting',
- });
- expect(reconnecting.message()).toBe('Reconnecting to backend data stream…');
- expect(reconnecting.actionLabel()).toBe('Retry now');
-
- const waiting = useStoragePageBannerModel({
- kind: () => 'waiting-for-data',
- });
- expect(waiting.message()).toBe('Waiting for storage data from connected platforms.');
- expect(waiting.actionLabel()).toBeNull();
- dispose();
- });
- });
-});
diff --git a/frontend-modern/src/components/Storage/__tests__/useStoragePageBannersModel.test.ts b/frontend-modern/src/components/Storage/__tests__/useStoragePageBannersModel.test.ts
deleted file mode 100644
index d3ce162594..0000000000
--- a/frontend-modern/src/components/Storage/__tests__/useStoragePageBannersModel.test.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { renderHook } from '@solidjs/testing-library';
-import { createSignal } from 'solid-js';
-import { describe, expect, it } from 'vitest';
-import { useStoragePageBannersModel } from '@/components/Storage/useStoragePageBannersModel';
-
-describe('useStoragePageBannersModel', () => {
- it('keeps reconnect actions only on reconnecting/disconnected banners', () => {
- const [kind] = createSignal<'reconnecting' | 'fetch-error'>('reconnecting');
-
- const { result } = renderHook(() =>
- useStoragePageBannersModel({
- kind,
- }),
- );
-
- expect(result.reconnectActionKind()).toBe('reconnecting');
- });
-});
diff --git a/frontend-modern/src/components/Storage/__tests__/useStoragePageSummary.test.ts b/frontend-modern/src/components/Storage/__tests__/useStoragePageSummary.test.ts
deleted file mode 100644
index b0c3145650..0000000000
--- a/frontend-modern/src/components/Storage/__tests__/useStoragePageSummary.test.ts
+++ /dev/null
@@ -1,171 +0,0 @@
-import { renderHook } from '@solidjs/testing-library';
-import { createSignal } from 'solid-js';
-import { describe, expect, it } from 'vitest';
-import type { Resource } from '@/types/resource';
-import type { StorageRecord } from '@/features/storageBackups/models';
-import { useStoragePageSummary } from '@/components/Storage/useStoragePageSummary';
-
-const makeRecord = (id: string, health: StorageRecord['health']): StorageRecord => ({
- id,
- name: id,
- category: 'pool',
- health,
- location: { label: 'pve1', scope: 'node' },
- capacity: { totalBytes: null, usedBytes: null, freeBytes: null, usagePercent: null },
- capabilities: [],
- source: {
- platform: 'proxmox-pve',
- family: 'virtualization',
- origin: 'resource',
- adapterId: 'test',
- },
- observedAt: Date.now(),
-});
-
-describe('useStoragePageSummary', () => {
- it('derives pool and visible disk counts canonically for the selected node', () => {
- const [filteredRecords] = createSignal<StorageRecord[]>([
- makeRecord('pool-a', 'healthy'),
- makeRecord('pool-b', 'healthy'),
- makeRecord('pool-c', 'healthy'),
- makeRecord('pool-d', 'healthy'),
- ]);
- const [selectedNodeId] = createSignal('node-1');
- const [search] = createSignal('');
- const [sourceFilter] = createSignal('all');
- const [healthFilter] = createSignal('all' as const);
- const [diskRoleFilter] = createSignal('all');
- const [diskGroupFilter] = createSignal('all');
- const [nodeOptions] = createSignal([
- { id: 'node-1', label: 'pve1', aliases: ['pve1.local'] },
- { id: 'node-2', label: 'pve2' },
- ]);
- const [physicalDisks] = createSignal<Resource[]>([
- {
- id: 'disk-1',
- type: 'physical_disk',
- name: '/dev/sda',
- displayName: '/dev/sda',
- platformId: 'cluster-main',
- platformType: 'proxmox-pve',
- sourceType: 'api',
- status: 'online',
- lastSeen: Date.now(),
- parentId: 'pool-1',
- identity: { hostname: 'pve1' },
- canonicalIdentity: { hostname: 'pve1' },
- },
- {
- id: 'disk-2',
- type: 'physical_disk',
- name: '/dev/sdb',
- displayName: '/dev/sdb',
- platformId: 'cluster-main',
- platformType: 'proxmox-pve',
- sourceType: 'api',
- status: 'online',
- lastSeen: Date.now(),
- identity: { hostname: 'pve2' },
- canonicalIdentity: { hostname: 'pve2' },
- },
- ]);
-
- const { result } = renderHook(() =>
- useStoragePageSummary({
- filteredRecords,
- search,
- sourceFilter,
- healthFilter,
- diskRoleFilter,
- diskGroupFilter,
- selectedNodeId,
- nodeOptions,
- physicalDisks,
- }),
- );
-
- expect(result.poolCount()).toBe(4);
- expect(result.diskCount()).toBe(1);
- expect(result.poolsDegraded()).toBe(0);
- expect(result.disksFailing()).toBe(0);
- });
-
- it('does not count Unraid disks with only missing SMART data as needing attention', () => {
- const [filteredRecords] = createSignal<StorageRecord[]>([makeRecord('tower-array', 'healthy')]);
- const [selectedNodeId] = createSignal('tower');
- const [search] = createSignal('');
- const [sourceFilter] = createSignal('all');
- const [healthFilter] = createSignal('all' as const);
- const [diskRoleFilter] = createSignal('all');
- const [diskGroupFilter] = createSignal('all');
- const [nodeOptions] = createSignal([{ id: 'tower', label: 'Tower' }]);
- const [physicalDisks] = createSignal<Resource[]>([
- {
- id: 'tower-disk-spundown',
- type: 'physical_disk',
- name: 'disk1',
- status: 'offline',
- platformType: 'agent',
- parentId: 'tower-array',
- identity: { hostname: 'Tower' },
- canonicalIdentity: { hostname: 'Tower' },
- physicalDisk: {
- devPath: '/dev/sdb',
- model: 'WDC WD60EFRX',
- health: 'UNKNOWN',
- storageRole: 'data',
- storageGroup: 'unraid-array',
- storageState: 'online',
- spunDown: true,
- temperature: 0,
- },
- },
- {
- id: 'tower-disk-errors',
- type: 'physical_disk',
- name: 'disk2',
- status: 'warning',
- platformType: 'agent',
- parentId: 'tower-array',
- identity: { hostname: 'Tower' },
- canonicalIdentity: { hostname: 'Tower' },
- physicalDisk: {
- devPath: '/dev/sdc',
- model: 'WDC WD60EFRX',
- health: 'UNKNOWN',
- storageRole: 'data',
- storageGroup: 'unraid-array',
- storageState: 'online',
- errorCount: 4,
- risk: {
- level: 'warning',
- reasons: [
- {
- code: 'unraid_disk_errors',
- severity: 'warning',
- summary: 'Unraid disk disk2 reports 4 error(s)',
- },
- ],
- },
- },
- },
- ] as Resource[]);
-
- const { result } = renderHook(() =>
- useStoragePageSummary({
- filteredRecords,
- search,
- sourceFilter,
- healthFilter,
- diskRoleFilter,
- diskGroupFilter,
- selectedNodeId,
- nodeOptions,
- physicalDisks,
- }),
- );
-
- expect(result.diskCount()).toBe(2);
- expect(result.disksFailing()).toBe(1);
- });
-});
diff --git a/frontend-modern/src/components/Storage/useStorageCephSectionModel.ts b/frontend-modern/src/components/Storage/useStorageCephSectionModel.ts
deleted file mode 100644
index b519c78d59..0000000000
--- a/frontend-modern/src/components/Storage/useStorageCephSectionModel.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import { createMemo } from 'solid-js';
-import { shouldShowCephSummaryCard } from '@/features/storageBackups/storagePagePresentation';
-import type { CephSummaryStats } from '@/features/storageBackups/cephSummaryPresentation';
-import type { StorageRecord } from '@/features/storageBackups/models';
-
-type UseStorageCephSectionModelOptions = {
- view: () => 'pools' | 'disks';
- summary: () => CephSummaryStats | null;
- filteredRecords: () => StorageRecord[];
- isCephRecord: (record: StorageRecord) => boolean;
-};
-
-export const useStorageCephSectionModel = (options: UseStorageCephSectionModelOptions) => {
- const showSummary = createMemo(() => {
- const summary = options.summary();
- if (!summary) {
- return false;
- }
-
- return shouldShowCephSummaryCard(
- options.view(),
- summary,
- options.filteredRecords(),
- options.isCephRecord,
- );
- });
-
- return {
- showSummary,
- };
-};
diff --git a/frontend-modern/src/components/Storage/useStoragePageBannerModel.ts b/frontend-modern/src/components/Storage/useStoragePageBannerModel.ts
deleted file mode 100644
index 534fd81824..0000000000
--- a/frontend-modern/src/components/Storage/useStoragePageBannerModel.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { createMemo } from 'solid-js';
-import {
- getStoragePageBannerActionLabel,
- getStoragePageBannerMessage,
- type StoragePageBannerKind,
-} from '@/features/storageBackups/storagePagePresentation';
-
-type UseStoragePageBannerModelOptions = {
- kind: () => StoragePageBannerKind;
-};
-
-export const useStoragePageBannerModel = (options: UseStoragePageBannerModelOptions) => {
- const message = createMemo(() => getStoragePageBannerMessage(options.kind()));
- const actionLabel = createMemo(() => getStoragePageBannerActionLabel(options.kind()));
-
- return {
- message,
- actionLabel,
- };
-};
-
diff --git a/frontend-modern/src/components/Storage/useStoragePageBannersModel.ts b/frontend-modern/src/components/Storage/useStoragePageBannersModel.ts
deleted file mode 100644
index 2ff54a28f1..0000000000
--- a/frontend-modern/src/components/Storage/useStoragePageBannersModel.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { createMemo } from 'solid-js';
-import type { StoragePageBannerKind } from '@/features/storageBackups/storagePagePresentation';
-
-type UseStoragePageBannersModelOptions = {
- kind: () => StoragePageBannerKind | null;
-};
-
-export const useStoragePageBannersModel = (options: UseStoragePageBannersModelOptions) => {
- const reconnectActionKind = createMemo<StoragePageBannerKind | null>(() => {
- const kind = options.kind();
- return kind === 'reconnecting' || kind === 'disconnected' ? kind : null;
- });
-
- return {
- reconnectActionKind,
- };
-};
diff --git a/frontend-modern/src/components/Storage/useStoragePageSummary.ts b/frontend-modern/src/components/Storage/useStoragePageSummary.ts
deleted file mode 100644
index cfd8b82687..0000000000
--- a/frontend-modern/src/components/Storage/useStoragePageSummary.ts
+++ /dev/null
@@ -1,85 +0,0 @@
-import { Accessor, createMemo } from 'solid-js';
-import type { Resource } from '@/types/resource';
-import type { StorageHealthFilter, StorageRecord } from '@/features/storageBackups/models';
-import type { StoragePageNodeOption } from './storagePageState';
-import {
- buildPhysicalDiskPresentationDataMap,
- extractPhysicalDiskPresentationData,
- getPhysicalDiskNormalizedHealth,
- matchesPhysicalDiskFilterState,
- matchesPhysicalDiskHealthFilter,
-} from '@/features/storageBackups/diskPresentation';
-import { matchesPhysicalDiskNode } from './diskResourceUtils';
-
-type UseStoragePageSummaryOptions = {
- filteredRecords: Accessor<StorageRecord[]>;
- search: Accessor<string>;
- sourceFilter: Accessor<string>;
- healthFilter: Accessor<StorageHealthFilter>;
- diskRoleFilter: Accessor<string>;
- diskGroupFilter: Accessor<string>;
- selectedNodeId: Accessor<string>;
- nodeOptions: Accessor<StoragePageNodeOption[]>;
- physicalDisks: Accessor<Resource[]>;
-};
-
-const POOL_DEGRADED_HEALTHS = new Set(['warning', 'critical', 'offline']);
-
-export const useStoragePageSummary = (options: UseStoragePageSummaryOptions) => {
- const poolCount = createMemo(() => options.filteredRecords().length);
- const diskDataById = createMemo(() =>
- buildPhysicalDiskPresentationDataMap(options.physicalDisks()),
- );
- const getDiskData = (disk: Resource) =>
- diskDataById().get(disk.id) ?? extractPhysicalDiskPresentationData(disk);
-
- const filteredPhysicalDisks = createMemo(() => {
- const nodeId = options.selectedNodeId();
- const selectedNode =
- nodeId && nodeId !== 'all'
- ? (options.nodeOptions().find((option) => option.id === nodeId) ?? null)
- : null;
-
- return options.physicalDisks().filter((disk) => {
- if (
- selectedNode &&
- !matchesPhysicalDiskNode(disk, {
- id: selectedNode.id,
- name: selectedNode.label,
- instance: selectedNode.instance,
- })
- ) {
- return false;
- }
- return matchesPhysicalDiskFilterState(disk, getDiskData(disk), {
- sourceFilter: options.sourceFilter(),
- healthFilter: options.healthFilter(),
- roleFilter: options.diskRoleFilter(),
- groupFilter: options.diskGroupFilter(),
- searchTerm: options.search(),
- });
- });
- });
-
- const diskCount = createMemo(() => filteredPhysicalDisks().length);
-
- const poolsDegraded = createMemo(
- () =>
- options.filteredRecords().filter((record) => POOL_DEGRADED_HEALTHS.has(record.health)).length,
- );
- const disksFailing = createMemo(() => {
- return filteredPhysicalDisks().filter((disk) =>
- matchesPhysicalDiskHealthFilter(
- getPhysicalDiskNormalizedHealth(disk, getDiskData(disk)),
- 'attention',
- ),
- ).length;
- });
-
- return {
- poolCount,
- diskCount,
- poolsDegraded,
- disksFailing,
- };
-};
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index ee7486c6bb..c4c26ecfea 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -1605,7 +1605,6 @@ describe('shared primitive guardrails', () => {
expect(storagePageControlsSource).toContain('viewOptionsTrailing={');
expect(storagePageControlsSource).toContain('aria-label="Sort by"');
expect(storagePageControlsSource).toContain('aria-label="Sort direction"');
- expect(storagePageControlsSource).toContain('ChartVisibilityToggleButton');
expect(storagePageControlsSource).toContain('onClearAll={handleClearAll}');
expect(storagePageControlsSource).toContain('showClearAll={showClearAll}');
// The component name is StoragePageControls but it must not import or
diff --git a/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx b/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx
index 5a7de52f57..70c8f71d5c 100644
--- a/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx
+++ b/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx
@@ -146,9 +146,6 @@ export function ProxmoxPageSurface() {
</Show>
<Show when={activeTab() === 'storage'}>
<StorageSurface
- embedded
- tableOnly
- showFilterToolbar
forcedSourceFilter={PROXMOX_PLATFORM_FILTER}
suppressNodeFilter
filterAriaLabel="Proxmox storage filters"
diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
index 6544bf8cf8..86b937c2b3 100644
--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
@@ -236,20 +236,12 @@ import storageDetailMetricCardSource from '@/components/Storage/StorageDetailMet
import diskLiveMetricSource from '@/components/Storage/DiskLiveMetric.tsx?raw';
import useDiskLiveMetricModelSource from '@/components/Storage/useDiskLiveMetricModel.ts?raw';
import storagePageControlsSource from '@/components/Storage/StoragePageControls.tsx?raw';
-import storageCephSectionSource from '@/components/Storage/StorageCephSection.tsx?raw';
import storageContentCardSource from '@/components/Storage/StorageContentCard.tsx?raw';
import storagePageSource from '@/components/Storage/Storage.tsx?raw';
-import storagePageBannerSource from '@/components/Storage/StoragePageBanner.tsx?raw';
-import useStoragePageBannerModelSource from '@/components/Storage/useStoragePageBannerModel.ts?raw';
-import storagePageBannersSource from '@/components/Storage/StoragePageBanners.tsx?raw';
-import useStoragePageBannersModelSource from '@/components/Storage/useStoragePageBannersModel.ts?raw';
-import storageSummarySource from '@/components/Storage/useStorageSummaryCharts.ts?raw';
import storageSummaryCacheSource from '@/utils/storageSummaryCache.ts?raw';
-import storagePageSummarySource from '@/components/Storage/StoragePageSummary.tsx?raw';
import storageCephSummaryCardSource from '@/components/Storage/StorageCephSummaryCard.tsx?raw';
import useStorageCephSummaryCardModelSource from '@/components/Storage/useStorageCephSummaryCardModel.ts?raw';
import useStorageContentCardModelSource from '@/components/Storage/useStorageContentCardModel.ts?raw';
-import useStorageCephSectionModelSource from '@/components/Storage/useStorageCephSectionModel.ts?raw';
import useZFSHealthMapModelSource from '@/components/Storage/useZFSHealthMapModel.ts?raw';
import storagePoolsTableSource from '@/components/Storage/StoragePoolsTable.tsx?raw';
import useStoragePoolsTableModelSource from '@/components/Storage/useStoragePoolsTableModel.ts?raw';
@@ -268,7 +260,6 @@ import storagePageDataSource from '@/components/Storage/useStoragePageData.ts?ra
import storagePageModelSource from '@/components/Storage/useStoragePageModel.ts?raw';
import storagePageResourcesSource from '@/components/Storage/useStoragePageResources.ts?raw';
import storagePageStatusHookSource from '@/components/Storage/useStoragePageStatus.ts?raw';
-import storagePageSummaryHookSource from '@/components/Storage/useStoragePageSummary.ts?raw';
import storagePageStateSource from '@/components/Storage/storagePageState.ts?raw';
import storageResourceHighlightSource from '@/components/Storage/useStorageResourceHighlight.ts?raw';
import useStorageModelSource from '@/components/Storage/useStorageModel.ts?raw';
@@ -915,7 +906,6 @@ describe('frontend resource type boundaries', () => {
);
expect(infrastructureSummaryStateSource).not.toContain("getOrgID() || 'default'");
expect(storageSummaryCacheSource).toContain('normalizeOrgScope(getOrgID())');
- expect(storageSummarySource).not.toContain("getOrgID() || 'default'");
expect(guestRowSource).toContain('useGuestRowState');
expect(guestRowSource).toContain("from './GuestRowCells'");
expect(guestRowSource).toContain("from '@/components/shared/TagBadges'");
@@ -1543,10 +1533,7 @@ describe('frontend resource type boundaries', () => {
expect(storagePoolRowSource).not.toContain('const compactIssueSummary = createMemo(() => {');
expect(storagePageSource).toContain("from './storagePageState'");
expect(storagePageSource).toContain('useStoragePageModel');
- expect(storagePageSource).toContain('isStorageRecordCeph');
- expect(storagePageSource).toContain('StorageCephSection');
expect(storagePageSource).toContain('StoragePageControls');
- expect(storagePageSource).toContain('StoragePageSummary');
expect(storagePageSource).not.toContain('const normalizeHealthFilter =');
expect(storagePageSource).not.toContain('const normalizeSortKey =');
expect(storagePageSource).not.toContain('const normalizeGroupKey =');
@@ -1679,8 +1666,6 @@ describe('frontend resource type boundaries', () => {
expect(storagePageModelSource).toContain('useStorageFilterState');
expect(storagePageModelSource).toContain('useStoragePageStatus');
expect(storagePageModelSource).toContain('useStorageResourceHighlight');
- expect(storagePageSummaryHookSource).toContain('export const useStoragePageSummary');
- expect(storagePageSummaryHookSource).toContain('matchesPhysicalDiskNode');
expect(storagePageFiltersSource).toContain('export const useStoragePageFilters');
expect(storagePageFiltersSource).toContain('useStorageRouteState');
expect(storagePageFiltersSource).toContain('buildStorageRouteFields');
@@ -1692,8 +1677,6 @@ describe('frontend resource type boundaries', () => {
expect(storageFilterStateSource).toContain('PHYSICAL_DISK_ALL_ROLES_FILTER_LABEL');
expect(storageFilterStateSource).toContain('PHYSICAL_DISK_ALL_GROUPS_FILTER_LABEL');
expect(storagePageSource).toContain('StorageContentCard');
- expect(storagePageSource).toContain('StoragePageBanners');
- expect(storagePageSource).toContain('StoragePageSummary');
expect(storagePageControlsSource).toContain('FilterBar');
expect(storagePageControlsSource).toContain('Subtabs');
expect(storagePageControlsSource).toContain('STORAGE_VIEW_OPTIONS');
@@ -1721,26 +1704,6 @@ describe('frontend resource type boundaries', () => {
"props.view() === 'pools' ? props.storageFilterGroupBy : undefined",
);
expect(storagePageControlsSource).toContain('const sortDisabled = () => !isPoolsView()');
- expect(storageCephSectionSource).toContain('export const StorageCephSection');
- expect(storageCephSectionSource).toContain('useStorageCephSectionModel');
- expect(storageCephSectionSource).toContain('StorageCephSummaryCard');
- expect(storagePageBannerSource).toContain('useStoragePageBannerModel');
- expect(storagePageBannerSource).toContain('STORAGE_BANNER_ACTION_BUTTON_CLASS');
- expect(storagePageBannerSource).toContain('STORAGE_PAGE_BANNER_ROW_CLASS');
- expect(storagePageBannerSource).not.toContain('const actionLabel = () =>');
- expect(storagePageBannerSource).not.toContain('text-xs text-amber-800 dark:text-amber-200');
- expect(useStoragePageBannerModelSource).toContain('getStoragePageBannerMessage');
- expect(useStoragePageBannerModelSource).toContain('getStoragePageBannerActionLabel');
- expect(storagePageBannersSource).toContain('export const StoragePageBanners');
- expect(storagePageBannersSource).toContain('StoragePageBanner');
- expect(storagePageBannersSource).toContain('useStoragePageBannersModel');
- expect(storagePageBannersSource).not.toContain("props.kind() === 'reconnecting'");
- expect(useStoragePageBannersModelSource).toContain(
- "kind === 'reconnecting' || kind === 'disconnected'",
- );
- expect(storagePageSummarySource).toContain('export const StoragePageSummary');
- expect(storagePageSummarySource).toContain('useStoragePageSummary');
- expect(storagePageSummarySource).toContain('StorageSummary');
expect(storageCephSummaryCardSource).toContain('useStorageCephSummaryCardModel');
expect(storageCephSummaryCardSource).toContain('CEPH_SUMMARY_CARD_GRID_CLASS');
expect(storageCephSummaryCardSource).toContain('CEPH_SUMMARY_CARD_HEALTH_BADGE_CLASS');
@@ -1775,7 +1738,6 @@ describe('frontend resource type boundaries', () => {
);
expect(useStorageContentCardModelSource).toContain('getStorageTableHeading');
expect(useStorageContentCardModelSource).toContain("options.view() === 'disks'");
- expect(useStorageCephSectionModelSource).toContain('shouldShowCephSummaryCard');
expect(storagePoolsTableSource).toContain('export const StoragePoolsTable');
expect(storagePoolsTableSource).toContain('getStoragePoolTableColumns');
expect(storagePoolsTableSource).toContain('getStorageLoadingMessage');
@@ -1829,7 +1791,6 @@ describe('frontend resource type boundaries', () => {
);
expect(storagePageSource).not.toContain('flex flex-wrap items-center justify-between gap-3');
expect(storagePageSource).not.toContain('<Table class="w-full text-xs">');
- expect(storagePageSource).not.toContain('<StoragePageBanner kind=');
expect(storagePageSource).not.toContain('<StorageCephSummaryCard summary=');
expect(storageRowAlertPresentationSource).toContain(
'export const getStorageRowAlertPresentation',