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.

workloads(surface): compactGroupHeaders flag strips host stats from group rows

rcourtman73a9608cc37e
diff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
index af50f32ac6..cdcce88c4d 100644
--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
@@ -580,6 +580,23 @@ shell clickable behind another overlay.
## Current State
+The embedded WorkloadsSurface exposes a `compactGroupHeaders` prop on
+`frontend-modern/src/components/Workloads/useWorkloadsState.ts` that
+platform pages owning their own hosts table (Proxmox overview today) set
+to strip per-host metric cells out of the `NodeGroupHeader` rows in
+grouped mode. The flag is threaded through
+`frontend-modern/src/components/Workloads/WorkloadsSurface.tsx`,
+`frontend-modern/src/components/Workloads/WorkloadsTable.tsx`, and
+`frontend-modern/src/components/Workloads/WorkloadPanel.tsx`; when set,
+`WorkloadPanel` calls `NodeGroupHeader` without `columns` /
+`renderColumnCell` so the existing colspan layout renders just the
+status dot, linked node name, cluster badge, and agent badge — the
+duplicate CPU / Memory / Disk / uptime / temperature / version stats
+the top-of-page hosts table already owns are dropped. New embedded
+platform-page consumers that render their own hosts summary must set
+this flag; standalone Workloads surfaces (no top hosts table) keep the
+original verbose group rows by default.
+
The Workloads table metric display mode is part of the protected Workloads
hot path. The default bar mode must keep the existing zero-extra-history cost;
the sparkline mode may hydrate a short shared history window only when selected
diff --git a/frontend-modern/src/components/Workloads/WorkloadPanel.tsx b/frontend-modern/src/components/Workloads/WorkloadPanel.tsx
index 9e79f0997e..6ae1a1901b 100644
--- a/frontend-modern/src/components/Workloads/WorkloadPanel.tsx
+++ b/frontend-modern/src/components/Workloads/WorkloadPanel.tsx
@@ -37,6 +37,7 @@ type WorkloadPanelProps = Pick<
| 'activeAlerts'
| 'alertsEnabled'
| 'bottomSpacerHeight'
+ | 'compactGroupHeaders'
| 'getGroupLabel'
| 'groupedGuests'
| 'groupedWindowing'
@@ -427,10 +428,17 @@ export function WorkloadPanel(props: WorkloadPanelProps) {
node={node()!}
renderAs="tr"
colspan={props.totalColumns()}
- columns={props.workloadTableVisibleColumns()}
- columnCellClass={getGroupNodeColumnCellClass}
- renderColumnCell={renderGroupNodeColumnCell}
- showFactsInName={!props.workloadTableVisibleColumnIds().includes('info')}
+ columns={props.compactGroupHeaders() ? undefined : props.workloadTableVisibleColumns()}
+ columnCellClass={
+ props.compactGroupHeaders() ? undefined : getGroupNodeColumnCellClass
+ }
+ renderColumnCell={
+ props.compactGroupHeaders() ? undefined : renderGroupNodeColumnCell
+ }
+ showFactsInName={
+ !props.compactGroupHeaders() &&
+ !props.workloadTableVisibleColumnIds().includes('info')
+ }
trClass="cursor-pointer select-none duration-150"
trProps={{
'aria-expanded': shouldShowNodeDrawer() ? 'true' : 'false',
diff --git a/frontend-modern/src/components/Workloads/WorkloadsSurface.tsx b/frontend-modern/src/components/Workloads/WorkloadsSurface.tsx
index 07e9334353..dcbfc9dd41 100644
--- a/frontend-modern/src/components/Workloads/WorkloadsSurface.tsx
+++ b/frontend-modern/src/components/Workloads/WorkloadsSurface.tsx
@@ -131,6 +131,7 @@ export function WorkloadsSurface(props: WorkloadsSurfaceProps) {
alertsEnabled={state.alertsEnabled}
bottomSpacerHeight={state.bottomSpacerHeight}
clearPinnedSummaryScope={state.clearPinnedSummaryScope}
+ compactGroupHeaders={state.compactGroupHeaders}
getGroupLabel={state.getGroupLabel}
groupedGuests={state.groupedGuests}
groupedWindowing={state.groupedWindowing}
diff --git a/frontend-modern/src/components/Workloads/WorkloadsTable.tsx b/frontend-modern/src/components/Workloads/WorkloadsTable.tsx
index ee3f263ebd..677e6e8395 100644
--- a/frontend-modern/src/components/Workloads/WorkloadsTable.tsx
+++ b/frontend-modern/src/components/Workloads/WorkloadsTable.tsx
@@ -16,6 +16,7 @@ type WorkloadsTableProps = Pick<
| 'activeAlerts'
| 'alertsEnabled'
| 'bottomSpacerHeight'
+ | 'compactGroupHeaders'
| 'getGroupLabel'
| 'groupedGuests'
| 'groupedWindowing'
@@ -118,6 +119,7 @@ export function WorkloadsTable(props: WorkloadsTableProps) {
activeAlerts={props.activeAlerts}
alertsEnabled={props.alertsEnabled}
bottomSpacerHeight={props.bottomSpacerHeight}
+ compactGroupHeaders={props.compactGroupHeaders}
getGroupLabel={props.getGroupLabel}
groupedGuests={props.groupedGuests}
groupedWindowing={props.groupedWindowing}
diff --git a/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
index f56b9a1201..be28341b25 100644
--- a/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
@@ -363,6 +363,35 @@ describe('Workloads platform-page embed contract', () => {
const surfaceSource = (await import('../WorkloadsSurface.tsx?raw')).default;
expect(surfaceSource).toContain('props.showFilterToolbar || !props.tableOnly');
});
+
+ it('exposes compactGroupHeaders so platform pages can strip duplicate host stats from group rows', async () => {
+ const stateSource = (await import('../useWorkloadsState.ts?raw')).default;
+ expect(stateSource).toContain('compactGroupHeaders?: boolean;');
+ expect(stateSource).toContain(
+ 'compactGroupHeaders: () => props.compactGroupHeaders === true,',
+ );
+
+ const tableSource = (await import('../WorkloadsTable.tsx?raw')).default;
+ expect(tableSource).toContain(`| 'compactGroupHeaders'`);
+ expect(tableSource).toContain('compactGroupHeaders={props.compactGroupHeaders}');
+
+ const panelSource = (await import('../WorkloadPanel.tsx?raw')).default;
+ expect(panelSource).toContain(`| 'compactGroupHeaders'`);
+ // When the flag is set the panel falls back to NodeGroupHeader's
+ // colspan layout: no per-column metric cells, no inline node facts.
+ expect(panelSource).toContain(
+ 'props.compactGroupHeaders() ? undefined : props.workloadTableVisibleColumns()',
+ );
+ expect(panelSource).toContain(
+ 'props.compactGroupHeaders() ? undefined : renderGroupNodeColumnCell',
+ );
+ expect(panelSource).toContain('!props.compactGroupHeaders() &&');
+
+ const proxmoxSource = (
+ await import('../../../features/proxmox/ProxmoxPageSurface.tsx?raw')
+ ).default;
+ expect(proxmoxSource).toContain('compactGroupHeaders');
+ });
});
describe('Workloads performance contract', () => {
diff --git a/frontend-modern/src/components/Workloads/useWorkloadsState.ts b/frontend-modern/src/components/Workloads/useWorkloadsState.ts
index 876b88446c..aa43668986 100644
--- a/frontend-modern/src/components/Workloads/useWorkloadsState.ts
+++ b/frontend-modern/src/components/Workloads/useWorkloadsState.ts
@@ -66,6 +66,12 @@ export interface WorkloadsSurfaceProps {
// filter row since the platform is already fixed by the owning page.
showFilterToolbar?: boolean;
suppressPlatformFilter?: boolean;
+ // Platform pages that render their own hosts table above the embedded
+ // workloads surface (e.g. Proxmox overview) own the per-host CPU / Memory
+ // / Disk / Temperature / uptime / version stats. Setting
+ // `compactGroupHeaders` strips those stats from the NodeGroupHeader rows
+ // in grouped mode so the section dividers don't duplicate the info.
+ compactGroupHeaders?: boolean;
}
export type WorkloadSortKey = WorkloadsSortKey;
@@ -481,6 +487,7 @@ export function useWorkloadsState(props: WorkloadsSurfaceProps) {
workloadsNoInventoryState,
ws,
groupingMode,
+ compactGroupHeaders: () => props.compactGroupHeaders === true,
} as const;
}
diff --git a/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx b/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx
index 045386f9a8..06fb97bd07 100644
--- a/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx
+++ b/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx
@@ -147,6 +147,7 @@ export function ProxmoxPageSurface() {
showFilterToolbar
suppressPlatformFilter
forcedPlatform={PROXMOX_PLATFORM_FILTER}
+ compactGroupHeaders
/>
</div>
</Show>