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.

Delete orphaned summary subcomponents from shared and Storage

rcourtman07b75109d366
diff --git a/frontend-modern/src/components/Storage/StorageSummary.tsx b/frontend-modern/src/components/Storage/StorageSummary.tsx
deleted file mode 100644
index bc9858fe1a..0000000000
--- a/frontend-modern/src/components/Storage/StorageSummary.tsx
+++ /dev/null
@@ -1,447 +0,0 @@
-import { Component, Show, createEffect, createMemo, createSignal } from 'solid-js';
-import { InteractiveSparkline } from '@/components/shared/InteractiveSparkline';
-import type { InteractiveSparklineSeries } from '@/components/shared/InteractiveSparkline';
-import {
- useSummaryContextualFocusState,
- type SummaryChartHoverSync,
-} from '@/components/shared/contextualFocus';
-import type { SummarySeriesGroupScope } from '@/components/shared/summaryCardInteraction';
-import { SummaryJumpToRowButton } from '@/components/shared/SummaryJumpToRowButton';
-import { SummaryPanel } from '@/components/shared/SummaryPanel';
-import { SummaryMetricCard } from '@/components/shared/SummaryMetricCard';
-import { SummarySynchronizedReadout } from '@/components/shared/SummarySynchronizedReadout';
-import { buildInteractiveSparklineSynchronizedReadout } from '@/components/shared/interactiveSparklineModel';
-import { type MetricPoint, type TimeRange, type StorageSummaryChartsResponse } from '@/api/charts';
-import {
- SUMMARY_TIME_RANGE_LABEL,
- type SummaryTimeRange,
-} from '@/components/shared/summaryTimeRange';
-import { formatBytes } from '@/utils/format';
-import { getChartSeriesColor } from '@/utils/chartSeriesPresentation';
-
-// ---------------------------------------------------------------------------
-// Props
-// ---------------------------------------------------------------------------
-
-interface StorageSummaryProps {
- poolCount: number;
- diskCount: number;
- poolsDegraded?: number;
- disksFailing?: number;
- data: StorageSummaryChartsResponse | null;
- loaded: boolean;
- fetchFailed: boolean;
- timeRange: SummaryTimeRange;
- onTimeRangeChange?: (range: SummaryTimeRange) => void;
- 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;
-}
-
-// ---------------------------------------------------------------------------
-// Component
-// ---------------------------------------------------------------------------
-
-const StorageSummary: Component<StorageSummaryProps> = (props) => {
- const [localChartHoverSync, setLocalChartHoverSync] = createSignal<SummaryChartHoverSync | null>(
- null,
- );
- const chartHoverSync = () => props.chartHoverSync ?? localChartHoverSync();
- const setChartHoverSync = (value: SummaryChartHoverSync | null) => {
- if (props.chartHoverSync === undefined) {
- setLocalChartHoverSync(value);
- }
- props.onChartHoverSyncChange?.(value);
- };
-
- // ---------------------------------------------------------------------------
- // Series builders
- // ---------------------------------------------------------------------------
-
- const allPoolUsageSeries = createMemo((): InteractiveSparklineSeries[] => {
- const d = props.data;
- if (!d?.pools) return [];
- const entries = Object.entries(d.pools);
- return entries
- .filter(([, pool]) => pool.usage && pool.usage.length >= 2)
- .map(([id, pool], i) => ({
- id,
- name: pool.name || id,
- color: getChartSeriesColor(i),
- data: pool.usage as MetricPoint[],
- }));
- });
-
- const allPoolUsedSeries = createMemo((): InteractiveSparklineSeries[] => {
- const d = props.data;
- if (!d?.pools) return [];
- const entries = Object.entries(d.pools);
- return entries
- .filter(([, pool]) => pool.used && pool.used.length >= 2)
- .map(([id, pool], i) => ({
- id,
- name: pool.name || id,
- color: getChartSeriesColor(i),
- data: pool.used as MetricPoint[],
- }));
- });
-
- const allPoolAvailSeries = createMemo((): InteractiveSparklineSeries[] => {
- const d = props.data;
- if (!d?.pools) return [];
- const entries = Object.entries(d.pools);
- return entries
- .filter(([, pool]) => pool.avail && pool.avail.length >= 2)
- .map(([id, pool], i) => ({
- id,
- name: pool.name || id,
- color: getChartSeriesColor(i),
- data: pool.avail as MetricPoint[],
- }));
- });
-
- const allDiskTempSeries = createMemo((): InteractiveSparklineSeries[] => {
- const d = props.data;
- if (!d?.disks) return [];
- const entries = Object.entries(d.disks);
- return entries
- .filter(([, disk]) => disk.temperature && disk.temperature.length >= 2)
- .map(([id, disk], i) => ({
- id,
- name: disk.name || id,
- color: getChartSeriesColor(i),
- data: disk.temperature as MetricPoint[],
- }));
- });
- const interactiveSummarySeries = createMemo<InteractiveSparklineSeries[]>(() => [
- ...allPoolUsageSeries(),
- ...allPoolUsedSeries(),
- ...allPoolAvailSeries(),
- ...allDiskTempSeries(),
- ]);
- const summaryFocus = useSummaryContextualFocusState({
- chartHoveredSeriesId: () => chartHoverSync()?.seriesId ?? null,
- interactiveSeries: interactiveSummarySeries,
- focusedGroupScope: () => props.focusedGroupScope,
- hoveredGroupScope: () => props.hoveredGroupScope,
- hoveredSeriesId: () => props.hoveredResourceId,
- focusedSeriesId: () => props.focusedResourceId,
- });
-
- createEffect(() => {
- const hovered = chartHoverSync();
- if (!hovered) return;
- if (!summaryFocus.isSeriesIdVisibleInActiveScope(hovered.seriesId)) {
- setChartHoverSync(null);
- }
- });
-
- const poolUsageSeries = createMemo(() =>
- summaryFocus.filterSeriesForActiveScope(allPoolUsageSeries()),
- );
- const poolUsedSeries = createMemo(() =>
- summaryFocus.filterSeriesForActiveScope(allPoolUsedSeries()),
- );
- const poolAvailSeries = createMemo(() =>
- summaryFocus.filterSeriesForActiveScope(allPoolAvailSeries()),
- );
- const diskTempSeries = createMemo(() =>
- summaryFocus.filterSeriesForActiveScope(allDiskTempSeries()),
- );
-
- // Symmetric cross-card scoping: a pool-row hover scopes the three pool
- // charts; a disk-row hover scopes the disk chart. The "foreign" cards
- // fall back to default state instead of dimming, because the hovered
- // entity has no representation in their dataset.
- const poolSeriesIdSet = createMemo(() => {
- const ids = new Set<string>();
- for (const s of allPoolUsageSeries()) if (s.id) ids.add(s.id);
- for (const s of allPoolUsedSeries()) if (s.id) ids.add(s.id);
- for (const s of allPoolAvailSeries()) if (s.id) ids.add(s.id);
- return ids;
- });
- const diskSeriesIdSet = createMemo(() => {
- const ids = new Set<string>();
- for (const s of allDiskTempSeries()) if (s.id) ids.add(s.id);
- return ids;
- });
- type SeriesFamily = 'pool' | 'disk';
- const activeFamily = (): SeriesFamily | null => {
- const id = summaryFocus.activeSeriesId();
- if (!id) return null;
- if (poolSeriesIdSet().has(id)) return 'pool';
- if (diskSeriesIdSet().has(id)) return 'disk';
- return null;
- };
- const interactionStateForFamily = (
- family: SeriesFamily,
- series: InteractiveSparklineSeries[],
- ) => {
- const af = activeFamily();
- if (af && af !== family) return 'default' as const;
- return summaryFocus.interactionStateFor(series);
- };
- const highlightIdForFamily = (family: SeriesFamily) => {
- const af = activeFamily();
- if (af && af !== family) return null;
- return summaryFocus.activeSeriesId();
- };
-
- const hasPoolUsage = () => poolUsageSeries().length > 0;
- const hasDiskTemp = () => diskTempSeries().length > 0;
- const hasPoolUsed = () => poolUsedSeries().length > 0;
- const hasPoolAvail = () => poolAvailSeries().length > 0;
-
- const emptyLabel = () => {
- if (props.fetchFailed) return 'Trend data unavailable';
- if (summaryFocus.activeGroupScope()) return 'No group history yet';
- return 'No history yet';
- };
-
- const rangeLabel = () => SUMMARY_TIME_RANGE_LABEL[props.timeRange] ?? props.timeRange;
-
- const formatTemp = (value: number) => `${value.toFixed(0)}°C`;
-
- const showComponent = () => props.poolCount > 0 || props.diskCount > 0;
- const storageItemCountLabel = () =>
- `${props.poolCount} storage ${props.poolCount === 1 ? 'item' : 'items'}`;
- const storageAttentionLabel = () => {
- const count = props.poolsDegraded ?? 0;
- return `${count} ${count === 1 ? 'needs' : 'need'} attention`;
- };
- const getFocusedSeriesName = (series: InteractiveSparklineSeries[]): string | null =>
- summaryFocus.getActiveSeriesName(series);
- const focusedLabel = (series: InteractiveSparklineSeries[]) => {
- const name = getFocusedSeriesName(series);
- if (!name) return undefined;
- return <span class="text-xs text-muted ml-1.5 truncate">&mdash; {name}</span>;
- };
- const renderSyncedReadout = (
- readout: { empty?: boolean; timestamp: number; value: string } | null,
- ) =>
- readout ? (
- <SummarySynchronizedReadout
- empty={readout.empty}
- timestamp={readout.timestamp}
- value={readout.value}
- />
- ) : undefined;
- const poolUsageSyncedReadout = () =>
- buildInteractiveSparklineSynchronizedReadout({
- hoverSourceKey: 'pool-usage',
- hoverSync: chartHoverSync(),
- series: poolUsageSeries(),
- timeRange: props.timeRange as TimeRange,
- });
- const diskTempSyncedReadout = () =>
- buildInteractiveSparklineSynchronizedReadout({
- formatValue: formatTemp,
- hoverSourceKey: 'disk-temperature',
- hoverSync: chartHoverSync(),
- series: diskTempSeries(),
- timeRange: props.timeRange as TimeRange,
- });
- const poolUsedSyncedReadout = () =>
- buildInteractiveSparklineSynchronizedReadout({
- formatValue: (value) => formatBytes(value),
- hoverSourceKey: 'used-capacity',
- hoverSync: chartHoverSync(),
- series: poolUsedSeries(),
- timeRange: props.timeRange as TimeRange,
- });
- const poolAvailSyncedReadout = () =>
- buildInteractiveSparklineSynchronizedReadout({
- formatValue: (value) => formatBytes(value),
- hoverSourceKey: 'available-space',
- hoverSync: chartHoverSync(),
- series: poolAvailSeries(),
- timeRange: props.timeRange as TimeRange,
- });
-
- return (
- <Show when={showComponent()}>
- <div class="space-y-2">
- <SummaryPanel
- testId="storage-summary"
- headerLeft={
- <>
- <span class="font-medium text-base-content">{storageItemCountLabel()}</span>
- <Show
- when={(props.poolsDegraded ?? 0) > 0 || (props.disksFailing ?? 0) > 0}
- fallback={
- <>
- <Show when={props.poolCount > 0 || props.diskCount > 0}>
- <span class="text-emerald-600 dark:text-emerald-400">all online</span>
- </Show>
- <Show when={props.diskCount > 0}>
- <span class="text-muted">
- {props.diskCount} {props.diskCount === 1 ? 'disk' : 'disks'}
- </span>
- </Show>
- </>
- }
- >
- <Show when={(props.poolsDegraded ?? 0) > 0}>
- <Show
- when={props.onScopeToDegradedPools}
- fallback={
- <span class="text-amber-600 dark:text-amber-400">
- {storageAttentionLabel()}
- </span>
- }
- >
- <button
- type="button"
- onClick={() => props.onScopeToDegradedPools?.()}
- title="Show storage needing attention"
- class="text-amber-600 hover:text-amber-700 hover:underline focus:underline focus:outline-none dark:text-amber-400 dark:hover:text-amber-300"
- >
- {storageAttentionLabel()}
- </button>
- </Show>
- </Show>
- <Show when={(props.disksFailing ?? 0) > 0}>
- <Show
- when={props.onScopeToFailingDisks}
- fallback={
- <span class="text-amber-600 dark:text-amber-400">
- {props.disksFailing}{' '}
- {props.disksFailing === 1 ? 'disk failing' : 'disks failing'}
- </span>
- }
- >
- <button
- type="button"
- onClick={() => props.onScopeToFailingDisks?.()}
- title="Show physical disks"
- class="text-amber-600 hover:text-amber-700 hover:underline focus:underline focus:outline-none dark:text-amber-400 dark:hover:text-amber-300"
- >
- {props.disksFailing}{' '}
- {props.disksFailing === 1 ? 'disk failing' : 'disks failing'}
- </button>
- </Show>
- </Show>
- </Show>
- <Show when={props.showJumpToActiveRow && props.onJumpToActiveRow}>
- <SummaryJumpToRowButton onClick={() => props.onJumpToActiveRow?.()} />
- </Show>
- </>
- }
- timeRange={props.timeRange}
- onTimeRangeChange={props.onTimeRangeChange}
- >
- <SummaryMetricCard
- label="Storage Usage"
- secondaryLabel={focusedLabel(poolUsageSeries())}
- headerValue={renderSyncedReadout(poolUsageSyncedReadout())}
- loaded={props.loaded}
- hasData={hasPoolUsage()}
- emptyMessage={emptyLabel()}
- interactionState={interactionStateForFamily('pool', poolUsageSeries())}
- >
- <InteractiveSparkline
- series={poolUsageSeries()}
- rangeLabel={rangeLabel()}
- timeRange={props.timeRange as TimeRange}
- activeSeriesDisplay="isolate"
- yMode="percent"
- highlightNearestSeriesOnHover
- hoverSourceKey="pool-usage"
- hoverSync={chartHoverSync()}
- highlightSeriesId={highlightIdForFamily('pool')}
- interactionState={interactionStateForFamily('pool', poolUsageSeries())}
- onHoverSyncChange={setChartHoverSync}
- />
- </SummaryMetricCard>
-
- <SummaryMetricCard
- label="Disk Temperature"
- secondaryLabel={focusedLabel(diskTempSeries())}
- headerValue={renderSyncedReadout(diskTempSyncedReadout())}
- loaded={props.loaded}
- hasData={hasDiskTemp()}
- emptyMessage={emptyLabel()}
- interactionState={interactionStateForFamily('disk', diskTempSeries())}
- >
- <InteractiveSparkline
- series={diskTempSeries()}
- rangeLabel={rangeLabel()}
- timeRange={props.timeRange as TimeRange}
- activeSeriesDisplay="isolate"
- yMode="auto"
- formatValue={formatTemp}
- formatTopLabel={(max) => `${max.toFixed(0)}°C`}
- highlightNearestSeriesOnHover
- hoverSourceKey="disk-temperature"
- hoverSync={chartHoverSync()}
- highlightSeriesId={highlightIdForFamily('disk')}
- interactionState={interactionStateForFamily('disk', diskTempSeries())}
- onHoverSyncChange={setChartHoverSync}
- />
- </SummaryMetricCard>
-
- <SummaryMetricCard
- label="Used Capacity"
- secondaryLabel={focusedLabel(poolUsedSeries())}
- headerValue={renderSyncedReadout(poolUsedSyncedReadout())}
- loaded={props.loaded}
- hasData={hasPoolUsed()}
- emptyMessage={emptyLabel()}
- interactionState={interactionStateForFamily('pool', poolUsedSeries())}
- >
- <InteractiveSparkline
- series={poolUsedSeries()}
- rangeLabel={rangeLabel()}
- timeRange={props.timeRange as TimeRange}
- activeSeriesDisplay="isolate"
- yMode="auto"
- formatValue={(v) => formatBytes(v)}
- formatTopLabel={(max) => formatBytes(max)}
- highlightNearestSeriesOnHover
- hoverSourceKey="used-capacity"
- hoverSync={chartHoverSync()}
- highlightSeriesId={highlightIdForFamily('pool')}
- interactionState={interactionStateForFamily('pool', poolUsedSeries())}
- onHoverSyncChange={setChartHoverSync}
- />
- </SummaryMetricCard>
-
- <SummaryMetricCard
- label="Available Space"
- secondaryLabel={focusedLabel(poolAvailSeries())}
- headerValue={renderSyncedReadout(poolAvailSyncedReadout())}
- loaded={props.loaded}
- hasData={hasPoolAvail()}
- emptyMessage={emptyLabel()}
- interactionState={interactionStateForFamily('pool', poolAvailSeries())}
- >
- <InteractiveSparkline
- series={poolAvailSeries()}
- rangeLabel={rangeLabel()}
- timeRange={props.timeRange as TimeRange}
- activeSeriesDisplay="isolate"
- yMode="auto"
- formatValue={(v) => formatBytes(v)}
- formatTopLabel={(max) => formatBytes(max)}
- highlightNearestSeriesOnHover
- hoverSourceKey="available-space"
- hoverSync={chartHoverSync()}
- highlightSeriesId={highlightIdForFamily('pool')}
- interactionState={interactionStateForFamily('pool', poolAvailSeries())}
- onHoverSyncChange={setChartHoverSync}
- />
- </SummaryMetricCard>
- </SummaryPanel>
- </div>
- </Show>
- );
-};
-
-export default StorageSummary;
diff --git a/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx b/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
index 4d49ccb291..8f970c3a9e 100644
--- a/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
+++ b/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
@@ -1,7 +1,6 @@
import { cleanup, fireEvent, render, screen, waitFor, within } from '@solidjs/testing-library';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { ChartsAPI } from '@/api/charts';
-import StorageSummary from '@/components/Storage/StorageSummary';
import storageSummarySource from '@/components/Storage/useStorageSummaryCharts.ts?raw';
import storageSummaryCacheSource from '@/utils/storageSummaryCache.ts?raw';
import type { Alert } from '@/types/api';
@@ -983,113 +982,6 @@ describe('Storage', () => {
});
});
- it('shows compact synchronized readouts on sibling storage cards without duplicating the source card tooltip', 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: 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,
- },
- });
-
- render(() => (
- <StorageSummary
- poolCount={2}
- diskCount={0}
- data={{
- 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,
- },
- }}
- loaded
- fetchFailed={false}
- timeRange="1h"
- chartHoverSync={{
- sourceKey: 'pool-usage',
- seriesId: 'pool:beta',
- timestamp: Date.now(),
- }}
- />
- ));
-
- await screen.findByTestId('storage-summary');
-
- await waitFor(() => {
- const readouts = document.querySelectorAll('[data-summary-sync-readout="true"]');
- expect(readouts).toHaveLength(2);
- for (const readout of readouts) {
- expect(readout.getAttribute('data-summary-sync-empty')).toBe('false');
- expect(readout.getAttribute('data-summary-sync-timestamp')).not.toBe('');
- }
- });
-
- storageSummarySpy.mockRestore();
- });
-
it('restores canonical TrueNAS source filters from the storage route', async () => {
nodeResources = [
{
diff --git a/frontend-modern/src/components/Storage/__tests__/StorageSummary.test.tsx b/frontend-modern/src/components/Storage/__tests__/StorageSummary.test.tsx
deleted file mode 100644
index 59049dac1d..0000000000
--- a/frontend-modern/src/components/Storage/__tests__/StorageSummary.test.tsx
+++ /dev/null
@@ -1,262 +0,0 @@
-import { cleanup, render, screen, waitFor } from '@solidjs/testing-library';
-import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
-
-import StorageSummary from '../StorageSummary';
-import type { SummarySeriesGroupScope } from '@/components/shared/summaryCardInteraction';
-
-const mockGetStorageSummaryCharts = vi.fn();
-
-vi.mock('@/api/charts', async () => {
- const actual = await vi.importActual<typeof import('@/api/charts')>('@/api/charts');
- return {
- ...actual,
- ChartsAPI: {
- ...actual.ChartsAPI,
- getStorageSummaryCharts: (...args: unknown[]) => mockGetStorageSummaryCharts(...args),
- },
- };
-});
-
-vi.mock('@/utils/apiClient', async () => {
- const actual = await vi.importActual<typeof import('@/utils/apiClient')>('@/utils/apiClient');
- return {
- ...actual,
- getOrgID: () => 'default',
- };
-});
-
-vi.mock('@/components/shared/InteractiveSparkline', () => ({
- InteractiveSparkline: (props: {
- series?: Array<{ id?: string; name?: string; data?: Array<unknown> }>;
- highlightSeriesId?: string | null;
- interactionState?: string;
- activeSeriesDisplay?: string;
- hoverSourceKey?: string;
- hoverSync?: { seriesId: string } | null;
- onHoverSyncChange?: (
- value: {
- sourceKey: string;
- seriesId: string;
- timestamp: number;
- } | null,
- ) => void;
- }) => {
- const series = props.series ?? [];
- const triggerHover = () => {
- const seriesId = series[0]?.id;
- if (!props.onHoverSyncChange || !seriesId || !props.hoverSourceKey) {
- return;
- }
- props.onHoverSyncChange({
- sourceKey: props.hoverSourceKey,
- seriesId,
- timestamp: Date.now(),
- });
- };
- return (
- <>
- <button
- type="button"
- data-testid={`chart-hover-${props.hoverSourceKey || 'unknown'}`}
- onClick={triggerHover}
- />
- <div
- data-testid="sparkline"
- data-series-count={series.length}
- data-series-ids={series.map((current) => current.id || '').join('|')}
- data-highlight-series-id={props.highlightSeriesId || ''}
- data-hover-source-key={props.hoverSourceKey || ''}
- data-hover-sync-series-id={props.hoverSync?.seriesId || ''}
- data-interaction-state={props.interactionState || 'default'}
- data-active-series-display={props.activeSeriesDisplay || ''}
- />
- </>
- );
- },
-}));
-
-describe('StorageSummary', () => {
- const now = Date.now();
- const twoPointSeries = [
- { timestamp: now - 60_000, value: 45 },
- { timestamp: now, value: 47 },
- ];
- const buildSummaryData = (overrides?: Record<string, unknown>) => ({
- pools: {},
- disks: {},
- stats: {
- oldestDataTimestamp: now - 60_000,
- },
- ...(overrides ?? {}),
- });
-
- beforeEach(() => {
- mockGetStorageSummaryCharts.mockReset();
- localStorage.clear();
- });
-
- afterEach(() => {
- cleanup();
- });
-
- it('keeps storage summary series page-scoped when a focused resource is selected', async () => {
- const data = buildSummaryData({
- pools: {
- 'pool:alpha': {
- name: 'Alpha Pool',
- usage: twoPointSeries,
- used: twoPointSeries,
- avail: twoPointSeries,
- },
- 'pool:beta': {
- name: 'Beta Pool',
- usage: twoPointSeries,
- used: twoPointSeries,
- avail: twoPointSeries,
- },
- },
- });
-
- render(() => (
- <StorageSummary
- poolCount={2}
- diskCount={0}
- data={data}
- loaded
- fetchFailed={false}
- timeRange="1h"
- focusedResourceId="pool:alpha"
- />
- ));
-
- await waitFor(() => {
- const sparklines = screen.getAllByTestId('sparkline');
- expect(sparklines).toHaveLength(3);
- for (const sparkline of sparklines) {
- expect(sparkline.getAttribute('data-series-count')).toBe('2');
- expect(sparkline.getAttribute('data-highlight-series-id')).toBe('pool:alpha');
- expect(sparkline.getAttribute('data-active-series-display')).toBe('isolate');
- }
- });
- });
-
- it('treats chart hover as the shared active storage entity across cards', async () => {
- const data = buildSummaryData({
- pools: {
- 'pool:alpha': {
- name: 'Alpha Pool',
- usage: twoPointSeries,
- used: twoPointSeries,
- avail: twoPointSeries,
- },
- 'pool:beta': {
- name: 'Beta Pool',
- usage: twoPointSeries,
- used: twoPointSeries,
- avail: twoPointSeries,
- },
- },
- disks: {
- 'disk:serial-1': {
- name: 'Disk 1',
- temperature: twoPointSeries,
- },
- },
- });
-
- render(() => (
- <StorageSummary
- poolCount={2}
- diskCount={1}
- data={data}
- loaded
- fetchFailed={false}
- timeRange="1h"
- />
- ));
-
- await waitFor(() => {
- expect(screen.getAllByTestId('sparkline')).toHaveLength(4);
- });
-
- screen.getByTestId('chart-hover-pool-usage').click();
-
- await waitFor(() => {
- const sparklines = screen.getAllByTestId('sparkline');
- const poolCards = sparklines.filter((sparkline) =>
- ['pool-usage', 'used-capacity', 'available-space'].includes(
- sparkline.getAttribute('data-hover-source-key') || '',
- ),
- );
- const diskTempCard = sparklines.find(
- (sparkline) => sparkline.getAttribute('data-hover-source-key') === 'disk-temperature',
- );
-
- expect(poolCards).toHaveLength(3);
- for (const sparkline of sparklines) {
- expect(sparkline.getAttribute('data-hover-sync-series-id')).toBe('pool:alpha');
- }
- for (const sparkline of poolCards) {
- expect(sparkline.getAttribute('data-highlight-series-id')).toBe('pool:alpha');
- expect(sparkline.getAttribute('data-interaction-state')).toBe('active');
- }
- expect(diskTempCard?.getAttribute('data-highlight-series-id') ?? '').toBe('');
- expect(diskTempCard?.getAttribute('data-interaction-state')).toBe('default');
- });
- });
-
- it('filters pool summary cards to the hovered storage group scope', async () => {
- const poolIds = ['pool:alpha', 'pool:beta', 'pool:gamma'];
- const hoveredGroupScope: SummarySeriesGroupScope = {
- id: 'storage:node:pve1',
- label: 'pve1 (2 storage items)',
- seriesIds: poolIds.slice(0, 2),
- };
- const data = buildSummaryData({
- pools: {
- 'pool:alpha': {
- name: 'Alpha Pool',
- usage: twoPointSeries,
- used: twoPointSeries,
- avail: twoPointSeries,
- },
- 'pool:beta': {
- name: 'Beta Pool',
- usage: twoPointSeries,
- used: twoPointSeries,
- avail: twoPointSeries,
- },
- 'pool:gamma': {
- name: 'Gamma Pool',
- usage: twoPointSeries,
- used: twoPointSeries,
- avail: twoPointSeries,
- },
- },
- });
-
- render(() => (
- <StorageSummary
- poolCount={3}
- diskCount={0}
- data={data}
- loaded
- fetchFailed={false}
- timeRange="1h"
- hoveredGroupScope={hoveredGroupScope}
- hoveredResourceId="pool:alpha"
- />
- ));
-
- await waitFor(() => {
- const sparklines = screen.getAllByTestId('sparkline');
- expect(sparklines).toHaveLength(3);
- for (const sparkline of sparklines) {
- expect(sparkline.getAttribute('data-series-count')).toBe('2');
- expect(sparkline.getAttribute('data-series-ids')).toBe('pool:alpha|pool:beta');
- expect(sparkline.getAttribute('data-highlight-series-id')).toBe('pool:alpha');
- expect(sparkline.getAttribute('data-interaction-state')).toBe('active');
- }
- });
- });
-});
diff --git a/frontend-modern/src/components/shared/InfrastructureSummaryTable.tsx b/frontend-modern/src/components/shared/InfrastructureSummaryTable.tsx
deleted file mode 100644
index 9fc838e00e..0000000000
--- a/frontend-modern/src/components/shared/InfrastructureSummaryTable.tsx
+++ /dev/null
@@ -1,140 +0,0 @@
-import { For, Show } from 'solid-js';
-import type { Component } from 'solid-js';
-import { Card } from '@/components/shared/Card';
-import {
- Table,
- TableBody,
- TableHead,
- TableHeader,
- TableRow,
-} from '@/components/shared/Table';
-import { InfrastructureSummaryTableRow } from './InfrastructureSummaryTableRow';
-import type { InfrastructureSummaryTableProps } from './infrastructureSummaryTableModel';
-import { useInfrastructureSummaryTableState } from './useInfrastructureSummaryTableState';
-
-export const InfrastructureSummaryTable: Component<InfrastructureSummaryTableProps> = (props) => {
- const table = useInfrastructureSummaryTableState(props);
-
- const thClassBase =
- 'px-1.5 sm:px-2 py-0.5 text-[11px] sm:text-xs font-medium uppercase tracking-wider cursor-pointer hover:bg-surface-hover whitespace-nowrap';
- const thClass = `${thClassBase} text-center`;
-
- return (
- <Card padding="none" tone="card" class="mb-4 overflow-hidden">
- <Table
- class="w-full border-collapse whitespace-nowrap"
- style={{ 'table-layout': 'fixed', 'min-width': '800px' }}
- >
- <TableHeader>
- <TableRow class="bg-surface-alt text-muted border-b border-border">
- <TableHead class={`${thClassBase} text-left pl-3`} onClick={() => table.handleSort('name')}>
- {props.currentTab === 'recovery' ? 'Node / PBS' : 'Node'}{' '}
- {table.renderSortIndicator('name')}
- </TableHead>
-
- <TableHead
- class={thClass}
- style={{ width: '80px', 'min-width': '80px', 'max-width': '80px' }}
- onClick={() => table.handleSort('uptime')}
- >
- Uptime {table.renderSortIndicator('uptime')}
- </TableHead>
- <TableHead
- class={thClass}
- style={
- table.isMobile()
- ? { 'min-width': '80px' }
- : { 'min-width': '140px', 'max-width': '180px' }
- }
- onClick={() => table.handleSort('cpu')}
- >
- CPU {table.renderSortIndicator('cpu')}
- </TableHead>
- <TableHead
- class={thClass}
- style={
- table.isMobile()
- ? { 'min-width': '80px' }
- : { 'min-width': '140px', 'max-width': '180px' }
- }
- onClick={() => table.handleSort('memory')}
- >
- Memory {table.renderSortIndicator('memory')}
- </TableHead>
- <TableHead
- class={thClass}
- style={
- table.isMobile()
- ? { 'min-width': '80px' }
- : { 'min-width': '140px', 'max-width': '180px' }
- }
- onClick={() => table.handleSort('disk')}
- >
- Disk {table.renderSortIndicator('disk')}
- </TableHead>
- <Show when={table.hasAnyTemperatureData()}>
- <TableHead
- class={thClass}
- style={{ width: '60px', 'min-width': '60px', 'max-width': '60px' }}
- onClick={() => table.handleSort('temperature')}
- >
- Temp {table.renderSortIndicator('temperature')}
- </TableHead>
- </Show>
- <Show when={props.currentTab === 'workloads'}>
- <TableHead
- class={thClass}
- style={{ width: '50px', 'min-width': '50px', 'max-width': '50px' }}
- onClick={() => table.handleSort('vmCount')}
- >
- VMs {table.renderSortIndicator('vmCount')}
- </TableHead>
- <TableHead
- class={thClass}
- style={{ width: '50px', 'min-width': '50px', 'max-width': '50px' }}
- onClick={() => table.handleSort('containerCount')}
- >
- CTs {table.renderSortIndicator('containerCount')}
- </TableHead>
- </Show>
- <Show when={props.currentTab === 'storage'}>
- <TableHead
- class={thClass}
- style={{ width: '70px', 'min-width': '70px', 'max-width': '70px' }}
- onClick={() => table.handleSort('storageCount')}
- >
- Storage {table.renderSortIndicator('storageCount')}
- </TableHead>
- <TableHead
- class={thClass}
- style={{ width: '60px', 'min-width': '60px', 'max-width': '60px' }}
- onClick={() => table.handleSort('diskCount')}
- >
- Disks {table.renderSortIndicator('diskCount')}
- </TableHead>
- </Show>
- <Show when={props.currentTab === 'recovery'}>
- <TableHead
- class={thClass}
- style={{ width: '70px', 'min-width': '70px', 'max-width': '70px' }}
- onClick={() => table.handleSort('backupCount')}
- >
- Recovery {table.renderSortIndicator('backupCount')}
- </TableHead>
- </Show>
- <TableHead
- class={thClass}
- style={{ width: '28px', 'min-width': '28px', 'max-width': '28px' }}
- />
- </TableRow>
- </TableHeader>
-
- <TableBody class="divide-y divide-border">
- <For each={table.sortedItems()}>
- {(item) => <InfrastructureSummaryTableRow item={item} table={table} tableProps={props} />}
- </For>
- </TableBody>
- </Table>
- </Card>
- );
-};
diff --git a/frontend-modern/src/components/shared/InfrastructureSummaryTableRow.tsx b/frontend-modern/src/components/shared/InfrastructureSummaryTableRow.tsx
deleted file mode 100644
index c402df3151..0000000000
--- a/frontend-modern/src/components/shared/InfrastructureSummaryTableRow.tsx
+++ /dev/null
@@ -1,542 +0,0 @@
-import { Show, Suspense, createMemo, lazy } from 'solid-js';
-import type { Component } from 'solid-js';
-import type { Agent, Node, PBSInstance } from '@/types/api';
-import { formatBytes, formatUptime } from '@/utils/format';
-import { getAlertStyles } from '@/utils/alerts';
-import { getNodeDisplayName, hasAlternateDisplayName } from '@/utils/nodes';
-import { formatTemperature } from '@/utils/temperature';
-import { StatusDot } from '@/components/shared/StatusDot';
-import { ResponsiveMetricCell } from '@/components/shared/responsive';
-import { EnhancedCPUBar } from '@/components/Workloads/EnhancedCPUBar';
-import { StackedMemoryBar } from '@/components/Workloads/StackedMemoryBar';
-import { StackedDiskBar } from '@/components/Workloads/StackedDiskBar';
-import { TemperatureGauge } from '@/components/shared/TemperatureGauge';
-import { getNodeStatusIndicator, getPBSStatusIndicator } from '@/utils/status';
-import { TableCell, TableRow } from '@/components/shared/Table';
-import {
- getInfrastructureSummaryCountValue,
- getInfrastructureSummaryCpuPercent,
- getInfrastructureSummaryCpuTemperatureValue,
- getInfrastructureSummaryDiskPercent,
- getInfrastructureSummaryDiskSublabel,
- getInfrastructureSummaryMemoryPercent,
- getInfrastructureSummaryMetricsKey,
- isInfrastructureSummaryItemOnline,
- isPVE,
- resolveInfrastructureSummaryLinkedAgent,
- type InfrastructureSummaryTableProps,
- type TableItem,
-} from './infrastructureSummaryTableModel';
-import type { InfrastructureSummaryTableState } from './useInfrastructureSummaryTableState';
-
-const InfrastructureDetailsDrawer = lazy(() =>
- import('./InfrastructureDetailsDrawer').then((module) => ({
- default: module.InfrastructureDetailsDrawer,
- })),
-);
-
-const tdClass = 'px-2 py-1 align-middle';
-const metricColumnStyle = { 'min-width': '140px', 'max-width': '180px' } as const;
-
-interface InfrastructureSummaryTableRowProps {
- item: TableItem;
- table: InfrastructureSummaryTableState;
- tableProps: InfrastructureSummaryTableProps;
-}
-
-export const InfrastructureSummaryTableRow: Component<InfrastructureSummaryTableRowProps> = (
- props,
-) => {
- const isPVEItem = isPVE(props.item);
- const isPBSItem = !isPVEItem;
- const node = () => (isPVEItem ? (props.item as Node) : null);
- const pbs = () => (isPBSItem ? (props.item as PBSInstance) : null);
- const pendingUpdates = createMemo(() => node()?.pendingUpdates);
- const online = createMemo(() => isInfrastructureSummaryItemOnline(props.item));
- const nodeId = () => (isPVEItem ? node()!.id : pbs()!.name);
- const resourceId = () => (isPVEItem ? node()!.id || node()!.name : pbs()!.id || pbs()!.name);
- const isSelected = createMemo(() => props.tableProps.selectedNode === nodeId());
- const isExpanded = createMemo(() => props.table.isExpandedNode(nodeId()));
-
- const statusIndicator = createMemo(() =>
- isPVEItem
- ? getNodeStatusIndicator(node() as Node)
- : getPBSStatusIndicator(pbs() as PBSInstance),
- );
- const cpuPercentValue = createMemo(() => getInfrastructureSummaryCpuPercent(props.item));
- const memoryPercentValue = createMemo(() => getInfrastructureSummaryMemoryPercent(props.item));
- const diskPercentValue = createMemo(() => getInfrastructureSummaryDiskPercent(props.item));
- const diskSublabel = createMemo(() => getInfrastructureSummaryDiskSublabel(props.item));
- const cpuTemperatureValue = createMemo(() =>
- getInfrastructureSummaryCpuTemperatureValue(props.item),
- );
- const uptimeValue = createMemo(() => props.item.uptime ?? 0);
- const displayName = () => (isPVEItem ? getNodeDisplayName(node() as Node) : pbs()!.name);
- const showActualName = () => isPVEItem && hasAlternateDisplayName(node() as Node);
- const linkedAgentForDrawer = (): Agent | undefined =>
- isPVEItem && node()
- ? resolveInfrastructureSummaryLinkedAgent(node() as Node, props.tableProps.agents)
- : undefined;
- const metricsKey = createMemo(() => getInfrastructureSummaryMetricsKey(props.item));
- const alertThresholdScope = createMemo((): 'node' | 'pbs' => (isPVEItem ? 'node' : 'pbs'));
- const cpuThresholds = createMemo(() =>
- props.table.getMetricThresholds(alertThresholdScope(), 'cpu', resourceId()),
- );
- const memoryThresholds = createMemo(() =>
- props.table.getMetricThresholds(alertThresholdScope(), 'memory', resourceId()),
- );
- const diskThresholds = createMemo(() =>
- props.table.getMetricThresholds(alertThresholdScope(), 'disk', resourceId()),
- );
- const temperatureThresholds = createMemo(() =>
- isPVEItem ? props.table.getMetricThresholds('node', 'temperature', resourceId()) : null,
- );
- const alertStyles = createMemo(() =>
- getAlertStyles(resourceId(), props.table.activeAlerts, props.table.alertsEnabled()),
- );
- const showAlertHighlight = createMemo(() => alertStyles().hasUnacknowledgedAlert && online());
-
- const rowStyle = createMemo(() => {
- const styles: Record<string, string> = {};
- const shadows: string[] = [];
-
- if (showAlertHighlight()) {
- const color = alertStyles().severity === 'critical' ? '#ef4444' : '#eab308';
- shadows.push(`inset 4px 0 0 0 ${color}`);
- }
-
- if (isSelected()) {
- shadows.push('0 0 0 1px rgba(59, 130, 246, 0.5)');
- shadows.push('0 2px 4px -1px rgba(0, 0, 0, 0.1)');
- }
-
- if (shadows.length > 0) {
- styles['box-shadow'] = shadows.join(', ');
- }
-
- return styles;
- });
-
- const rowClass = createMemo(() => {
- const baseHover = 'cursor-pointer transition-all duration-200 relative hover:shadow-sm group';
-
- if (isSelected()) {
- return `${baseHover} z-10 bg-blue-50 dark:bg-blue-900`;
- }
-
- if (showAlertHighlight()) {
- const alertBg =
- alertStyles().severity === 'critical'
- ? 'bg-red-50 dark:bg-red-950'
- : 'bg-yellow-50 dark:bg-yellow-950';
- return `${baseHover} ${alertBg}`;
- }
-
- let className = baseHover;
- if (props.tableProps.selectedNode && props.tableProps.selectedNode !== nodeId()) {
- className += ' opacity-50 hover:opacity-80';
- }
- if (!online()) {
- className += ' opacity-60';
- }
- return className;
- });
-
- return (
- <>
- <TableRow
- class={rowClass()}
- style={{ ...rowStyle(), 'min-height': '36px' }}
- onClick={() => props.tableProps.onNodeClick(nodeId(), isPVEItem ? 'pve' : 'pbs')}
- >
- <TableCell
- class={`pr-2 py-1 align-middle overflow-hidden ${showAlertHighlight() ? 'pl-4' : 'pl-3'}`}
- >
- <div class="flex items-center gap-1.5 min-w-0">
- <Show when={isPVEItem}>
- <div
- class={`cursor-pointer transition-transform duration-200 ${isExpanded() ? 'rotate-90' : ''}`}
- onClick={(event) => props.table.toggleNodeExpand(nodeId(), event)}
- >
- <svg
- class="w-3.5 h-3.5 hover:text-base-content"
- fill="none"
- viewBox="0 0 24 24"
- stroke="currentColor"
- >
- <path
- stroke-linecap="round"
- stroke-linejoin="round"
- stroke-width="2"
- d="M9 5l7 7-7 7"
- />
- </svg>
- </div>
- </Show>
- <StatusDot
- variant={statusIndicator().variant}
- title={statusIndicator().label}
- ariaLabel={statusIndicator().label}
- size="xs"
- />
- <span
- class="font-medium text-[11px] text-base-content whitespace-nowrap select-text"
- title={displayName()}
- >
- {displayName()}
- </span>
- <Show when={showActualName()}>
- <span class="text-[9px] text-muted whitespace-nowrap">({node()!.name})</span>
- </Show>
- <div class="hidden xl:flex items-center gap-1.5 ml-1 flex-shrink min-w-0 overflow-hidden">
- <Show when={isPVEItem}>
- <span class="text-[9px] px-1 py-0 rounded font-medium bg-orange-100 text-orange-700 dark:bg-orange-900 dark:text-orange-400">
- PVE
- </span>
- </Show>
- <Show when={isPVEItem && node()!.pveVersion}>
- <span class="text-[9px] text-muted whitespace-nowrap">
- v{node()!.pveVersion.split('/')[1] || node()!.pveVersion}
- </span>
- </Show>
- <Show when={isPVEItem && node()!.isClusterMember !== undefined}>
- <span
- class={`text-[9px] px-1 py-0 rounded font-medium whitespace-nowrap ${
- node()!.isClusterMember
- ? 'bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-400'
- : 'bg-surface-alt text-muted'
- }`}
- >
- {node()!.isClusterMember ? node()!.clusterName : 'Standalone'}
- </span>
- </Show>
- <Show when={isPVEItem && node()!.linkedAgentId}>
- <span
- class="text-[9px] px-1 py-0 rounded font-medium whitespace-nowrap bg-emerald-100 text-emerald-700 dark:bg-emerald-900 dark:text-emerald-400"
- title="Pulse agent installed for enhanced metrics"
- >
- +Agent
- </span>
- </Show>
- <Show
- when={
- isPVEItem &&
- online() &&
- pendingUpdates() !== undefined &&
- (pendingUpdates() ?? 0) > 0
- }
- >
- <span
- class={`text-[9px] px-1 py-0 rounded font-medium whitespace-nowrap ${
- (pendingUpdates() ?? 0) >= 10
- ? 'bg-orange-100 text-orange-700 dark:bg-orange-900 dark:text-orange-400'
- : 'bg-yellow-100 text-yellow-700 dark:bg-yellow-900 dark:text-yellow-400'
- }`}
- title={`${pendingUpdates()} pending apt update${pendingUpdates() !== 1 ? 's' : ''}`}
- >
- {pendingUpdates()} updates
- </span>
- </Show>
- <Show when={isPBSItem}>
- <span class="text-[9px] px-1 py-0 rounded font-medium bg-teal-100 text-teal-700 dark:bg-teal-900 dark:text-teal-400">
- PBS
- </span>
- </Show>
- <Show when={isPBSItem && pbs()!.version}>
- <span class="text-[9px] text-muted whitespace-nowrap">v{pbs()!.version}</span>
- </Show>
- </div>
- </div>
- </TableCell>
-
- <TableCell class={tdClass}>
- <div class="flex justify-center">
- <span
- class={`text-xs whitespace-nowrap ${
- isPVEItem && uptimeValue() < 3600 ? 'text-orange-500' : 'text-muted'
- }`}
- >
- <Show when={online() && uptimeValue()} fallback="-">
- <Show when={props.table.isMobile()} fallback={formatUptime(uptimeValue())}>
- {formatUptime(uptimeValue(), true)}
- </Show>
- </Show>
- </span>
- </div>
- </TableCell>
-
- <TableCell
- class={tdClass}
- style={props.table.isMobile() ? { 'min-width': '80px' } : metricColumnStyle}
- >
- <div class="h-5">
- <EnhancedCPUBar
- usage={cpuPercentValue()}
- loadAverage={isPVEItem ? node()!.loadAverage?.[0] : undefined}
- cores={
- props.table.isMobile() ? undefined : isPVEItem ? node()!.cpuInfo?.cores : undefined
- }
- model={isPVEItem ? node()!.cpuInfo?.model : undefined}
- resourceId={metricsKey()}
- thresholds={cpuThresholds()}
- />
- </div>
- </TableCell>
-
- <TableCell
- class={tdClass}
- style={props.table.isMobile() ? { 'min-width': '80px' } : metricColumnStyle}
- >
- <div class="h-5">
- <Show
- when={isPVEItem}
- fallback={
- <ResponsiveMetricCell
- value={memoryPercentValue()}
- type="memory"
- resourceId={metricsKey()}
- sublabel={
- pbs()!.memoryTotal
- ? `${formatBytes(pbs()!.memoryUsed)}/${formatBytes(pbs()!.memoryTotal)}`
- : undefined
- }
- isRunning={online()}
- showMobile={false}
- thresholds={memoryThresholds()}
- />
- }
- >
- <StackedMemoryBar
- used={node()!.memory?.used || 0}
- total={node()!.memory?.total || 0}
- balloon={node()!.memory?.balloon || 0}
- swapUsed={node()!.memory?.swapUsed || 0}
- swapTotal={node()!.memory?.swapTotal || 0}
- resourceId={metricsKey()}
- thresholds={memoryThresholds()}
- />
- </Show>
- </div>
- </TableCell>
-
- <TableCell
- class={tdClass}
- style={props.table.isMobile() ? { 'min-width': '80px' } : metricColumnStyle}
- >
- <div class="h-5">
- <Show
- when={isPVEItem}
- fallback={
- <ResponsiveMetricCell
- value={diskPercentValue()}
- type="disk"
- resourceId={metricsKey()}
- sublabel={diskSublabel()}
- isRunning={online()}
- showMobile={false}
- thresholds={diskThresholds()}
- />
- }
- >
- <StackedDiskBar
- aggregateDisk={{
- total: node()!.disk?.total || 0,
- used: node()!.disk?.used || 0,
- free: (node()!.disk?.total || 0) - (node()!.disk?.used || 0),
- usage: node()!.disk?.total ? node()!.disk!.used / node()!.disk!.total : 0,
- }}
- thresholds={diskThresholds()}
- />
- </Show>
- </div>
- </TableCell>
-
- <Show when={props.table.hasAnyTemperatureData()}>
- <TableCell class={tdClass}>
- <div class="flex justify-center">
- <Show
- when={
- online() &&
- isPVEItem &&
- cpuTemperatureValue() !== null &&
- (node()!.temperature?.hasCPU ??
- node()!.temperature?.hasGPU ??
- node()!.temperature?.available) &&
- props.table.isTemperatureMonitoringEnabled(node()!)
- }
- fallback={<span class="text-xs text-muted" aria-hidden="true">-</span>}
- >
- {(() => {
- const value = cpuTemperatureValue() as number;
- const temperature = node()!.temperature;
- const cpuMinValue =
- typeof temperature?.cpuMin === 'number' && temperature.cpuMin > 0
- ? temperature.cpuMin
- : null;
- const cpuMaxValue =
- typeof temperature?.cpuMaxRecord === 'number' && temperature.cpuMaxRecord > 0
- ? temperature.cpuMaxRecord
- : null;
- const hasMinMax = cpuMinValue !== null && cpuMaxValue !== null;
- const gpus = temperature?.gpu ?? [];
- const hasGPU = gpus.length > 0;
-
- if (hasMinMax || hasGPU) {
- const min =
- typeof cpuMinValue === 'number' ? Math.round(cpuMinValue) : undefined;
- const max =
- typeof cpuMaxValue === 'number' ? Math.round(cpuMaxValue) : undefined;
-
- return (
- <div
- title={`Min: ${min !== undefined ? formatTemperature(min) : '-'}, Max: ${max !== undefined ? formatTemperature(max) : '-'}${hasGPU ? `\nGPU: ${gpus.map((gpu) => formatTemperature(gpu.edge ?? gpu.junction ?? gpu.mem)).join(', ')}` : ''}`}
- >
- <TemperatureGauge
- value={value}
- min={min}
- max={max}
- critical={
- temperatureThresholds()?.critical ?? props.table.temperatureThreshold()
- }
- warning={
- temperatureThresholds()?.warning ??
- Math.max(0, props.table.temperatureThreshold() - 5)
- }
- />
- </div>
- );
- }
-
- return (
- <TemperatureGauge
- value={value}
- critical={
- temperatureThresholds()?.critical ?? props.table.temperatureThreshold()
- }
- warning={
- temperatureThresholds()?.warning ??
- Math.max(0, props.table.temperatureThreshold() - 5)
- }
- />
- );
- })()}
- </Show>
- </div>
- </TableCell>
- </Show>
-
- <Show when={props.tableProps.currentTab === 'workloads'}>
- <TableCell class={tdClass}>
- <div class="flex justify-center">
- <span class={online() ? 'text-xs text-base-content' : 'text-xs text-muted'}>
- {online()
- ? (getInfrastructureSummaryCountValue(props.item, 'vmCount', props.tableProps) ??
- '-')
- : '-'}
- </span>
- </div>
- </TableCell>
- <TableCell class={tdClass}>
- <div class="flex justify-center">
- <span class={online() ? 'text-xs text-base-content' : 'text-xs text-muted'}>
- {online()
- ? (getInfrastructureSummaryCountValue(
- props.item,
- 'containerCount',
- props.tableProps,
- ) ?? '-')
- : '-'}
- </span>
- </div>
- </TableCell>
- </Show>
-
- <Show when={props.tableProps.currentTab === 'storage'}>
- <TableCell class={tdClass}>
- <div class="flex justify-center">
- <span class={online() ? 'text-xs text-base-content' : 'text-xs text-muted'}>
- {online()
- ? (getInfrastructureSummaryCountValue(
- props.item,
- 'storageCount',
- props.tableProps,
- ) ?? '-')
- : '-'}
- </span>
- </div>
- </TableCell>
- <TableCell class={tdClass}>
- <div class="flex justify-center">
- <span class={online() ? 'text-xs text-base-content' : 'text-xs text-muted'}>
- {online()
- ? (getInfrastructureSummaryCountValue(
- props.item,
- 'diskCount',
- props.tableProps,
- ) ?? '-')
- : '-'}
- </span>
- </div>
- </TableCell>
- </Show>
-
- <Show when={props.tableProps.currentTab === 'recovery'}>
- <TableCell class={tdClass}>
- <div class="flex justify-center">
- <span class={online() ? 'text-xs text-base-content' : 'text-xs text-muted'}>
- {online()
- ? (getInfrastructureSummaryCountValue(
- props.item,
- 'backupCount',
- props.tableProps,
- ) ?? '-')
- : '-'}
- </span>
- </div>
- </TableCell>
- </Show>
-
- <TableCell class="px-0 py-1 align-middle text-center">
- <Show
- when={isPVEItem ? node()!.guestURL || node()!.host : pbs()!.guestURL || pbs()!.host}
- >
- <a
- href={
- isPVEItem
- ? node()!.guestURL || node()!.host || `https://${node()!.name}:8006`
- : pbs()!.guestURL || pbs()!.host || `https://${pbs()!.name}:8007`
- }
- target="_blank"
- rel="noopener noreferrer"
- onClick={(event) => event.stopPropagation()}
- class="inline-flex justify-center items-center text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 transition-colors"
- title={`Open ${displayName()} web interface`}
- >
- <svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path
- stroke-linecap="round"
- stroke-linejoin="round"
- stroke-width="2"
- d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
- />
- </svg>
- </a>
- </Show>
- </TableCell>
- </TableRow>
-
- <Show when={isExpanded() && isPVEItem}>
- <TableRow>
- <TableCell
- colspan={props.table.totalColumnCount()}
- class="bg-surface-alt px-4 py-4 border-b border-border-subtle shadow-inner"
- >
- <Suspense fallback={<div class="flex justify-center p-4">Loading stats...</div>}>
- <InfrastructureDetailsDrawer node={node()!} agent={linkedAgentForDrawer()} />
- </Suspense>
- </TableCell>
- </TableRow>
- </Show>
- </>
- );
-};
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index fb28dc1bdb..8d1d5fddda 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -61,10 +61,8 @@ import summaryCardInteractionSource from '@/components/shared/summaryCardInterac
import summaryJumpToRowButtonSource from '@/components/shared/SummaryJumpToRowButton.tsx?raw';
import summaryRowActionButtonSource from '@/components/shared/SummaryRowActionButton.tsx?raw';
import summaryInteractionA11ySource from '@/components/shared/summaryInteractionA11y.ts?raw';
-import stickySummarySectionSource from '@/components/shared/StickySummarySection.tsx?raw';
import tableSource from '@/components/shared/Table.tsx?raw';
import tableCardHeaderSource from '@/components/shared/TableCardHeader.tsx?raw';
-import summaryTableCardHeaderSource from '@/components/shared/SummaryTableCardHeader.tsx?raw';
import summaryTableFocusSource from '@/components/shared/summaryTableFocus.ts?raw';
import tableCardSource from '@/components/shared/TableCard.tsx?raw';
import groupedTableModeSegmentedControlSource from '@/components/shared/GroupedTableModeSegmentedControl.tsx?raw';
@@ -75,10 +73,6 @@ import animatedNumberStateSource from '@/components/shared/useAnimatedNumberStat
import workloadsFilterSource from '@/components/Workloads/WorkloadsFilter.tsx?raw';
import infrastructureSourceManagerSource from '@/components/Settings/InfrastructureSourceManager.tsx?raw';
import configuredNodeTablesSource from '@/components/Settings/ConfiguredNodeTables.tsx?raw';
-import infrastructureSummaryTableSource from '@/components/shared/InfrastructureSummaryTable.tsx?raw';
-import infrastructureSummaryTableRowSource from '@/components/shared/InfrastructureSummaryTableRow.tsx?raw';
-import infrastructureSummaryTableModelSource from '@/components/shared/infrastructureSummaryTableModel.ts?raw';
-import infrastructureSummaryTableStateSource from '@/components/shared/useInfrastructureSummaryTableState.ts?raw';
import selectionCardGroupSource from '@/components/shared/SelectionCardGroup.tsx?raw';
import selectionCardGroupModelSource from '@/components/shared/selectionCardGroupModel.ts?raw';
import summaryMetricCardSource from '@/components/shared/SummaryMetricCard.tsx?raw';
@@ -121,7 +115,6 @@ import workloadPanelSource from '@/components/Workloads/WorkloadPanel.tsx?raw';
import guestRowStateSource from '@/components/Workloads/useGuestRowState.ts?raw';
import workloadSelectionStateSource from '@/components/Workloads/useWorkloadSelectionState.ts?raw';
import proxmoxNodesTableSource from '@/features/proxmox/ProxmoxNodesTable.tsx?raw';
-import infrastructureSummaryStateSource from '@/components/Infrastructure/useInfrastructureSummaryState.ts?raw';
import unifiedResourceHostTableCardSource from '@/components/Infrastructure/UnifiedResourceHostTableCard.tsx?raw';
import unifiedResourceServiceInfrastructureCardSource from '@/components/Infrastructure/UnifiedResourceServiceInfrastructureCard.tsx?raw';
import unifiedResourcePBSTableSectionSource from '@/components/Infrastructure/UnifiedResourcePBSTableSection.tsx?raw';
@@ -138,7 +131,6 @@ import storagePoolRowSource from '@/components/Storage/StoragePoolRow.tsx?raw';
import storageContentCardSource from '@/components/Storage/StorageContentCard.tsx?raw';
import storagePoolsTableSource from '@/components/Storage/StoragePoolsTable.tsx?raw';
import diskListSource from '@/components/Storage/DiskList.tsx?raw';
-import storageSummarySource from '@/components/Storage/StorageSummary.tsx?raw';
import workloadsSummarySource from '@/components/Workloads/WorkloadsSummary.tsx?raw';
import recoveryTablePresentationSource from '@/utils/recoveryTablePresentation.ts?raw';
import alertHistoryTableSectionSource from '@/features/alerts/AlertHistoryTableSection.tsx?raw';
@@ -194,8 +186,6 @@ describe('shared primitive guardrails', () => {
.sort();
expect(rawTableUsers).toEqual([
- './InfrastructureSummaryTable.tsx',
- './InfrastructureSummaryTableRow.tsx',
'./PulseDataGrid.tsx',
]);
});
@@ -337,8 +327,6 @@ describe('shared primitive guardrails', () => {
expect(tableCardHeaderSource).toContain('TABLE_CARD_HEADER_CLASS');
expect(tableCardHeaderSource).not.toContain('Pinned to');
expect(tableCardHeaderSource).not.toContain('Scoped to');
- expect(summaryTableCardHeaderSource).toContain("from './TableCardHeader'");
- expect(summaryTableCardHeaderSource).not.toContain('border-b border-border bg-surface-hover');
for (const source of [
unifiedResourceHostTableCardSource,
unifiedResourceServiceInfrastructureCardSource,
@@ -427,17 +415,7 @@ describe('shared primitive guardrails', () => {
);
expect(summaryTableFocusSource).not.toContain('useNavigate(');
- expect(infrastructureSummaryStateSource).toContain('useSummaryContextualFocusState');
- expect(infrastructureSummaryStateSource).toContain('chartHoverSync');
- expect(infrastructureSummaryStateSource).toContain('hoveredGroupScope');
- expect(infrastructureSummaryStateSource).toContain('filterSeriesForActiveScope');
- expect(infrastructureSummaryStateSource).not.toContain(
- 'const interactiveResourceIds = createMemo',
- );
- expect(storageSummarySource).toContain('useSummaryContextualFocusState');
- expect(storageSummarySource).toContain('chartHoverSync');
- expect(storageSummarySource).not.toContain('resolveSummaryActiveSeriesId');
expect(workloadsSummarySource).toContain('useSummaryContextualFocusState');
expect(workloadsSummarySource).toContain('chartHoverSync');
@@ -464,8 +442,6 @@ describe('shared primitive guardrails', () => {
expect(workloadsSummarySource).toContain('SummarySynchronizedReadout');
expect(workloadsSummarySource).toContain('headerValue={');
- expect(storageSummarySource).toContain('SummarySynchronizedReadout');
- expect(storageSummarySource).toContain('headerValue={');
});
it('keeps summary-linked table row emphasis on the shared active-row presentation contract', () => {
@@ -870,34 +846,9 @@ describe('shared primitive guardrails', () => {
});
it('keeps infrastructure summary table on shell, runtime, and model owners', () => {
- expect(infrastructureSummaryTableSource).toContain('useInfrastructureSummaryTableState');
- expect(infrastructureSummaryTableSource).toContain('InfrastructureSummaryTableRow');
- expect(infrastructureSummaryTableSource).not.toContain('useWebSocket');
- expect(infrastructureSummaryTableSource).not.toContain('useAlertsActivation');
- expect(infrastructureSummaryTableSource).not.toContain('createSignal');
- expect(infrastructureSummaryTableSource).not.toContain('getNormalizedIdentityLookupVariants');
- expect(infrastructureSummaryTableSource).not.toContain('getAgentLikeIdentityAliases');
-
- expect(infrastructureSummaryTableStateSource).toContain('useWebSocket');
- expect(infrastructureSummaryTableStateSource).toContain('useAlertsActivation');
- expect(infrastructureSummaryTableStateSource).toContain(
- 'export function useInfrastructureSummaryTableState',
- );
- expect(infrastructureSummaryTableStateSource).toContain('createSignal');
- expect(infrastructureSummaryTableModelSource).toContain('getNormalizedIdentityLookupVariants');
- expect(infrastructureSummaryTableModelSource).toContain('getAgentLikeIdentityAliases');
- expect(infrastructureSummaryTableModelSource).toContain(
- 'export const resolveInfrastructureSummaryLinkedAgent',
- );
- expect(infrastructureSummaryTableModelSource).toContain(
- 'export const sortInfrastructureSummaryItems',
- );
- expect(infrastructureSummaryTableRowSource).toContain('InfrastructureDetailsDrawer');
- expect(infrastructureSummaryTableRowSource).toContain('getAlertStyles');
- expect(infrastructureSummaryTableRowSource).not.toContain('useWebSocket');
- expect(infrastructureSummaryTableRowSource).not.toContain('useAlertsActivation');
+
});
it('keeps infrastructure selector on shell, runtime, and model owners', () => {
@@ -1348,13 +1299,6 @@ describe('shared primitive guardrails', () => {
});
it('keeps sticky summary breakpoint behavior on the shared primitive', () => {
- expect(stickySummarySectionSource).toContain('stickyDesktopOnly?: boolean');
- expect(stickySummarySectionSource).toContain(
- "stickyDesktopOnly() ? 'static lg:sticky' : 'sticky'",
- );
- expect(stickySummarySectionSource).toContain(
- 'data-sticky-summary-sticky-desktop-only={stickyDesktopOnly() ?',
- );
});
it('keeps tooltip on shell, runtime, and model owners', () => {
diff --git a/frontend-modern/src/components/shared/StickySummarySection.tsx b/frontend-modern/src/components/shared/StickySummarySection.tsx
deleted file mode 100644
index a2573d9659..0000000000
--- a/frontend-modern/src/components/shared/StickySummarySection.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import type { Component, JSX } from 'solid-js';
-
-interface StickySummarySectionProps {
- children: JSX.Element;
- class?: string;
- desktopOnly?: boolean;
- stickyDesktopOnly?: boolean;
-}
-
-export const StickySummarySection: Component<StickySummarySectionProps> = (props) => {
- const desktopOnly = () => props.desktopOnly !== false;
- const stickyDesktopOnly = () => props.stickyDesktopOnly === true;
- const stickyClass = () => (stickyDesktopOnly() ? 'static lg:sticky' : 'sticky');
-
- return (
- <div
- data-sticky-summary="true"
- data-sticky-summary-desktop-only={desktopOnly() ? 'true' : 'false'}
- data-sticky-summary-sticky-desktop-only={stickyDesktopOnly() ? 'true' : 'false'}
- class={`${desktopOnly() ? 'hidden lg:block ' : ''}sticky-shield ${stickyClass()} top-0 z-20 bg-surface ${
- props.class ?? ''
- }`.trim()}
- >
- {props.children}
- </div>
- );
-};
-
-export default StickySummarySection;
diff --git a/frontend-modern/src/components/shared/SummaryTableCardHeader.tsx b/frontend-modern/src/components/shared/SummaryTableCardHeader.tsx
deleted file mode 100644
index cacb3d627f..0000000000
--- a/frontend-modern/src/components/shared/SummaryTableCardHeader.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-export {
- TableCardHeader as SummaryTableCardHeader,
- type TableCardHeaderProps as SummaryTableCardHeaderProps,
-} from './TableCardHeader';
-export { default } from './TableCardHeader';
diff --git a/frontend-modern/src/components/shared/__tests__/InfrastructureSummaryTable.test.tsx b/frontend-modern/src/components/shared/__tests__/InfrastructureSummaryTable.test.tsx
deleted file mode 100644
index f70be646be..0000000000
--- a/frontend-modern/src/components/shared/__tests__/InfrastructureSummaryTable.test.tsx
+++ /dev/null
@@ -1,222 +0,0 @@
-import { describe, expect, it, vi } from 'vitest';
-import { fireEvent, render, waitFor } from '@solidjs/testing-library';
-import { InfrastructureSummaryTable } from '@/components/shared/InfrastructureSummaryTable';
-import type { Agent, Node } from '@/types/api';
-import infrastructureSummaryTableSource from '@/components/shared/InfrastructureSummaryTable.tsx?raw';
-import infrastructureSummaryTableRowSource from '@/components/shared/InfrastructureSummaryTableRow.tsx?raw';
-import infrastructureSummaryTableModelSource from '@/components/shared/infrastructureSummaryTableModel.ts?raw';
-import infrastructureSummaryTableStateSource from '@/components/shared/useInfrastructureSummaryTableState.ts?raw';
-import resourceIdentitySource from '@/utils/resourceIdentity.ts?raw';
-
-const enhancedCpuBarMock = vi.fn();
-const infrastructureDetailsDrawerMock = vi.fn();
-
-if (typeof globalThis.ResizeObserver === 'undefined') {
- globalThis.ResizeObserver = class ResizeObserver {
- observe() {}
- unobserve() {}
- disconnect() {}
- } as unknown as typeof ResizeObserver;
-}
-
-vi.mock('@/contexts/appRuntime', () => ({
- useWebSocket: () => ({
- activeAlerts: [],
- }),
-}));
-
-vi.mock('@/stores/alertsActivation', () => ({
- useAlertsActivation: () => ({
- activationState: () => 'active',
- getTemperatureThreshold: () => 80,
- getMetricThresholds: () => ({ warning: 75, critical: 80 }),
- }),
-}));
-
-vi.mock('@/hooks/useBreakpoint', () => ({
- useBreakpoint: () => ({
- isMobile: () => false,
- }),
-}));
-
-vi.mock('@/components/shared/responsive', () => ({
- ResponsiveMetricCell: () => <div data-testid="metric-cell">metric</div>,
-}));
-
-vi.mock('@/components/shared/TemperatureGauge', () => ({
- TemperatureGauge: () => <div data-testid="temperature-gauge">temp</div>,
-}));
-
-vi.mock('@/components/Workloads/EnhancedCPUBar', () => ({
- EnhancedCPUBar: (props: unknown) => {
- enhancedCpuBarMock(props);
- return <div data-testid="enhanced-cpu-bar">cpu</div>;
- },
-}));
-
-vi.mock('@/components/Workloads/StackedMemoryBar', () => ({
- StackedMemoryBar: () => <div data-testid="stacked-memory-bar">memory</div>,
-}));
-
-vi.mock('@/components/Workloads/StackedDiskBar', () => ({
- StackedDiskBar: () => <div data-testid="stacked-disk-bar">disk</div>,
-}));
-
-vi.mock('@/components/shared/InfrastructureDetailsDrawer', () => ({
- InfrastructureDetailsDrawer: (props: unknown) => {
- infrastructureDetailsDrawerMock(props);
- return <div data-testid="infra-details-drawer">drawer</div>;
- },
-}));
-
-const makeNode = (overrides: Partial<Node> = {}): Node => ({
- id: 'node-1',
- name: 'pve1',
- instance: 'main',
- host: 'https://pve1:8006',
- pveVersion: '8.0',
- status: 'online',
- type: 'node',
- uptime: 123,
- cpu: 0.21,
- memory: { total: 8, used: 4, free: 4, usage: 50 },
- disk: { total: 100, used: 25, free: 75, usage: 25 },
- loadAverage: [0.1, 0.2, 0.3],
- kernelVersion: '6.8.0',
- cpuInfo: { model: 'Test CPU', cores: 8, sockets: 1, mhz: '3200' },
- lastSeen: '2026-01-01T00:00:00Z',
- connectionHealth: 'online',
- linkedAgentId: undefined,
- ...overrides,
-});
-
-const makeAgent = (overrides: Partial<Agent> = {}): Agent => ({
- id: 'agent-1',
- hostname: 'pve1.local',
- displayName: 'Agent 1',
- memory: { total: 8, used: 4, free: 4, usage: 50 },
- status: 'online',
- lastSeen: Date.now(),
- ...overrides,
-});
-
-describe('InfrastructureSummaryTable', () => {
- it('keeps the shared table on shell, runtime, and model owners', () => {
- expect(infrastructureSummaryTableSource).toContain('useInfrastructureSummaryTableState');
- expect(infrastructureSummaryTableSource).toContain('InfrastructureSummaryTableRow');
- expect(infrastructureSummaryTableSource).not.toContain('useWebSocket');
- expect(infrastructureSummaryTableSource).not.toContain('useAlertsActivation');
- expect(infrastructureSummaryTableStateSource).toContain('useWebSocket');
- expect(infrastructureSummaryTableStateSource).toContain('useAlertsActivation');
- expect(infrastructureSummaryTableModelSource).toContain(
- 'resolveInfrastructureSummaryLinkedAgent',
- );
- expect(infrastructureSummaryTableModelSource).toContain('sortInfrastructureSummaryItems');
- expect(infrastructureSummaryTableRowSource).toContain('InfrastructureDetailsDrawer');
- expect(infrastructureSummaryTableRowSource).toContain('getAlertStyles');
- });
-
- it('keeps pending update badges inside the shared row primitive', () => {
- expect(infrastructureSummaryTableRowSource).toContain('pendingUpdates');
- expect(infrastructureSummaryTableRowSource).toContain('pending apt update');
- });
-
- it('uses the shared normalized identity lookup helper', () => {
- expect(resourceIdentitySource).toContain('getNormalizedIdentityLookupVariants');
- expect(resourceIdentitySource).not.toContain(
- 'const asTrimmedString = (value: unknown): string | undefined => {',
- );
- });
-
- it('uses linked agent ids for agent-backed node metric keys', () => {
- enhancedCpuBarMock.mockClear();
-
- render(() => (
- <InfrastructureSummaryTable
- nodes={[makeNode({ linkedAgentId: 'agent-host-1' })]}
- selectedNode={null}
- currentTab="workloads"
- onNodeClick={vi.fn()}
- />
- ));
-
- expect(
- enhancedCpuBarMock.mock.calls.some(
- ([props]) => (props as { resourceId?: string }).resourceId === 'agent:agent-host-1',
- ),
- ).toBe(true);
- });
-
- it('falls back to node metric keys when no linked agent id exists', () => {
- enhancedCpuBarMock.mockClear();
-
- render(() => (
- <InfrastructureSummaryTable
- nodes={[makeNode({ id: 'node-2', name: 'pve2' })]}
- selectedNode={null}
- currentTab="workloads"
- onNodeClick={vi.fn()}
- />
- ));
-
- expect(
- enhancedCpuBarMock.mock.calls.some(
- ([props]) => (props as { resourceId?: string }).resourceId === 'node:node-2',
- ),
- ).toBe(true);
- });
-
- it('keeps the shared horizontal-scroll wrapper around the table shell', () => {
- const { container } = render(() => (
- <InfrastructureSummaryTable
- nodes={[makeNode()]}
- selectedNode={null}
- currentTab="workloads"
- onNodeClick={vi.fn()}
- />
- ));
-
- expect(container.querySelector('div.overflow-x-auto > table')).toBeTruthy();
- });
-
- it('matches drawer agents by shared linked-agent aliases', () => {
- infrastructureDetailsDrawerMock.mockClear();
-
- const { container } = render(() => (
- <InfrastructureSummaryTable
- nodes={[makeNode({ linkedAgentId: 'agent-linked' })]}
- agents={[
- makeAgent({
- id: 'agent-explicit',
- linkedNodeId: 'node-1',
- platform: 'linux',
- memory: { total: 16, used: 8, free: 8, usage: 50 },
- platformData: {
- linkedAgentId: 'agent-linked',
- agent: {
- hostname: 'pve1.internal',
- },
- },
- } as Partial<Agent> & {
- platformData: { linkedAgentId: string; agent: { hostname: string } };
- }),
- ]}
- selectedNode="node-1"
- currentTab="workloads"
- onNodeClick={vi.fn()}
- />
- ));
-
- const expandToggle = container.querySelector('div.cursor-pointer.transition-transform');
- expect(expandToggle).toBeTruthy();
- fireEvent.click(expandToggle!);
-
- return waitFor(() => {
- expect(infrastructureDetailsDrawerMock).toHaveBeenCalledWith(
- expect.objectContaining({
- agent: expect.objectContaining({ id: 'agent-explicit' }),
- }),
- );
- });
- });
-});
diff --git a/frontend-modern/src/components/shared/__tests__/StickySummarySection.test.tsx b/frontend-modern/src/components/shared/__tests__/StickySummarySection.test.tsx
deleted file mode 100644
index 758ffaf840..0000000000
--- a/frontend-modern/src/components/shared/__tests__/StickySummarySection.test.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-import { render, screen } from '@solidjs/testing-library';
-import { describe, expect, it } from 'vitest';
-import { StickySummarySection } from '@/components/shared/StickySummarySection';
-
-describe('StickySummarySection', () => {
- it('keeps summaries sticky by default on desktop-only surfaces', () => {
- render(() => (
- <StickySummarySection>
- <div>Summary content</div>
- </StickySummarySection>
- ));
-
- const section = screen.getByText('Summary content').closest('[data-sticky-summary="true"]');
- expect(section).toHaveAttribute('data-sticky-summary-desktop-only', 'true');
- expect(section).toHaveAttribute('data-sticky-summary-sticky-desktop-only', 'false');
- expect(section?.className).toContain('hidden');
- expect(section?.className).toContain('lg:block');
- expect(section?.className).toContain('sticky');
- });
-
- it('can render below desktop while only becoming sticky at desktop width', () => {
- render(() => (
- <StickySummarySection desktopOnly={false} stickyDesktopOnly>
- <div>Storage charts</div>
- </StickySummarySection>
- ));
-
- const section = screen.getByText('Storage charts').closest('[data-sticky-summary="true"]');
- expect(section).toHaveAttribute('data-sticky-summary-desktop-only', 'false');
- expect(section).toHaveAttribute('data-sticky-summary-sticky-desktop-only', 'true');
- expect(section?.className).not.toContain('hidden');
- expect(section?.className).toContain('static');
- expect(section?.className).toContain('lg:sticky');
- });
-});
diff --git a/frontend-modern/src/components/shared/infrastructureSummaryTableModel.ts b/frontend-modern/src/components/shared/infrastructureSummaryTableModel.ts
deleted file mode 100644
index ccbc00c3a1..0000000000
--- a/frontend-modern/src/components/shared/infrastructureSummaryTableModel.ts
+++ /dev/null
@@ -1,301 +0,0 @@
-import type { Agent, Node, PBSInstance } from '@/types/api';
-import { formatBytes } from '@/utils/format';
-import { buildMetricKey } from '@/utils/metricsKeys';
-import { getNodeDisplayName } from '@/utils/nodes';
-import { getCpuTemperature } from '@/utils/temperature';
-import {
- getAgentLikeIdentityAliases,
- getNormalizedIdentityLookupVariants,
-} from '@/utils/resourceIdentity';
-import { asTrimmedString } from '@/utils/stringUtils';
-
-export interface InfrastructureSummaryTableProps {
- nodes: Node[];
- pbsInstances?: PBSInstance[];
- vmCounts?: Record<string, number>;
- containerCounts?: Record<string, number>;
- storageCounts?: Record<string, number>;
- diskCounts?: Record<string, number>;
- agents?: Agent[];
- backupCounts?: Record<string, number>;
- currentTab: 'workloads' | 'storage' | 'recovery';
- selectedNode: string | null;
- globalTemperatureMonitoringEnabled?: boolean;
- onNodeClick: (nodeId: string, nodeType: 'pve' | 'pbs') => void;
-}
-
-export type TableItem = Node | PBSInstance;
-
-export type CountSortKey =
- | 'vmCount'
- | 'containerCount'
- | 'storageCount'
- | 'diskCount'
- | 'backupCount';
-
-export type InfrastructureSummarySortKey =
- | 'default'
- | 'name'
- | 'uptime'
- | 'cpu'
- | 'memory'
- | 'disk'
- | 'temperature'
- | CountSortKey;
-
-const asRecord = (value: unknown): Record<string, unknown> | undefined =>
- value && typeof value === 'object' ? (value as Record<string, unknown>) : undefined;
-
-const getAgentLinkedNodeId = (agent: Agent): string | undefined => {
- const agentRecord = agent as unknown as Record<string, unknown>;
- const platformData = asRecord(agentRecord.platformData);
- const platformAgent = asRecord(platformData?.agent);
-
- return (
- asTrimmedString(agent.linkedNodeId) ||
- asTrimmedString(platformData?.linkedNodeId) ||
- asTrimmedString(platformAgent?.linkedNodeId)
- );
-};
-
-export const isPVE = (item: TableItem): item is Node =>
- (item as Node).pveVersion !== undefined || (item as Node & { type?: string }).type === 'agent';
-
-export const isTemperatureMonitoringEnabled = (node: Node, globalEnabled = true): boolean => {
- if (
- node.temperatureMonitoringEnabled !== undefined &&
- node.temperatureMonitoringEnabled !== null
- ) {
- return node.temperatureMonitoringEnabled;
- }
- return globalEnabled;
-};
-
-export const isInfrastructureSummaryItemOnline = (item: TableItem) => {
- if (isPVE(item)) {
- return item.status === 'online' && (item.uptime || 0) > 0;
- }
- return item.status === 'healthy' || item.status === 'online';
-};
-
-export const getPbsTotals = (pbs: PBSInstance) =>
- (pbs.datastores ?? []).reduce(
- (acc, datastore) => {
- acc.used += datastore.used || 0;
- acc.total += datastore.total || 0;
- return acc;
- },
- { used: 0, total: 0 },
- );
-
-export const getInfrastructureSummaryCpuPercent = (item: TableItem) => {
- if (isPVE(item)) {
- return Math.round((item.cpu || 0) * 100);
- }
- return Math.round(item.cpu || 0);
-};
-
-export const getInfrastructureSummaryMemoryPercent = (item: TableItem) => {
- if (isPVE(item)) {
- return Math.round(item.memory?.usage || 0);
- }
- if (!item.memoryTotal) return 0;
- return Math.round((item.memoryUsed / item.memoryTotal) * 100);
-};
-
-export const getInfrastructureSummaryDiskPercent = (item: TableItem) => {
- if (isPVE(item)) {
- if (!item.disk || item.disk.total === 0) return 0;
- return Math.round((item.disk.used / item.disk.total) * 100);
- }
- const totals = getPbsTotals(item);
- if (totals.total === 0) return 0;
- return Math.round((totals.used / totals.total) * 100);
-};
-
-export const getInfrastructureSummaryDiskSublabel = (item: TableItem) => {
- if (isPVE(item)) {
- if (!item.disk) return undefined;
- return `${formatBytes(item.disk.used)}/${formatBytes(item.disk.total)}`;
- }
- if (!item.datastores || item.datastores.length === 0) return undefined;
- const totals = getPbsTotals(item);
- return `${formatBytes(totals.used)}/${formatBytes(totals.total)}`;
-};
-
-export const getInfrastructureSummaryCpuTemperatureValue = (item: TableItem) => {
- if (!isPVE(item)) return null;
- const value = getCpuTemperature(item.temperature);
- return value !== null ? Math.round(value) : null;
-};
-
-export const getInfrastructureSummaryCountValue = (
- item: TableItem,
- key: CountSortKey,
- props: InfrastructureSummaryTableProps,
-): number | null => {
- if (!isPVE(item)) {
- if (key === 'backupCount') {
- return props.backupCounts?.[item.name] ?? 0;
- }
- return null;
- }
-
- switch (key) {
- case 'vmCount':
- return props.vmCounts?.[item.id] ?? 0;
- case 'containerCount':
- return props.containerCounts?.[item.id] ?? 0;
- case 'storageCount':
- return props.storageCounts?.[item.id] ?? 0;
- case 'diskCount':
- return props.diskCounts?.[item.id] ?? 0;
- case 'backupCount':
- return props.backupCounts?.[item.id] ?? 0;
- default:
- return null;
- }
-};
-
-const getInfrastructureSummarySortValue = (
- item: TableItem,
- key: InfrastructureSummarySortKey,
- props: InfrastructureSummaryTableProps,
-): number | string | null => {
- switch (key) {
- case 'name':
- return isPVE(item) ? getNodeDisplayName(item) : item.name;
- case 'uptime':
- return item.uptime ?? 0;
- case 'cpu':
- return getInfrastructureSummaryCpuPercent(item);
- case 'memory':
- return getInfrastructureSummaryMemoryPercent(item);
- case 'disk':
- return getInfrastructureSummaryDiskPercent(item);
- case 'temperature':
- return getInfrastructureSummaryCpuTemperatureValue(item);
- case 'vmCount':
- case 'containerCount':
- case 'storageCount':
- case 'diskCount':
- case 'backupCount':
- return getInfrastructureSummaryCountValue(item, key, props);
- default:
- return null;
- }
-};
-
-const defaultInfrastructureSummaryComparison = (left: TableItem, right: TableItem) => {
- const leftIsPVE = isPVE(left);
- const rightIsPVE = isPVE(right);
- if (leftIsPVE !== rightIsPVE) return leftIsPVE ? -1 : 1;
-
- const leftOnline = isInfrastructureSummaryItemOnline(left);
- const rightOnline = isInfrastructureSummaryItemOnline(right);
- if (leftOnline !== rightOnline) return leftOnline ? -1 : 1;
-
- const leftName = leftIsPVE ? getNodeDisplayName(left) : left.name;
- const rightName = rightIsPVE ? getNodeDisplayName(right) : right.name;
-
- return leftName.localeCompare(rightName);
-};
-
-const compareInfrastructureSummaryValues = (
- left: number | string | null,
- right: number | string | null,
-) => {
- const leftEmpty =
- left === null || left === undefined || (typeof left === 'number' && Number.isNaN(left));
- const rightEmpty =
- right === null || right === undefined || (typeof right === 'number' && Number.isNaN(right));
-
- if (leftEmpty && rightEmpty) return 0;
- if (leftEmpty) return 1;
- if (rightEmpty) return -1;
-
- if (typeof left === 'number' && typeof right === 'number') {
- if (left === right) return 0;
- return left < right ? -1 : 1;
- }
-
- const leftString = String(left).toLowerCase();
- const rightString = String(right).toLowerCase();
- if (leftString === rightString) return 0;
- return leftString < rightString ? -1 : 1;
-};
-
-export const getInfrastructureSummaryDefaultSortDirection = (
- key: Exclude<InfrastructureSummarySortKey, 'default'>,
-) => {
- switch (key) {
- case 'name':
- return 'asc';
- default:
- return 'desc';
- }
-};
-
-export const sortInfrastructureSummaryItems = (
- props: InfrastructureSummaryTableProps,
- sortKey: InfrastructureSummarySortKey,
- sortDirection: 'asc' | 'desc',
-) => {
- const items: TableItem[] = [];
-
- if (props.nodes) items.push(...props.nodes);
- if (props.pbsInstances) items.push(...props.pbsInstances);
-
- return items.sort((left, right) => {
- if (sortKey === 'default') {
- return defaultInfrastructureSummaryComparison(left, right);
- }
-
- const valueLeft = getInfrastructureSummarySortValue(left, sortKey, props);
- const valueRight = getInfrastructureSummarySortValue(right, sortKey, props);
- const comparison = compareInfrastructureSummaryValues(valueLeft, valueRight);
-
- if (comparison !== 0) {
- return sortDirection === 'asc' ? comparison : -comparison;
- }
-
- return defaultInfrastructureSummaryComparison(left, right);
- });
-};
-
-export const getInfrastructureSummaryMetricsKey = (item: TableItem) => {
- if (isPVE(item) && item.linkedAgentId) {
- return buildMetricKey('agent', item.linkedAgentId);
- }
-
- const resourceId = isPVE(item) ? item.id || item.name : item.id || item.name;
- return buildMetricKey('node', resourceId);
-};
-
-export const resolveInfrastructureSummaryLinkedAgent = (
- node: Node,
- agents: Agent[] = [],
-): Agent | undefined => {
- const linkedAgentId = node.linkedAgentId;
- if (linkedAgentId) {
- const byId = agents.find((agent) => getAgentLikeIdentityAliases(agent).includes(linkedAgentId));
- if (byId) return byId;
- }
-
- const nodeName = (node.name || '').trim();
- return agents.find((agent) => {
- const linkedNodeId = getAgentLinkedNodeId(agent);
- if (linkedNodeId === node.id) {
- return true;
- }
-
- if (!nodeName) {
- return false;
- }
-
- const aliases = getAgentLikeIdentityAliases(agent).flatMap((value) =>
- getNormalizedIdentityLookupVariants(value),
- );
- return aliases.includes(nodeName.toLowerCase());
- });
-};
diff --git a/frontend-modern/src/components/shared/useInfrastructureSummaryTableState.ts b/frontend-modern/src/components/shared/useInfrastructureSummaryTableState.ts
deleted file mode 100644
index f6db1320b0..0000000000
--- a/frontend-modern/src/components/shared/useInfrastructureSummaryTableState.ts
+++ /dev/null
@@ -1,95 +0,0 @@
-import { createMemo, createSignal } from 'solid-js';
-import { useWebSocket } from '@/contexts/appRuntime';
-import { useBreakpoint } from '@/hooks/useBreakpoint';
-import { useAlertsActivation } from '@/stores/alertsActivation';
-import type { AlertThresholdScope, DisplayMetricType } from '@/utils/metricThresholds';
-import {
- getInfrastructureSummaryDefaultSortDirection,
- isTemperatureMonitoringEnabled,
- sortInfrastructureSummaryItems,
- type InfrastructureSummarySortKey,
- type InfrastructureSummaryTableProps,
-} from './infrastructureSummaryTableModel';
-
-export function useInfrastructureSummaryTableState(props: InfrastructureSummaryTableProps) {
- const { activeAlerts } = useWebSocket();
- const alertsActivation = useAlertsActivation();
- const alertsEnabled = createMemo(() => alertsActivation.activationState() === 'active');
- const { isMobile } = useBreakpoint();
- const temperatureThreshold = createMemo(() => alertsActivation.getTemperatureThreshold());
- const getMetricThresholds = (
- scope: AlertThresholdScope,
- metric: DisplayMetricType,
- resourceIds?: string | string[],
- ) => alertsActivation.getMetricThresholds(scope, metric, resourceIds);
-
- const [sortKey, setSortKey] = createSignal<InfrastructureSummarySortKey>('default');
- const [sortDirection, setSortDirection] = createSignal<'asc' | 'desc'>('asc');
- const [expandedNodeId, setExpandedNodeId] = createSignal<string | null>(null);
-
- const hasAnyTemperatureData = createMemo(
- () =>
- props.nodes?.some(
- (node) =>
- node.temperature?.available ||
- isTemperatureMonitoringEnabled(node, props.globalTemperatureMonitoringEnabled ?? true),
- ) || false,
- );
-
- const totalColumnCount = createMemo(() => {
- let count = 6;
- if (hasAnyTemperatureData()) count += 1;
- if (props.currentTab === 'workloads') count += 2;
- else if (props.currentTab === 'storage') count += 2;
- else if (props.currentTab === 'recovery') count += 1;
- return count;
- });
-
- const sortedItems = createMemo(() =>
- sortInfrastructureSummaryItems(props, sortKey(), sortDirection()),
- );
-
- const handleSort = (key: Exclude<InfrastructureSummarySortKey, 'default'>) => {
- if (sortKey() === key) {
- if (sortDirection() === 'asc') {
- setSortDirection('desc');
- } else {
- setSortKey('default');
- setSortDirection('asc');
- }
- return;
- }
-
- setSortKey(key);
- setSortDirection(getInfrastructureSummaryDefaultSortDirection(key));
- };
-
- const renderSortIndicator = (key: InfrastructureSummarySortKey) => {
- if (sortKey() !== key) return null;
- return sortDirection() === 'asc' ? '▲' : '▼';
- };
-
- const toggleNodeExpand = (nodeId: string, event: MouseEvent) => {
- event.stopPropagation();
- setExpandedNodeId((previous) => (previous === nodeId ? null : nodeId));
- };
-
- return {
- activeAlerts,
- alertsEnabled,
- handleSort,
- hasAnyTemperatureData,
- getMetricThresholds,
- isExpandedNode: (nodeId: string) => expandedNodeId() === nodeId,
- isMobile,
- isTemperatureMonitoringEnabled: (node: Parameters<typeof isTemperatureMonitoringEnabled>[0]) =>
- isTemperatureMonitoringEnabled(node, props.globalTemperatureMonitoringEnabled ?? true),
- renderSortIndicator,
- sortedItems,
- temperatureThreshold,
- toggleNodeExpand,
- totalColumnCount,
- };
-}
-
-export type InfrastructureSummaryTableState = ReturnType<typeof useInfrastructureSummaryTableState>;
diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
index 33b86947ab..e1efbdafe3 100644
--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
@@ -56,13 +56,10 @@ import tooltipModelSource from '@/components/shared/tooltipModel.ts?raw';
import upgradeLinkSource from '@/components/shared/UpgradeLink.tsx?raw';
import monitoredSystemLedgerPanelSource from '@/components/Settings/MonitoredSystemLedgerPanel.tsx?raw';
import monitoredSystemDefinitionDisclosureSource from '@/components/Commercial/MonitoredSystemDefinitionDisclosure.tsx?raw';
-import infrastructureSummaryTableSource from '@/components/shared/InfrastructureSummaryTable.tsx?raw';
-import infrastructureSummaryTableRowSource from '@/components/shared/InfrastructureSummaryTableRow.tsx?raw';
import interactiveSparklineSource from '@/components/shared/InteractiveSparkline.tsx?raw';
import interactiveSparklineModelSource from '@/components/shared/interactiveSparklineModel.ts?raw';
import selectionCardGroupSource from '@/components/shared/SelectionCardGroup.tsx?raw';
import selectionCardGroupModelSource from '@/components/shared/selectionCardGroupModel.ts?raw';
-import sharedInfrastructureSummaryTableModelSource from '@/components/shared/infrastructureSummaryTableModel.ts?raw';
import commandPaletteStateSource from '@/components/shared/useCommandPaletteState.ts?raw';
import columnPickerStateSource from '@/components/shared/useColumnPickerState.ts?raw';
import tagInputStateSource from '@/components/shared/useTagInputState.ts?raw';
@@ -84,7 +81,6 @@ import searchTipsPopoverStateSource from '@/components/shared/useSearchTipsPopov
import tooltipStateSource from '@/components/shared/useTooltipState.ts?raw';
import upgradeNavigationHookSource from '@/components/shared/useUpgradeNavigation.ts?raw';
import interactiveSparklineStateSource from '@/components/shared/useInteractiveSparklineState.ts?raw';
-import infrastructureSummaryTableStateSource from '@/components/shared/useInfrastructureSummaryTableState.ts?raw';
import selectionCardGroupStateSource from '@/components/shared/useSelectionCardGroupState.ts?raw';
import resourceBadgePresentationSource from '@/utils/resourceBadgePresentation.ts?raw';
import workloadTypeBadgesSource from '@/components/shared/workloadTypeBadges.ts?raw';
@@ -286,7 +282,6 @@ import resourceDetailDrawerShellSource from '@/components/Infrastructure/Resourc
import resourceDetailDrawerOverviewSource from '@/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx?raw';
import resourceDetailDrawerDebugSource from '@/components/Infrastructure/ResourceDetailDrawerDebugTab.tsx?raw';
import resourceDetailSummarySource from '@/components/Infrastructure/ResourceDetailSummary.tsx?raw';
-import infrastructureSummaryStateSource from '@/components/Infrastructure/useInfrastructureSummaryState.ts?raw';
import infrastructureSummaryModelSource from '@/components/Infrastructure/infrastructureSummaryModel.ts?raw';
import resourceDetailDrawerDiscoveryModelSource from '@/components/Infrastructure/resourceDetailDiscoveryModel.ts?raw';
import resourceDetailMappersSource from '@/components/Infrastructure/resourceDetailMappers.ts?raw';
@@ -877,18 +872,6 @@ describe('frontend resource type boundaries', () => {
expect(useWorkloadsSource).not.toContain('const normalizeOrgScope =');
expect(useUnifiedResourcesSource).toContain('normalizeOrgScope(getOrgID())');
expect(useUnifiedResourcesSource).not.toContain('const normalizeOrgScope =');
- expect(infrastructureSummaryStateSource).toContain('normalizeOrgScope(getOrgID())');
- expect(infrastructureSummaryStateSource).toContain('buildInfrastructureDisplaySeries');
- expect(infrastructureSummaryStateSource).toContain('buildInfrastructureMetricSeries');
- expect(infrastructureSummaryStateSource).toContain('buildInfrastructureEmptyMessage');
- expect(infrastructureSummaryStateSource).not.toContain(
- 'const match = allSeries.find((series) => series.id === focused);',
- );
- expect(infrastructureSummaryStateSource).not.toContain('displaySeries().map((series) => ({');
- expect(infrastructureSummaryStateSource).not.toContain(
- "isAwaitingFirstSample() ? 'Gathering first sample…' : 'Building trend history…'",
- );
- expect(infrastructureSummaryStateSource).not.toContain("getOrgID() || 'default'");
expect(storageSummaryCacheSource).toContain('normalizeOrgScope(getOrgID())');
expect(guestRowSource).toContain('useGuestRowState');
expect(guestRowSource).toContain("from './GuestRowCells'");
@@ -2415,9 +2398,6 @@ describe('frontend resource type boundaries', () => {
expect(infrastructureSummaryModelSource).toContain('buildInfrastructureDisplaySeries');
expect(infrastructureSummaryModelSource).toContain('buildInfrastructureMetricSeries');
expect(infrastructureSummaryModelSource).toContain('buildInfrastructureEmptyMessage');
- expect(sharedInfrastructureSummaryTableModelSource).toContain(
- 'getNormalizedIdentityLookupVariants',
- );
expect(resourceIdentitySource).toContain('getNormalizedIdentityLookupVariants');
expect(stringUtilsSource).toContain('export const asTrimmedString');
expect(resourceIdentitySource).not.toContain(
@@ -2688,25 +2668,6 @@ describe('frontend resource type boundaries', () => {
expect(infrastructureSummaryModelSource).not.toContain(
'const asTrimmedString = (value: unknown): string | null => {',
);
- expect(sharedInfrastructureSummaryTableModelSource).not.toContain(
- 'const asTrimmedString = (value: unknown): string | undefined => {',
- );
- expect(infrastructureSummaryTableSource).toContain('useInfrastructureSummaryTableState');
- expect(infrastructureSummaryTableSource).toContain('InfrastructureSummaryTableRow');
- expect(infrastructureSummaryTableSource).not.toContain('useWebSocket');
- expect(infrastructureSummaryTableSource).not.toContain('useAlertsActivation');
- expect(infrastructureSummaryTableSource).not.toContain('createSignal');
- expect(infrastructureSummaryTableSource).not.toContain('getAgentLikeIdentityAliases');
- expect(infrastructureSummaryTableStateSource).toContain('useWebSocket');
- expect(infrastructureSummaryTableStateSource).toContain('useAlertsActivation');
- expect(infrastructureSummaryTableStateSource).toContain(
- 'export function useInfrastructureSummaryTableState',
- );
- expect(infrastructureSummaryTableRowSource).toContain('InfrastructureDetailsDrawer');
- expect(infrastructureSummaryTableRowSource).toContain('getAlertStyles');
- expect(sharedInfrastructureSummaryTableModelSource).toContain(
- 'resolveInfrastructureSummaryLinkedAgent',
- );
expect(interactiveSparklineSource).toContain('useInteractiveSparklineState');
expect(interactiveSparklineSource).not.toContain('scheduleSparkline');
expect(interactiveSparklineSource).not.toContain('downsampleLTTB');