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.

Canonicalize product table scroll shells

rcourtman00900dc9cdb8
diff --git a/docs/release-control/v6/internal/subsystems/alerts.md b/docs/release-control/v6/internal/subsystems/alerts.md
index 37b75547f2..c2a19a7e15 100644
--- a/docs/release-control/v6/internal/subsystems/alerts.md
+++ b/docs/release-control/v6/internal/subsystems/alerts.md
@@ -245,6 +245,9 @@ table subgroup-row contract. `AlertHistoryTableGroupRow` and grouped rows in
`frontend-modern/src/components/shared/groupedTableRowPresentation.ts` instead
of local `bg-surface-alt` fills, so alert subgroup hierarchy stays visually
consistent with Infrastructure, Workloads, Storage, and Recovery tables.
+Alert history table shells must also rely on the shared `TableCard` frame and
+the shared `Table` primitive for horizontal overflow rather than adding
+alert-local bordered or `overflow-x-auto` wrappers inside the history section.
The alert webhook service chooser also now derives its service set from the
backend webhook template registry, rather than keeping a second frontend-only
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 8a73bbf864..71acaf2d49 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -177,7 +177,12 @@ work extends shared components instead of creating new local variants.
the table data, filters, columns, and row behavior, but the outer
product-table frame, section header band, and light/dark border treatment
belong to frontend primitives so Infrastructure, Workloads, Storage, and
- Recovery do not drift visually.
+ Recovery do not drift visually. The shared `Table` primitive owns the
+ horizontal scroll shell (`overflow-x-auto` plus touch scrolling); feature
+ tables must not wrap it in page-local scroll containers just to restore
+ table sides or mobile overflow. Headerless product tables, including alert
+ history, still use `TableCard` for the outer frame instead of hand-coded
+ rounded/bordered wrappers.
Product-table subgroup/header rows must likewise consume the shared
`frontend-modern/src/components/shared/groupedTableRowPresentation.ts`
helper and `.grouped-table-row` CSS token contract instead of local
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 f92da26d0a..d48d22abec 100644
--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
@@ -247,7 +247,10 @@ regression protection.
title/action band so Workloads, Infrastructure, Storage, and Recovery keep
one border/background/overflow frame and table-section header treatment
instead of introducing page-local table shells with different light/dark
- contrast.
+ contrast. The shared `Table` primitive owns the horizontal scroll container
+ for those hot tables; page-local nested `overflow-x-auto` wrappers are not
+ allowed because they add extra scroll and paint surfaces on the row-heavy
+ path.
Infrastructure table responsive behavior belongs to that same hot-path
owner. `frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts`
must derive column visibility from the measured table surface width, with
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 74357d8345..c8df53cf14 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -70,7 +70,10 @@ querying, and the operator-facing storage health presentation layer.
recovery-event, and adjacent table-fallback chrome. Storage/recovery may own
table content, filters, columns, and rows, but it must not fork
border/background/overflow table shells, page-local table-title bands, or
- lighter open-sided Recovery table frames.
+ lighter open-sided Recovery table frames. Recovery and storage tables must
+ use the shared `Table` scroll shell directly; if a table needs the card body
+ surface fill it may pass `wrapperClass`, but it must not nest a local
+ `overflow-x-auto` div around the shared table.
Recovery inventory protection posture and recovery-event outcome filtering
must stay separate in that owner: protected inventory uses the route-backed
`state` query for health, stale, failed, warning, running, unknown, and
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 3cd708adcd..78b34b81d7 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -158,7 +158,10 @@ cross-source deduplication.
Infrastructure host and service table cards must consume the
frontend-primitives-owned `TableCard` frame and `TableCardHeader` header
band; unified resources owns the resource identity, rows, grouping, and
- detail presentation, not page-local table-shell chrome.
+ detail presentation, not page-local table-shell chrome. The nested
+ infrastructure tables must use the shared `Table` primitive's scroll frame
+ directly instead of reintroducing page-local `overflow-x-auto` wrappers
+ inside the canonical card shell.
Resource detail mappers now reuse the shared
`frontend-modern/src/utils/textPresentation.ts` title-case helper for sensor
diff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx
index adc151c246..723eeab19f 100644
--- a/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx
+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx
@@ -75,615 +75,602 @@ export const UnifiedResourceHostTableCard: Component<UnifiedResourceHostTableCar
showClearAction={table.showHostClearAction()}
onClear={tableProps.clearPinnedSummaryScope}
/>
- <div class="overflow-x-auto">
- <Table class={`whitespace-nowrap ${table.tableShellClass()}`}>
- <TableHeader>
- <TableRow class="bg-surface-alt text-muted border-b border-border">
- <TableHead
- class={`text-left pl-2 sm:pl-3 ${table.resourceColumn().className}`}
- width={table.resourceColumn().width}
- onClick={() => table.handleSort('name')}
- >
- {table.headerLabels().resource} {table.renderSortIndicator('name')}
- </TableHead>
- <TableHead
- class={table.metricColumn().className}
- width={table.metricColumn().width}
- onClick={() => table.handleSort('cpu')}
- >
- {table.headerLabels().cpu} {table.renderSortIndicator('cpu')}
- </TableHead>
- <TableHead
- class={table.metricColumn().className}
- width={table.metricColumn().width}
- onClick={() => table.handleSort('memory')}
- >
- {table.headerLabels().memory} {table.renderSortIndicator('memory')}
- </TableHead>
- <TableHead
- class={table.metricColumn().className}
- width={table.metricColumn().width}
- onClick={() => table.handleSort('disk')}
- >
- {table.headerLabels().disk} {table.renderSortIndicator('disk')}
- </TableHead>
- <TableHead
- classList={{ hidden: table.isMobile() || !table.isVisible('secondary') }}
- class={table.ioColumn().className}
- width={table.ioColumn().width}
- onClick={() => table.handleSort('network')}
- >
- {table.headerLabels().network} {table.renderSortIndicator('network')}
- </TableHead>
- <TableHead
- classList={{ hidden: table.isMobile() || !table.isHostDiskIoVisible() }}
- class={table.ioColumn().className}
- width={table.ioColumn().width}
- onClick={() => table.handleSort('diskio')}
- >
- {table.headerLabels().diskIo} {table.renderSortIndicator('diskio')}
- </TableHead>
- <TableHead
- classList={{ hidden: table.isMobile() || !table.isVisible('secondary') }}
- class={table.sourceColumn().className}
- width={table.sourceColumn().width}
- onClick={() => table.handleSort('source')}
- >
- {table.headerLabels().source} {table.renderSortIndicator('source')}
- </TableHead>
- <TableHead
- classList={{ hidden: table.isMobile() || !table.isVisible('supplementary') }}
- class={table.uptimeColumn().className}
- width={table.uptimeColumn().width}
- onClick={() => table.handleSort('uptime')}
- >
- {table.headerLabels().uptime} {table.renderSortIndicator('uptime')}
- </TableHead>
- <TableHead
- classList={{ hidden: table.isMobile() || !table.isVisible('supplementary') }}
- class={table.tempColumn().className}
- width={table.tempColumn().width}
- onClick={() => table.handleSort('temp')}
- >
- {table.headerLabels().temp} {table.renderSortIndicator('temp')}
- </TableHead>
+ <Table class={`whitespace-nowrap ${table.tableShellClass()}`}>
+ <TableHeader>
+ <TableRow class="bg-surface-alt text-muted border-b border-border">
+ <TableHead
+ class={`text-left pl-2 sm:pl-3 ${table.resourceColumn().className}`}
+ width={table.resourceColumn().width}
+ onClick={() => table.handleSort('name')}
+ >
+ {table.headerLabels().resource} {table.renderSortIndicator('name')}
+ </TableHead>
+ <TableHead
+ class={table.metricColumn().className}
+ width={table.metricColumn().width}
+ onClick={() => table.handleSort('cpu')}
+ >
+ {table.headerLabels().cpu} {table.renderSortIndicator('cpu')}
+ </TableHead>
+ <TableHead
+ class={table.metricColumn().className}
+ width={table.metricColumn().width}
+ onClick={() => table.handleSort('memory')}
+ >
+ {table.headerLabels().memory} {table.renderSortIndicator('memory')}
+ </TableHead>
+ <TableHead
+ class={table.metricColumn().className}
+ width={table.metricColumn().width}
+ onClick={() => table.handleSort('disk')}
+ >
+ {table.headerLabels().disk} {table.renderSortIndicator('disk')}
+ </TableHead>
+ <TableHead
+ classList={{ hidden: table.isMobile() || !table.isVisible('secondary') }}
+ class={table.ioColumn().className}
+ width={table.ioColumn().width}
+ onClick={() => table.handleSort('network')}
+ >
+ {table.headerLabels().network} {table.renderSortIndicator('network')}
+ </TableHead>
+ <TableHead
+ classList={{ hidden: table.isMobile() || !table.isHostDiskIoVisible() }}
+ class={table.ioColumn().className}
+ width={table.ioColumn().width}
+ onClick={() => table.handleSort('diskio')}
+ >
+ {table.headerLabels().diskIo} {table.renderSortIndicator('diskio')}
+ </TableHead>
+ <TableHead
+ classList={{ hidden: table.isMobile() || !table.isVisible('secondary') }}
+ class={table.sourceColumn().className}
+ width={table.sourceColumn().width}
+ onClick={() => table.handleSort('source')}
+ >
+ {table.headerLabels().source} {table.renderSortIndicator('source')}
+ </TableHead>
+ <TableHead
+ classList={{ hidden: table.isMobile() || !table.isVisible('supplementary') }}
+ class={table.uptimeColumn().className}
+ width={table.uptimeColumn().width}
+ onClick={() => table.handleSort('uptime')}
+ >
+ {table.headerLabels().uptime} {table.renderSortIndicator('uptime')}
+ </TableHead>
+ <TableHead
+ classList={{ hidden: table.isMobile() || !table.isVisible('supplementary') }}
+ class={table.tempColumn().className}
+ width={table.tempColumn().width}
+ onClick={() => table.handleSort('temp')}
+ >
+ {table.headerLabels().temp} {table.renderSortIndicator('temp')}
+ </TableHead>
+ </TableRow>
+ </TableHeader>
+ <TableBody ref={table.setHostBodyRef}>
+ <Show when={table.hostWindowing.isWindowed() && table.hostTopSpacerHeight() > 0}>
+ <TableRow aria-hidden="true">
+ <TableCell colspan={9} class="border-0 p-0" height={table.hostTopSpacerHeight()} />
</TableRow>
- </TableHeader>
- <TableBody ref={table.setHostBodyRef}>
- <Show when={table.hostWindowing.isWindowed() && table.hostTopSpacerHeight() > 0}>
- <TableRow aria-hidden="true">
- <TableCell
- colspan={9}
- class="border-0 p-0"
- height={table.hostTopSpacerHeight()}
- />
- </TableRow>
- </Show>
+ </Show>
- <For each={table.visibleHostTableItems()}>
- {(item) => {
- if (item.type === 'header') {
- const group = item.group;
- const groupSummaryScope = createMemo<SummarySeriesGroupScope | null>(() =>
- table.buildHostSummaryGroupScope(group),
- );
- const isSummaryGroupHighlighted = createMemo(
- () => tableProps.activeSummaryGroupScope?.id === groupSummaryScope()?.id,
+ <For each={table.visibleHostTableItems()}>
+ {(item) => {
+ if (item.type === 'header') {
+ const group = item.group;
+ const groupSummaryScope = createMemo<SummarySeriesGroupScope | null>(() =>
+ table.buildHostSummaryGroupScope(group),
+ );
+ const isSummaryGroupHighlighted = createMemo(
+ () => tableProps.activeSummaryGroupScope?.id === groupSummaryScope()?.id,
+ );
+ const handleGroupHoverChange = (next: SummarySeriesGroupScope | null) => {
+ tableProps.onGroupHoverChange?.(next);
+ };
+ const handleGroupFocusToggle = () => {
+ const nextScope = groupSummaryScope();
+ tableProps.onGroupFocusChange?.(
+ nextScope && tableProps.focusedSummaryGroupId === nextScope.id
+ ? null
+ : (nextScope?.id ?? null),
);
- const handleGroupHoverChange = (next: SummarySeriesGroupScope | null) => {
- tableProps.onGroupHoverChange?.(next);
- };
- const handleGroupFocusToggle = () => {
- const nextScope = groupSummaryScope();
- tableProps.onGroupFocusChange?.(
- nextScope && tableProps.focusedSummaryGroupId === nextScope.id
- ? null
- : (nextScope?.id ?? null),
- );
- };
- const groupRowInteraction = createSummaryInteractiveRowPreviewHandlers({
- onPreview: () => handleGroupHoverChange(groupSummaryScope()),
- onPreviewClear: () => handleGroupHoverChange(null),
- });
- return (
- <TableRow
- class={getInteractiveGroupedTableRowClass()}
- data-summary-group-id={groupSummaryScope()?.id ?? undefined}
- data-summary-group-series-count={String(
- groupSummaryScope()?.seriesIds.length ?? 0,
- )}
- data-summary-row-active={isSummaryGroupHighlighted() ? 'true' : 'false'}
- onClick={handleGroupFocusToggle}
- {...groupRowInteraction}
- >
- <TableCell
- colspan={9}
- class={getGroupedTableRowCellClass()}
- >
- <div class="flex items-center gap-2">
- <Show
- when={group.cluster}
- fallback={<span class="text-muted">Standalone</span>}
- >
- <span>{group.cluster}</span>
- <Show when={shouldShowClusterGroupTypeLabel(group.cluster)}>
- <span class={GROUPED_TABLE_ROW_BADGE_CLASS}>
- Cluster
- </span>
- </Show>
+ };
+ const groupRowInteraction = createSummaryInteractiveRowPreviewHandlers({
+ onPreview: () => handleGroupHoverChange(groupSummaryScope()),
+ onPreviewClear: () => handleGroupHoverChange(null),
+ });
+ return (
+ <TableRow
+ class={getInteractiveGroupedTableRowClass()}
+ data-summary-group-id={groupSummaryScope()?.id ?? undefined}
+ data-summary-group-series-count={String(
+ groupSummaryScope()?.seriesIds.length ?? 0,
+ )}
+ data-summary-row-active={isSummaryGroupHighlighted() ? 'true' : 'false'}
+ onClick={handleGroupFocusToggle}
+ {...groupRowInteraction}
+ >
+ <TableCell colspan={9} class={getGroupedTableRowCellClass()}>
+ <div class="flex items-center gap-2">
+ <Show
+ when={group.cluster}
+ fallback={<span class="text-muted">Standalone</span>}
+ >
+ <span>{group.cluster}</span>
+ <Show when={shouldShowClusterGroupTypeLabel(group.cluster)}>
+ <span class={GROUPED_TABLE_ROW_BADGE_CLASS}>Cluster</span>
</Show>
- <span class={GROUPED_TABLE_ROW_META_CLASS}>
- {group.resources.length}{' '}
- {group.resources.length === 1 ? 'resource' : 'resources'}
- </span>
- </div>
- <Show when={tableProps.onDeployCluster}>
- <ClusterDeployBanner
- group={group}
- onDeploy={tableProps.onDeployCluster!}
- />
</Show>
- </TableCell>
- </TableRow>
- );
- }
-
- const resource = item.resource;
- const isExpanded = createMemo(
- () => tableProps.expandedResourceId === resource.id,
- );
- const isHighlighted = createMemo(
- () => tableProps.highlightedResourceId === resource.id,
- );
- const displayName = createMemo(() =>
- getPreferredInfrastructureDisplayName(resource),
- );
- const summaryGroupMemberState = createMemo(() =>
- resolveSummaryGroupMemberInteractionState({
- seriesId: resource.id,
- hoveredGroupScope: tableProps.hoveredSummaryGroupScope,
- focusedGroupScope: tableProps.focusedSummaryGroupScope,
- }),
- );
- const statusIndicator = createMemo(() =>
- getAgentStatusIndicator({ status: resource.status }),
- );
- const metricsKey = createMemo(() => buildMetricKeyForUnifiedResource(resource));
- const detailControlsId = createMemo(() =>
- buildSummaryDisclosureControlsId(resource.id),
+ <span class={GROUPED_TABLE_ROW_META_CLASS}>
+ {group.resources.length}{' '}
+ {group.resources.length === 1 ? 'resource' : 'resources'}
+ </span>
+ </div>
+ <Show when={tableProps.onDeployCluster}>
+ <ClusterDeployBanner
+ group={group}
+ onDeploy={tableProps.onDeployCluster!}
+ />
+ </Show>
+ </TableCell>
+ </TableRow>
);
+ }
- const cpuPercentValue = createMemo(() =>
- resource.cpu ? Math.round(getCpuPercent(resource)) : null,
- );
- const memoryPercentValue = createMemo(() =>
- resource.memory ? Math.round(getMemoryPercent(resource)) : null,
- );
- const diskPercentValue = createMemo(() =>
- resource.disk ? Math.round(getDiskPercent(resource)) : null,
- );
+ const resource = item.resource;
+ const isExpanded = createMemo(() => tableProps.expandedResourceId === resource.id);
+ const isHighlighted = createMemo(
+ () => tableProps.highlightedResourceId === resource.id,
+ );
+ const displayName = createMemo(() =>
+ getPreferredInfrastructureDisplayName(resource),
+ );
+ const summaryGroupMemberState = createMemo(() =>
+ resolveSummaryGroupMemberInteractionState({
+ seriesId: resource.id,
+ hoveredGroupScope: tableProps.hoveredSummaryGroupScope,
+ focusedGroupScope: tableProps.focusedSummaryGroupScope,
+ }),
+ );
+ const statusIndicator = createMemo(() =>
+ getAgentStatusIndicator({ status: resource.status }),
+ );
+ const metricsKey = createMemo(() => buildMetricKeyForUnifiedResource(resource));
+ const detailControlsId = createMemo(() =>
+ buildSummaryDisclosureControlsId(resource.id),
+ );
- const memorySublabel = createMemo(() => {
- if (
- !resource.memory ||
- resource.memory.used === undefined ||
- resource.memory.total === undefined
- )
- return undefined;
- return `${formatBytes(resource.memory.used)}/${formatBytes(resource.memory.total)}`;
- });
+ const cpuPercentValue = createMemo(() =>
+ resource.cpu ? Math.round(getCpuPercent(resource)) : null,
+ );
+ const memoryPercentValue = createMemo(() =>
+ resource.memory ? Math.round(getMemoryPercent(resource)) : null,
+ );
+ const diskPercentValue = createMemo(() =>
+ resource.disk ? Math.round(getDiskPercent(resource)) : null,
+ );
- const diskSublabel = createMemo(() => {
- if (
- !resource.disk ||
- resource.disk.used === undefined ||
- resource.disk.total === undefined
- )
- return undefined;
- return `${formatBytes(resource.disk.used)}/${formatBytes(resource.disk.total)}`;
- });
- const networkTotal = createMemo(
- () => (resource.network?.rxBytes ?? 0) + (resource.network?.txBytes ?? 0),
- );
- const networkEmphasis = createMemo(() =>
- getOutlierEmphasis(networkTotal(), table.ioScale().network),
- );
- const diskIOTotal = createMemo(
- () => (resource.diskIO?.readRate ?? 0) + (resource.diskIO?.writeRate ?? 0),
- );
- const diskIOEmphasis = createMemo(() =>
- getOutlierEmphasis(diskIOTotal(), table.ioScale().diskIO),
- );
+ const memorySublabel = createMemo(() => {
+ if (
+ !resource.memory ||
+ resource.memory.used === undefined ||
+ resource.memory.total === undefined
+ )
+ return undefined;
+ return `${formatBytes(resource.memory.used)}/${formatBytes(resource.memory.total)}`;
+ });
- const rowClass = createMemo(() => {
- const baseHover =
- 'cursor-pointer transition-all duration-200 relative group hover:bg-surface-hover';
+ const diskSublabel = createMemo(() => {
+ if (
+ !resource.disk ||
+ resource.disk.used === undefined ||
+ resource.disk.total === undefined
+ )
+ return undefined;
+ return `${formatBytes(resource.disk.used)}/${formatBytes(resource.disk.total)}`;
+ });
+ const networkTotal = createMemo(
+ () => (resource.network?.rxBytes ?? 0) + (resource.network?.txBytes ?? 0),
+ );
+ const networkEmphasis = createMemo(() =>
+ getOutlierEmphasis(networkTotal(), table.ioScale().network),
+ );
+ const diskIOTotal = createMemo(
+ () => (resource.diskIO?.readRate ?? 0) + (resource.diskIO?.writeRate ?? 0),
+ );
+ const diskIOEmphasis = createMemo(() =>
+ getOutlierEmphasis(diskIOTotal(), table.ioScale().diskIO),
+ );
- if (isExpanded()) {
- return 'cursor-pointer transition-all duration-200 relative z-10 group bg-blue-50 dark:bg-blue-900';
- }
+ const rowClass = createMemo(() => {
+ const baseHover =
+ 'cursor-pointer transition-all duration-200 relative group hover:bg-surface-hover';
- let className = baseHover;
- if (!isResourceOnline(resource)) {
- className += ' opacity-60';
- }
+ if (isExpanded()) {
+ return 'cursor-pointer transition-all duration-200 relative z-10 group bg-blue-50 dark:bg-blue-900';
+ }
- return className;
- });
- const platformBadge = createMemo(() => getPlatformBadge(resource.platformType));
- const sourceBadge = createMemo(() => getSourceBadge(resource.sourceType));
- const unifiedSources = createMemo(() => table.getUnifiedSources(resource));
- const sourceBadges = createMemo(() => getUnifiedSourceBadges(unifiedSources()));
- const systemBadges = createMemo(() =>
- getInfrastructureSystemIdentityBadges(resource),
- );
- const systemTitleBadges = createMemo(() =>
- dedupeResourceBadges([...systemBadges(), ...sourceBadges()]),
- );
- const policyBadges = createMemo(() =>
- getResourcePolicyTableBadges(resource.policy),
- );
- const workloadsHref = createMemo(() => buildWorkloadsHref(resource));
- const resourceRowInteraction = createSummaryInteractiveRowPreviewHandlers({
- onPreview: () => tableProps.onHoverChange?.(resource.id),
- onPreviewClear: () => tableProps.onHoverChange?.(null),
- });
+ let className = baseHover;
+ if (!isResourceOnline(resource)) {
+ className += ' opacity-60';
+ }
- return (
- <>
- <TableRow
- data-row-id={resource.id}
- data-summary-series-id={resource.id}
- data-summary-group-member-active={
- summaryGroupMemberState() !== 'default'
- ? summaryGroupMemberState()
- : undefined
- }
- data-summary-row-active={
- (tableProps.hoveredResourceId === resource.id || isHighlighted()) &&
- !isExpanded()
- ? 'true'
- : 'false'
- }
- class={`${rowClass()} h-8`}
- onClick={() => table.toggleExpand(resource.id)}
- {...resourceRowInteraction}
+ return className;
+ });
+ const platformBadge = createMemo(() => getPlatformBadge(resource.platformType));
+ const sourceBadge = createMemo(() => getSourceBadge(resource.sourceType));
+ const unifiedSources = createMemo(() => table.getUnifiedSources(resource));
+ const sourceBadges = createMemo(() => getUnifiedSourceBadges(unifiedSources()));
+ const systemBadges = createMemo(() =>
+ getInfrastructureSystemIdentityBadges(resource),
+ );
+ const systemTitleBadges = createMemo(() =>
+ dedupeResourceBadges([...systemBadges(), ...sourceBadges()]),
+ );
+ const policyBadges = createMemo(() =>
+ getResourcePolicyTableBadges(resource.policy),
+ );
+ const workloadsHref = createMemo(() => buildWorkloadsHref(resource));
+ const resourceRowInteraction = createSummaryInteractiveRowPreviewHandlers({
+ onPreview: () => tableProps.onHoverChange?.(resource.id),
+ onPreviewClear: () => tableProps.onHoverChange?.(null),
+ });
+
+ return (
+ <>
+ <TableRow
+ data-row-id={resource.id}
+ data-summary-series-id={resource.id}
+ data-summary-group-member-active={
+ summaryGroupMemberState() !== 'default'
+ ? summaryGroupMemberState()
+ : undefined
+ }
+ data-summary-row-active={
+ (tableProps.hoveredResourceId === resource.id || isHighlighted()) &&
+ !isExpanded()
+ ? 'true'
+ : 'false'
+ }
+ class={`${rowClass()} h-8`}
+ onClick={() => table.toggleExpand(resource.id)}
+ {...resourceRowInteraction}
+ >
+ <TableCell
+ class={`pr-1.5 sm:pr-2 py-0.5 align-middle overflow-hidden pl-2 sm:pl-3 ${table.resourceColumn().className}`}
+ width={table.resourceColumn().width}
>
- <TableCell
- class={`pr-1.5 sm:pr-2 py-0.5 align-middle overflow-hidden pl-2 sm:pl-3 ${table.resourceColumn().className}`}
- width={table.resourceColumn().width}
- >
- <div class="flex items-center gap-1.5 min-w-0">
- <SummaryRowActionButton
- kind="disclosure"
- subjectLabel={displayName()}
- expanded={isExpanded()}
- controlsId={detailControlsId()}
- onAction={() => table.toggleExpand(resource.id)}
- onPreviewClear={() => tableProps.onHoverChange?.(null)}
- />
- <StatusDot
- variant={statusIndicator().variant}
- title={statusIndicator().label}
- ariaLabel={statusIndicator().label}
- size="xs"
- />
- <div class="flex min-w-0 flex-1 flex-col">
- <div class="flex min-w-0 items-baseline gap-1">
- <span
- class="block min-w-0 flex-1 truncate font-medium text-[11px] text-base-content select-text"
- title={displayName()}
- >
- {displayName()}
+ <div class="flex items-center gap-1.5 min-w-0">
+ <SummaryRowActionButton
+ kind="disclosure"
+ subjectLabel={displayName()}
+ expanded={isExpanded()}
+ controlsId={detailControlsId()}
+ onAction={() => table.toggleExpand(resource.id)}
+ onPreviewClear={() => tableProps.onHoverChange?.(null)}
+ />
+ <StatusDot
+ variant={statusIndicator().variant}
+ title={statusIndicator().label}
+ ariaLabel={statusIndicator().label}
+ size="xs"
+ />
+ <div class="flex min-w-0 flex-1 flex-col">
+ <div class="flex min-w-0 items-baseline gap-1">
+ <span
+ class="block min-w-0 flex-1 truncate font-medium text-[11px] text-base-content select-text"
+ title={displayName()}
+ >
+ {displayName()}
+ </span>
+ <Show when={shouldShowResourceAlternateName(resource)}>
+ <span class="hidden min-w-0 max-w-[28%] shrink truncate text-[9px] text-muted lg:inline">
+ ({resource.name})
</span>
- <Show when={shouldShowResourceAlternateName(resource)}>
- <span class="hidden min-w-0 max-w-[28%] shrink truncate text-[9px] text-muted lg:inline">
- ({resource.name})
- </span>
- </Show>
- </div>
- <Show when={policyBadges().length > 0}>
- <div class="mt-0.5 flex flex-wrap gap-1">
- <For each={policyBadges()}>
- {(badge) => (
- <span class={badge.className} title={badge.title}>
- {badge.label}
- </span>
- )}
- </For>
- </div>
</Show>
- <ResourceFacetSummary
- recentChanges={resource.recentChanges}
- counts={resource.facetCounts}
- class="mt-0.5"
- />
</div>
- <Show when={workloadsHref()}>
- {(href) => (
- <a
- href={href()}
- class="inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-blue-600 transition-colors hover:bg-blue-100 hover:text-blue-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400 dark:text-blue-300 dark:hover:bg-blue-800 dark:hover:text-blue-200"
- title="View related workloads"
- aria-label={`View workloads for ${displayName()}`}
- onClick={(event) => event.stopPropagation()}
- >
- <svg
- class="h-3.5 w-3.5"
- fill="none"
- viewBox="0 0 24 24"
- stroke="currentColor"
- stroke-width="2"
- >
- <path
- stroke-linecap="round"
- stroke-linejoin="round"
- d="M14 5h5m0 0v5m0-5-8 8"
- />
- <path
- stroke-linecap="round"
- stroke-linejoin="round"
- d="M5 10v9h9"
- />
- </svg>
- </a>
- )}
- </Show>
- </div>
- </TableCell>
-
- <TableCell>
- <Show
- when={cpuPercentValue() !== null}
- fallback={
- <div class="flex justify-center">
- <span class="text-xs">—</span>
+ <Show when={policyBadges().length > 0}>
+ <div class="mt-0.5 flex flex-wrap gap-1">
+ <For each={policyBadges()}>
+ {(badge) => (
+ <span class={badge.className} title={badge.title}>
+ {badge.label}
+ </span>
+ )}
+ </For>
</div>
- }
- >
- <ResponsiveMetricCell
- class="w-full"
- value={cpuPercentValue() ?? 0}
- type="cpu"
- resourceId={table.isMobile() ? undefined : metricsKey()}
- isRunning={isResourceOnline(resource)}
- showMobile={false}
+ </Show>
+ <ResourceFacetSummary
+ recentChanges={resource.recentChanges}
+ counts={resource.facetCounts}
+ class="mt-0.5"
/>
+ </div>
+ <Show when={workloadsHref()}>
+ {(href) => (
+ <a
+ href={href()}
+ class="inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-blue-600 transition-colors hover:bg-blue-100 hover:text-blue-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400 dark:text-blue-300 dark:hover:bg-blue-800 dark:hover:text-blue-200"
+ title="View related workloads"
+ aria-label={`View workloads for ${displayName()}`}
+ onClick={(event) => event.stopPropagation()}
+ >
+ <svg
+ class="h-3.5 w-3.5"
+ fill="none"
+ viewBox="0 0 24 24"
+ stroke="currentColor"
+ stroke-width="2"
+ >
+ <path
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ d="M14 5h5m0 0v5m0-5-8 8"
+ />
+ <path
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ d="M5 10v9h9"
+ />
+ </svg>
+ </a>
+ )}
</Show>
- </TableCell>
+ </div>
+ </TableCell>
- <TableCell>
- <Show
- when={memoryPercentValue() !== null}
- fallback={
- <div class="flex justify-center">
- <span class="text-xs">—</span>
- </div>
- }
- >
- <div class="w-full" title={memorySublabel()}>
- <StackedMemoryBar
- used={resource.memory?.used ?? 0}
- total={resource.memory?.total ?? 0}
- percentOnly={
- !resource.memory?.total && resource.memory?.current != null
- ? resource.memory.current
- : undefined
- }
- swapUsed={resource.agent?.memory?.swapUsed ?? 0}
- swapTotal={resource.agent?.memory?.swapTotal ?? 0}
- />
+ <TableCell>
+ <Show
+ when={cpuPercentValue() !== null}
+ fallback={
+ <div class="flex justify-center">
+ <span class="text-xs">—</span>
</div>
- </Show>
- </TableCell>
+ }
+ >
+ <ResponsiveMetricCell
+ class="w-full"
+ value={cpuPercentValue() ?? 0}
+ type="cpu"
+ resourceId={table.isMobile() ? undefined : metricsKey()}
+ isRunning={isResourceOnline(resource)}
+ showMobile={false}
+ />
+ </Show>
+ </TableCell>
- <TableCell>
- <Show
- when={diskPercentValue() !== null}
- fallback={
- <div class="flex justify-center">
- <span class="text-xs">—</span>
- </div>
- }
- >
- <div class="w-full" title={diskSublabel()}>
- <StackedDiskBar
- disks={normalizeDiskArray(resource.agent?.disks)}
- aggregateDisk={
- resource.disk
- ? ({
- total: resource.disk.total ?? 0,
- used: resource.disk.used ?? 0,
- free: resource.disk.free ?? 0,
- usage: resource.disk.current ?? 0,
- } as Disk)
- : undefined
- }
- />
+ <TableCell>
+ <Show
+ when={memoryPercentValue() !== null}
+ fallback={
+ <div class="flex justify-center">
+ <span class="text-xs">—</span>
</div>
- </Show>
- </TableCell>
+ }
+ >
+ <div class="w-full" title={memorySublabel()}>
+ <StackedMemoryBar
+ used={resource.memory?.used ?? 0}
+ total={resource.memory?.total ?? 0}
+ percentOnly={
+ !resource.memory?.total && resource.memory?.current != null
+ ? resource.memory.current
+ : undefined
+ }
+ swapUsed={resource.agent?.memory?.swapUsed ?? 0}
+ swapTotal={resource.agent?.memory?.swapTotal ?? 0}
+ />
+ </div>
+ </Show>
+ </TableCell>
- <TableCell
- classList={{ hidden: table.isMobile() || !table.isVisible('secondary') }}
+ <TableCell>
+ <Show
+ when={diskPercentValue() !== null}
+ fallback={
+ <div class="flex justify-center">
+ <span class="text-xs">—</span>
+ </div>
+ }
>
- <Show
- when={resource.network}
- fallback={
- <div class="text-center">
- <span class="text-xs text-slate-400">—</span>
- </div>
+ <div class="w-full" title={diskSublabel()}>
+ <StackedDiskBar
+ disks={normalizeDiskArray(resource.agent?.disks)}
+ aggregateDisk={
+ resource.disk
+ ? ({
+ total: resource.disk.total ?? 0,
+ used: resource.disk.used ?? 0,
+ free: resource.disk.free ?? 0,
+ usage: resource.disk.current ?? 0,
+ } as Disk)
+ : undefined
+ }
+ />
+ </div>
+ </Show>
+ </TableCell>
+
+ <TableCell
+ classList={{ hidden: table.isMobile() || !table.isVisible('secondary') }}
+ >
+ <Show
+ when={resource.network}
+ fallback={
+ <div class="text-center">
+ <span class="text-xs text-slate-400">—</span>
+ </div>
+ }
+ >
+ <div
+ class={
+ table.layoutMode() === 'wide'
+ ? 'grid w-full grid-cols-[0.75rem_minmax(0,1fr)_0.75rem_minmax(0,1fr)] items-center gap-x-1 text-[11px] tabular-nums'
+ : 'grid w-full grid-cols-[0.75rem_minmax(0,1fr)] items-center gap-x-1 text-[10px] leading-tight tabular-nums'
}
>
- <div
- class={
- table.layoutMode() === 'wide'
- ? 'grid w-full grid-cols-[0.75rem_minmax(0,1fr)_0.75rem_minmax(0,1fr)] items-center gap-x-1 text-[11px] tabular-nums'
- : 'grid w-full grid-cols-[0.75rem_minmax(0,1fr)] items-center gap-x-1 text-[10px] leading-tight tabular-nums'
+ <span class="inline-flex w-3 justify-center text-emerald-500">↓</span>
+ <span
+ class={`min-w-0 overflow-hidden text-ellipsis whitespace-nowrap ${networkEmphasis().className}`}
+ title={
+ networkEmphasis().showOutlierHint
+ ? `${formatSpeed(resource.network!.rxBytes)} (Top outlier)`
+ : formatSpeed(resource.network!.rxBytes)
}
>
- <span class="inline-flex w-3 justify-center text-emerald-500">↓</span>
- <span
- class={`min-w-0 overflow-hidden text-ellipsis whitespace-nowrap ${networkEmphasis().className}`}
- title={
- networkEmphasis().showOutlierHint
- ? `${formatSpeed(resource.network!.rxBytes)} (Top outlier)`
- : formatSpeed(resource.network!.rxBytes)
- }
- >
- {formatSpeed(resource.network!.rxBytes)}
- </span>
- <span class="inline-flex w-3 justify-center text-orange-400">↑</span>
- <span
- class={`min-w-0 overflow-hidden text-ellipsis whitespace-nowrap ${networkEmphasis().className}`}
- title={
- networkEmphasis().showOutlierHint
- ? `${formatSpeed(resource.network!.txBytes)} (Top outlier)`
- : formatSpeed(resource.network!.txBytes)
- }
- >
- {formatSpeed(resource.network!.txBytes)}
- </span>
- </div>
- </Show>
- </TableCell>
+ {formatSpeed(resource.network!.rxBytes)}
+ </span>
+ <span class="inline-flex w-3 justify-center text-orange-400">↑</span>
+ <span
+ class={`min-w-0 overflow-hidden text-ellipsis whitespace-nowrap ${networkEmphasis().className}`}
+ title={
+ networkEmphasis().showOutlierHint
+ ? `${formatSpeed(resource.network!.txBytes)} (Top outlier)`
+ : formatSpeed(resource.network!.txBytes)
+ }
+ >
+ {formatSpeed(resource.network!.txBytes)}
+ </span>
+ </div>
+ </Show>
+ </TableCell>
- <TableCell
- classList={{
- hidden: table.isMobile() || !table.isHostDiskIoVisible(),
- }}
+ <TableCell
+ classList={{
+ hidden: table.isMobile() || !table.isHostDiskIoVisible(),
+ }}
+ >
+ <Show
+ when={resource.diskIO}
+ fallback={
+ <div class="text-center">
+ <span class="text-xs text-slate-400">—</span>
+ </div>
+ }
>
- <Show
- when={resource.diskIO}
- fallback={
- <div class="text-center">
- <span class="text-xs text-slate-400">—</span>
- </div>
+ <div
+ class={
+ table.layoutMode() === 'wide'
+ ? 'grid w-full grid-cols-[0.75rem_minmax(0,1fr)_0.75rem_minmax(0,1fr)] items-center gap-x-1 text-[11px] tabular-nums'
+ : 'grid w-full grid-cols-[0.75rem_minmax(0,1fr)] items-center gap-x-1 text-[10px] leading-tight tabular-nums'
}
>
- <div
- class={
- table.layoutMode() === 'wide'
- ? 'grid w-full grid-cols-[0.75rem_minmax(0,1fr)_0.75rem_minmax(0,1fr)] items-center gap-x-1 text-[11px] tabular-nums'
- : 'grid w-full grid-cols-[0.75rem_minmax(0,1fr)] items-center gap-x-1 text-[10px] leading-tight tabular-nums'
+ <span class="inline-flex w-3 justify-center font-mono text-blue-500">
+ R
+ </span>
+ <span
+ class={`min-w-0 overflow-hidden text-ellipsis whitespace-nowrap ${diskIOEmphasis().className}`}
+ title={
+ diskIOEmphasis().showOutlierHint
+ ? `${formatSpeed(resource.diskIO!.readRate)} (Top outlier)`
+ : formatSpeed(resource.diskIO!.readRate)
}
>
- <span class="inline-flex w-3 justify-center font-mono text-blue-500">
- R
- </span>
- <span
- class={`min-w-0 overflow-hidden text-ellipsis whitespace-nowrap ${diskIOEmphasis().className}`}
- title={
- diskIOEmphasis().showOutlierHint
- ? `${formatSpeed(resource.diskIO!.readRate)} (Top outlier)`
- : formatSpeed(resource.diskIO!.readRate)
- }
- >
- {formatSpeed(resource.diskIO!.readRate)}
- </span>
- <span class="inline-flex w-3 justify-center font-mono text-amber-500">
- W
- </span>
- <span
- class={`min-w-0 overflow-hidden text-ellipsis whitespace-nowrap ${diskIOEmphasis().className}`}
- title={
- diskIOEmphasis().showOutlierHint
- ? `${formatSpeed(resource.diskIO!.writeRate)} (Top outlier)`
- : formatSpeed(resource.diskIO!.writeRate)
- }
- >
- {formatSpeed(resource.diskIO!.writeRate)}
- </span>
- </div>
- </Show>
- </TableCell>
-
- <TableCell
- classList={{ hidden: table.isMobile() || !table.isVisible('secondary') }}
- >
- <UnifiedResourceSourceBadgeCell
- unifiedBadges={systemBadges()}
- platformBadge={platformBadge()}
- sourceBadge={sourceBadge()}
- titleBadges={systemTitleBadges()}
- layoutMode={table.layoutMode()}
- />
- </TableCell>
-
- <TableCell
- classList={{
- hidden: table.isMobile() || !table.isVisible('supplementary'),
- }}
- >
- <div class="flex justify-center">
- <Show
- when={resource.uptime}
- fallback={<span class="text-xs text-slate-400">—</span>}
+ {formatSpeed(resource.diskIO!.readRate)}
+ </span>
+ <span class="inline-flex w-3 justify-center font-mono text-amber-500">
+ W
+ </span>
+ <span
+ class={`min-w-0 overflow-hidden text-ellipsis whitespace-nowrap ${diskIOEmphasis().className}`}
+ title={
+ diskIOEmphasis().showOutlierHint
+ ? `${formatSpeed(resource.diskIO!.writeRate)} (Top outlier)`
+ : formatSpeed(resource.diskIO!.writeRate)
+ }
>
- <span class="text-xs text-base-content whitespace-nowrap">
- {formatUptime(resource.uptime ?? 0)}
- </span>
- </Show>
+ {formatSpeed(resource.diskIO!.writeRate)}
+ </span>
</div>
- </TableCell>
+ </Show>
+ </TableCell>
+
+ <TableCell
+ classList={{ hidden: table.isMobile() || !table.isVisible('secondary') }}
+ >
+ <UnifiedResourceSourceBadgeCell
+ unifiedBadges={systemBadges()}
+ platformBadge={platformBadge()}
+ sourceBadge={sourceBadge()}
+ titleBadges={systemTitleBadges()}
+ layoutMode={table.layoutMode()}
+ />
+ </TableCell>
+
+ <TableCell
+ classList={{
+ hidden: table.isMobile() || !table.isVisible('supplementary'),
+ }}
+ >
+ <div class="flex justify-center">
+ <Show
+ when={resource.uptime}
+ fallback={<span class="text-xs text-slate-400">—</span>}
+ >
+ <span class="text-xs text-base-content whitespace-nowrap">
+ {formatUptime(resource.uptime ?? 0)}
+ </span>
+ </Show>
+ </div>
+ </TableCell>
+ <TableCell
+ classList={{
+ hidden: table.isMobile() || !table.isVisible('supplementary'),
+ }}
+ >
+ <div class="flex justify-center">
+ <Show
+ when={resource.temperature != null}
+ fallback={<span class="text-xs text-slate-400">—</span>}
+ >
+ <span
+ class={`text-xs whitespace-nowrap font-medium ${
+ (resource.temperature ?? 0) >= 80
+ ? 'text-red-600 dark:text-red-400'
+ : (resource.temperature ?? 0) >= 65
+ ? 'text-amber-600 dark:text-amber-400'
+ : 'text-emerald-600 dark:text-emerald-400'
+ }`}
+ >
+ {formatTemperature(resource.temperature)}
+ </span>
+ </Show>
+ </div>
+ </TableCell>
+ </TableRow>
+ <Show when={isExpanded()}>
+ <TableRow data-inline-detail-for={resource.id}>
<TableCell
- classList={{
- hidden: table.isMobile() || !table.isVisible('supplementary'),
- }}
+ id={detailControlsId()}
+ colspan={9}
+ class="bg-surface-alt px-4 py-4 border-b border-border-subtle shadow-inner"
>
- <div class="flex justify-center">
- <Show
- when={resource.temperature != null}
- fallback={<span class="text-xs text-slate-400">—</span>}
- >
- <span
- class={`text-xs whitespace-nowrap font-medium ${
- (resource.temperature ?? 0) >= 80
- ? 'text-red-600 dark:text-red-400'
- : (resource.temperature ?? 0) >= 65
- ? 'text-amber-600 dark:text-amber-400'
- : 'text-emerald-600 dark:text-emerald-400'
- }`}
- >
- {formatTemperature(resource.temperature)}
- </span>
- </Show>
- </div>
+ <ResourceDetailDrawer
+ resource={resource}
+ resolveResourceLabel={table.resolveResourceLabel}
+ onClose={() => tableProps.onExpandedResourceChange(null)}
+ />
</TableCell>
</TableRow>
- <Show when={isExpanded()}>
- <TableRow data-inline-detail-for={resource.id}>
- <TableCell
- id={detailControlsId()}
- colspan={9}
- class="bg-surface-alt px-4 py-4 border-b border-border-subtle shadow-inner"
- >
- <ResourceDetailDrawer
- resource={resource}
- resolveResourceLabel={table.resolveResourceLabel}
- onClose={() => tableProps.onExpandedResourceChange(null)}
- />
- </TableCell>
- </TableRow>
- </Show>
- </>
- );
- }}
- </For>
+ </Show>
+ </>
+ );
+ }}
+ </For>
- <Show when={table.hostWindowing.isWindowed() && table.hostBottomSpacerHeight() > 0}>
- <TableRow aria-hidden="true">
- <TableCell
- colspan={9}
- class="border-0 p-0"
- height={table.hostBottomSpacerHeight()}
- />
- </TableRow>
- </Show>
- </TableBody>
- </Table>
- </div>
+ <Show when={table.hostWindowing.isWindowed() && table.hostBottomSpacerHeight() > 0}>
+ <TableRow aria-hidden="true">
+ <TableCell
+ colspan={9}
+ class="border-0 p-0"
+ height={table.hostBottomSpacerHeight()}
+ />
+ </TableRow>
+ </Show>
+ </TableBody>
+ </Table>
</TableCard>
</Show>
);
diff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx
index 4b9e56625d..bc73df75ad 100644
--- a/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx
+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx
@@ -51,283 +51,276 @@ export const UnifiedResourcePBSTableSection: Component<UnifiedResourcePBSTableSe
<div class="border-b border-border bg-surface-hover px-3 py-2 text-[11px] font-semibold uppercase tracking-wide text-muted">
PBS Services
</div>
- <div class="overflow-x-auto">
- <Table class={`whitespace-nowrap ${table.tableShellClass()}`}>
- <TableHeader>
- <TableRow class="bg-surface-alt text-muted border-b border-border">
- <TableHead
- class={`text-left pl-2 sm:pl-3 ${table.serviceResourceColumn().className}`}
- width={table.serviceResourceColumn().width}
- >
- {table.headerLabels().resource}
- </TableHead>
- <TableHead
- classList={{ hidden: !table.isServiceVisible('primary') }}
- class={table.serviceCountColumn().className}
- width={table.serviceCountColumn().width}
- >
- {table.headerLabels().datastores}
- </TableHead>
- <TableHead
- classList={{ hidden: !table.isServiceVisible('secondary') }}
- class={table.serviceCountColumn().className}
- width={table.serviceCountColumn().width}
- >
- {table.headerLabels().activity}
- </TableHead>
- <TableHead
- class={table.serviceHealthColumn().className}
- width={table.serviceHealthColumn().width}
- >
- {table.headerLabels().health}
- </TableHead>
- <TableHead
- classList={{ hidden: !table.isServiceVisible('secondary') }}
- class={table.serviceSourceColumn().className}
- width={table.serviceSourceColumn().width}
- >
- {table.headerLabels().source}
- </TableHead>
- <TableHead
- classList={{ hidden: !table.isServiceVisible('supplementary') }}
- class={table.uptimeColumn().className}
- width={table.uptimeColumn().width}
- >
- {table.headerLabels().uptime}
- </TableHead>
- <TableHead
- class={table.serviceActionColumn().className}
- width={table.serviceActionColumn().width}
- >
- {table.headerLabels().action}
- </TableHead>
- </TableRow>
- </TableHeader>
- <TableBody>
- <For each={table.sortedPBSResources()}>
- {(resource) => {
- const isExpanded = createMemo(() => tableProps.expandedResourceId === resource.id);
- const isHighlighted = createMemo(
- () => tableProps.highlightedResourceId === resource.id,
- );
- const displayName = createMemo(() =>
- getPreferredInfrastructureDisplayName(resource),
- );
- const serviceLink = createMemo(() => buildServiceDetailLinks(resource)[0] ?? null);
- const statusIndicator = createMemo(() =>
- getAgentStatusIndicator({ status: resource.status }),
- );
- const pbsRow = createMemo(() => getPBSTableRow(resource));
- const platformBadge = createMemo(() => getPlatformBadge(resource.platformType));
- const sourceBadge = createMemo(() => getSourceBadge(resource.sourceType));
- const unifiedSources = createMemo(() => table.getUnifiedSources(resource));
- const sourceBadges = createMemo(() => getUnifiedSourceBadges(unifiedSources()));
- const systemBadges = createMemo(() =>
- getInfrastructureSystemIdentityBadges(resource),
- );
- const systemTitleBadges = createMemo(() =>
- dedupeResourceBadges([...systemBadges(), ...sourceBadges()]),
- );
- const healthClass = createMemo(
- () =>
- getServiceHealthSummaryPresentation(resource.status, pbsRow()?.health)
- .textClass,
- );
- const activityClass = createMemo(() =>
- (pbsRow()?.activeTaskCount || 0) > 0
- ? 'text-[11px] font-semibold text-emerald-700 dark:text-emerald-300'
- : 'text-xs text-base-content',
- );
+ <Table class={`whitespace-nowrap ${table.tableShellClass()}`}>
+ <TableHeader>
+ <TableRow class="bg-surface-alt text-muted border-b border-border">
+ <TableHead
+ class={`text-left pl-2 sm:pl-3 ${table.serviceResourceColumn().className}`}
+ width={table.serviceResourceColumn().width}
+ >
+ {table.headerLabels().resource}
+ </TableHead>
+ <TableHead
+ classList={{ hidden: !table.isServiceVisible('primary') }}
+ class={table.serviceCountColumn().className}
+ width={table.serviceCountColumn().width}
+ >
+ {table.headerLabels().datastores}
+ </TableHead>
+ <TableHead
+ classList={{ hidden: !table.isServiceVisible('secondary') }}
+ class={table.serviceCountColumn().className}
+ width={table.serviceCountColumn().width}
+ >
+ {table.headerLabels().activity}
+ </TableHead>
+ <TableHead
+ class={table.serviceHealthColumn().className}
+ width={table.serviceHealthColumn().width}
+ >
+ {table.headerLabels().health}
+ </TableHead>
+ <TableHead
+ classList={{ hidden: !table.isServiceVisible('secondary') }}
+ class={table.serviceSourceColumn().className}
+ width={table.serviceSourceColumn().width}
+ >
+ {table.headerLabels().source}
+ </TableHead>
+ <TableHead
+ classList={{ hidden: !table.isServiceVisible('supplementary') }}
+ class={table.uptimeColumn().className}
+ width={table.uptimeColumn().width}
+ >
+ {table.headerLabels().uptime}
+ </TableHead>
+ <TableHead
+ class={table.serviceActionColumn().className}
+ width={table.serviceActionColumn().width}
+ >
+ {table.headerLabels().action}
+ </TableHead>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ <For each={table.sortedPBSResources()}>
+ {(resource) => {
+ const isExpanded = createMemo(() => tableProps.expandedResourceId === resource.id);
+ const isHighlighted = createMemo(
+ () => tableProps.highlightedResourceId === resource.id,
+ );
+ const displayName = createMemo(() => getPreferredInfrastructureDisplayName(resource));
+ const serviceLink = createMemo(() => buildServiceDetailLinks(resource)[0] ?? null);
+ const statusIndicator = createMemo(() =>
+ getAgentStatusIndicator({ status: resource.status }),
+ );
+ const pbsRow = createMemo(() => getPBSTableRow(resource));
+ const platformBadge = createMemo(() => getPlatformBadge(resource.platformType));
+ const sourceBadge = createMemo(() => getSourceBadge(resource.sourceType));
+ const unifiedSources = createMemo(() => table.getUnifiedSources(resource));
+ const sourceBadges = createMemo(() => getUnifiedSourceBadges(unifiedSources()));
+ const systemBadges = createMemo(() =>
+ getInfrastructureSystemIdentityBadges(resource),
+ );
+ const systemTitleBadges = createMemo(() =>
+ dedupeResourceBadges([...systemBadges(), ...sourceBadges()]),
+ );
+ const healthClass = createMemo(
+ () =>
+ getServiceHealthSummaryPresentation(resource.status, pbsRow()?.health).textClass,
+ );
+ const activityClass = createMemo(() =>
+ (pbsRow()?.activeTaskCount || 0) > 0
+ ? 'text-[11px] font-semibold text-emerald-700 dark:text-emerald-300'
+ : 'text-xs text-base-content',
+ );
- const rowClass = createMemo(() => {
- const baseBorder = 'border-b border-border-subtle';
- const baseHover = `cursor-pointer transition-all duration-200 relative hover:shadow-sm group ${baseBorder}`;
+ const rowClass = createMemo(() => {
+ const baseBorder = 'border-b border-border-subtle';
+ const baseHover = `cursor-pointer transition-all duration-200 relative hover:shadow-sm group ${baseBorder}`;
- if (isExpanded()) {
- return `cursor-pointer transition-all duration-200 relative hover:shadow-sm z-10 group bg-blue-50 dark:bg-blue-900 ${baseBorder}`;
- }
+ if (isExpanded()) {
+ return `cursor-pointer transition-all duration-200 relative hover:shadow-sm z-10 group bg-blue-50 dark:bg-blue-900 ${baseBorder}`;
+ }
- let className = baseHover;
- if (!isResourceOnline(resource)) {
- className += ' opacity-60';
- }
+ let className = baseHover;
+ if (!isResourceOnline(resource)) {
+ className += ' opacity-60';
+ }
- return className;
- });
- const detailControlsId = createMemo(() =>
- buildSummaryDisclosureControlsId(resource.id),
- );
- const resourceRowInteraction = createSummaryInteractiveRowPreviewHandlers({
- onPreview: () => tableProps.onHoverChange?.(resource.id),
- onPreviewClear: () => tableProps.onHoverChange?.(null),
- });
+ return className;
+ });
+ const detailControlsId = createMemo(() =>
+ buildSummaryDisclosureControlsId(resource.id),
+ );
+ const resourceRowInteraction = createSummaryInteractiveRowPreviewHandlers({
+ onPreview: () => tableProps.onHoverChange?.(resource.id),
+ onPreviewClear: () => tableProps.onHoverChange?.(null),
+ });
- return (
- <>
- <TableRow
- data-summary-series-id={resource.id}
- data-summary-row-active={
- (tableProps.hoveredResourceId === resource.id || isHighlighted()) &&
- !isExpanded()
- ? 'true'
- : 'false'
- }
- class={`${rowClass()} h-8`}
- onClick={() => table.toggleExpand(resource.id)}
- {...resourceRowInteraction}
- >
- <TableCell class="pr-1.5 sm:pr-2 py-0.5 align-middle overflow-hidden pl-2 sm:pl-3">
- <div class="flex items-center gap-1.5 min-w-0">
- <SummaryRowActionButton
- kind="disclosure"
- subjectLabel={displayName()}
- expanded={isExpanded()}
- controlsId={detailControlsId()}
- onAction={() => table.toggleExpand(resource.id)}
- onPreviewClear={() => tableProps.onHoverChange?.(null)}
- />
- <StatusDot
- variant={statusIndicator().variant}
- title={statusIndicator().label}
- ariaLabel={statusIndicator().label}
- size="xs"
- />
- <span
- class="block min-w-0 flex-1 truncate font-medium text-[11px] text-base-content select-text"
- title={displayName()}
- >
- {displayName()}
+ return (
+ <>
+ <TableRow
+ data-summary-series-id={resource.id}
+ data-summary-row-active={
+ (tableProps.hoveredResourceId === resource.id || isHighlighted()) &&
+ !isExpanded()
+ ? 'true'
+ : 'false'
+ }
+ class={`${rowClass()} h-8`}
+ onClick={() => table.toggleExpand(resource.id)}
+ {...resourceRowInteraction}
+ >
+ <TableCell class="pr-1.5 sm:pr-2 py-0.5 align-middle overflow-hidden pl-2 sm:pl-3">
+ <div class="flex items-center gap-1.5 min-w-0">
+ <SummaryRowActionButton
+ kind="disclosure"
+ subjectLabel={displayName()}
+ expanded={isExpanded()}
+ controlsId={detailControlsId()}
+ onAction={() => table.toggleExpand(resource.id)}
+ onPreviewClear={() => tableProps.onHoverChange?.(null)}
+ />
+ <StatusDot
+ variant={statusIndicator().variant}
+ title={statusIndicator().label}
+ ariaLabel={statusIndicator().label}
+ size="xs"
+ />
+ <span
+ class="block min-w-0 flex-1 truncate font-medium text-[11px] text-base-content select-text"
+ title={displayName()}
+ >
+ {displayName()}
+ </span>
+ <Show when={shouldShowResourceAlternateName(resource)}>
+ <span class="hidden min-w-0 max-w-[35%] shrink truncate text-[9px] text-muted lg:inline">
+ ({resource.name})
</span>
- <Show when={shouldShowResourceAlternateName(resource)}>
- <span class="hidden min-w-0 max-w-[35%] shrink truncate text-[9px] text-muted lg:inline">
- ({resource.name})
- </span>
- </Show>
- <ResourceFacetSummary
- recentChanges={resource.recentChanges}
- counts={resource.facetCounts}
- class="mt-0.5"
- />
- </div>
- </TableCell>
+ </Show>
+ <ResourceFacetSummary
+ recentChanges={resource.recentChanges}
+ counts={resource.facetCounts}
+ class="mt-0.5"
+ />
+ </div>
+ </TableCell>
- <TableCell classList={{ hidden: !table.isServiceVisible('primary') }}>
- <div class="flex justify-center">
- <Show
- when={pbsRow()?.datastores != null}
- fallback={<span class="text-xs text-slate-400">—</span>}
- >
- <span class="text-xs text-base-content">{pbsRow()!.datastores}</span>
- </Show>
- </div>
- </TableCell>
+ <TableCell classList={{ hidden: !table.isServiceVisible('primary') }}>
+ <div class="flex justify-center">
+ <Show
+ when={pbsRow()?.datastores != null}
+ fallback={<span class="text-xs text-slate-400">—</span>}
+ >
+ <span class="text-xs text-base-content">{pbsRow()!.datastores}</span>
+ </Show>
+ </div>
+ </TableCell>
- <TableCell classList={{ hidden: !table.isServiceVisible('secondary') }}>
- <div class="flex justify-center">
- <Show
- when={pbsRow()?.activity}
- fallback={<span class="text-xs text-slate-400">—</span>}
+ <TableCell classList={{ hidden: !table.isServiceVisible('secondary') }}>
+ <div class="flex justify-center">
+ <Show
+ when={pbsRow()?.activity}
+ fallback={<span class="text-xs text-slate-400">—</span>}
+ >
+ <div
+ class="flex flex-col items-center leading-tight"
+ title={[pbsRow()!.activity, pbsRow()!.activityDetail]
+ .filter(Boolean)
+ .join(' · ')}
>
- <div
- class="flex flex-col items-center leading-tight"
- title={[pbsRow()!.activity, pbsRow()!.activityDetail]
- .filter(Boolean)
- .join(' · ')}
- >
- <span class={activityClass()}>{pbsRow()!.activity}</span>
- <Show when={pbsRow()?.activityDetail}>
- <span class="text-[10px] text-muted">
- {pbsRow()!.activityDetail}
- </span>
- </Show>
- </div>
- </Show>
- </div>
- </TableCell>
+ <span class={activityClass()}>{pbsRow()!.activity}</span>
+ <Show when={pbsRow()?.activityDetail}>
+ <span class="text-[10px] text-muted">{pbsRow()!.activityDetail}</span>
+ </Show>
+ </div>
+ </Show>
+ </div>
+ </TableCell>
- <TableCell>
- <div class="flex justify-center">
- <Show
- when={pbsRow()?.health}
- fallback={<span class="text-xs text-slate-400">—</span>}
- >
- <span class={`text-xs font-medium ${healthClass()}`}>
- {pbsRow()!.health}
- </span>
- </Show>
- </div>
- </TableCell>
+ <TableCell>
+ <div class="flex justify-center">
+ <Show
+ when={pbsRow()?.health}
+ fallback={<span class="text-xs text-slate-400">—</span>}
+ >
+ <span class={`text-xs font-medium ${healthClass()}`}>
+ {pbsRow()!.health}
+ </span>
+ </Show>
+ </div>
+ </TableCell>
- <TableCell classList={{ hidden: !table.isServiceVisible('secondary') }}>
- <UnifiedResourceSourceBadgeCell
- unifiedBadges={systemBadges()}
- platformBadge={platformBadge()}
- sourceBadge={sourceBadge()}
- titleBadges={systemTitleBadges()}
- layoutMode={table.layoutMode()}
- />
- </TableCell>
+ <TableCell classList={{ hidden: !table.isServiceVisible('secondary') }}>
+ <UnifiedResourceSourceBadgeCell
+ unifiedBadges={systemBadges()}
+ platformBadge={platformBadge()}
+ sourceBadge={sourceBadge()}
+ titleBadges={systemTitleBadges()}
+ layoutMode={table.layoutMode()}
+ />
+ </TableCell>
+
+ <TableCell
+ classList={{
+ hidden: !table.isServiceVisible('supplementary'),
+ }}
+ >
+ <div class="flex justify-center">
+ <Show
+ when={resource.uptime}
+ fallback={<span class="text-xs text-slate-400">—</span>}
+ >
+ <span class="text-xs text-base-content whitespace-nowrap">
+ {formatUptime(resource.uptime ?? 0)}
+ </span>
+ </Show>
+ </div>
+ </TableCell>
+ <TableCell>
+ <div class="flex justify-center">
+ <Show
+ when={serviceLink()}
+ fallback={<span class="text-xs text-slate-400">—</span>}
+ >
+ {(link) => (
+ <a
+ href={link().href}
+ class="inline-flex items-center rounded border border-blue-200 bg-blue-50 px-1.5 py-0.5 text-[10px] font-medium text-blue-700 transition-colors hover:bg-blue-100 dark:border-blue-700 dark:bg-blue-900 dark:text-blue-200 dark:hover:bg-blue-800"
+ title={link().label}
+ aria-label={link().ariaLabel}
+ onClick={(event) => event.stopPropagation()}
+ >
+ {link().compactLabel}
+ </a>
+ )}
+ </Show>
+ </div>
+ </TableCell>
+ </TableRow>
+ <Show when={isExpanded()}>
+ <TableRow data-inline-detail-for={resource.id}>
<TableCell
- classList={{
- hidden: !table.isServiceVisible('supplementary'),
- }}
+ id={detailControlsId()}
+ colspan={7}
+ class="bg-surface-alt px-4 py-4 border-b border-border-subtle shadow-inner"
>
- <div class="flex justify-center">
- <Show
- when={resource.uptime}
- fallback={<span class="text-xs text-slate-400">—</span>}
- >
- <span class="text-xs text-base-content whitespace-nowrap">
- {formatUptime(resource.uptime ?? 0)}
- </span>
- </Show>
- </div>
- </TableCell>
-
- <TableCell>
- <div class="flex justify-center">
- <Show
- when={serviceLink()}
- fallback={<span class="text-xs text-slate-400">—</span>}
- >
- {(link) => (
- <a
- href={link().href}
- class="inline-flex items-center rounded border border-blue-200 bg-blue-50 px-1.5 py-0.5 text-[10px] font-medium text-blue-700 transition-colors hover:bg-blue-100 dark:border-blue-700 dark:bg-blue-900 dark:text-blue-200 dark:hover:bg-blue-800"
- title={link().label}
- aria-label={link().ariaLabel}
- onClick={(event) => event.stopPropagation()}
- >
- {link().compactLabel}
- </a>
- )}
- </Show>
- </div>
+ <ResourceDetailDrawer
+ resource={resource}
+ resolveResourceLabel={table.resolveResourceLabel}
+ onClose={() => tableProps.onExpandedResourceChange(null)}
+ />
</TableCell>
</TableRow>
- <Show when={isExpanded()}>
- <TableRow data-inline-detail-for={resource.id}>
- <TableCell
- id={detailControlsId()}
- colspan={7}
- class="bg-surface-alt px-4 py-4 border-b border-border-subtle shadow-inner"
- >
- <ResourceDetailDrawer
- resource={resource}
- resolveResourceLabel={table.resolveResourceLabel}
- onClose={() => tableProps.onExpandedResourceChange(null)}
- />
- </TableCell>
- </TableRow>
- </Show>
- </>
- );
- }}
- </For>
- </TableBody>
- </Table>
- </div>
+ </Show>
+ </>
+ );
+ }}
+ </For>
+ </TableBody>
+ </Table>
</Show>
);
};
diff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx
index e217e4454f..acd1c19d53 100644
--- a/frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx
+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx
@@ -51,313 +51,308 @@ export const UnifiedResourcePMGTableSection: Component<UnifiedResourcePMGTableSe
<div class="border-b border-border bg-surface-hover px-3 py-2 text-[11px] font-semibold uppercase tracking-wide text-muted">
PMG Services
</div>
- <div class="overflow-x-auto">
- <Table class={`whitespace-nowrap ${table.tableShellClass()}`}>
- <TableHeader>
- <TableRow class="bg-surface-alt text-muted border-b border-border">
- <TableHead
- class={`text-left pl-2 sm:pl-3 ${table.serviceResourceColumn().className}`}
- width={table.serviceResourceColumn().width}
- >
- {table.headerLabels().resource}
- </TableHead>
- <TableHead
- classList={{ hidden: !table.isServiceVisible('primary') }}
- class={table.serviceQueueColumn().className}
- width={table.serviceQueueColumn().width}
- >
- {table.headerLabels().queue}
- </TableHead>
- <TableHead
- classList={{ hidden: !table.isServiceVisible('secondary') }}
- class={table.serviceQueueColumn().className}
- width={table.serviceQueueColumn().width}
- >
- {table.headerLabels().deferred}
- </TableHead>
- <TableHead
- classList={{ hidden: !table.isServiceVisible('detailed') }}
- class={table.serviceQueueColumn().className}
- width={table.serviceQueueColumn().width}
- >
- {table.headerLabels().hold}
- </TableHead>
- <TableHead
- classList={{ hidden: !table.isServiceVisible('secondary') }}
- class={table.serviceCountColumn().className}
- width={table.serviceCountColumn().width}
- >
- {table.headerLabels().nodes}
- </TableHead>
- <TableHead
- class={table.serviceHealthColumn().className}
- width={table.serviceHealthColumn().width}
- >
- {table.headerLabels().health}
- </TableHead>
- <TableHead
- classList={{ hidden: !table.isServiceVisible('secondary') }}
- class={table.serviceSourceColumn().className}
- width={table.serviceSourceColumn().width}
- >
- {table.headerLabels().source}
- </TableHead>
- <TableHead
- classList={{ hidden: !table.isServiceVisible('supplementary') }}
- class={table.uptimeColumn().className}
- width={table.uptimeColumn().width}
- >
- {table.headerLabels().uptime}
- </TableHead>
- <TableHead
- class={table.serviceActionColumn().className}
- width={table.serviceActionColumn().width}
- >
- {table.headerLabels().action}
- </TableHead>
- </TableRow>
- </TableHeader>
- <TableBody>
- <For each={table.sortedPMGResources()}>
- {(resource) => {
- const isExpanded = createMemo(() => tableProps.expandedResourceId === resource.id);
- const isHighlighted = createMemo(
- () => tableProps.highlightedResourceId === resource.id,
- );
- const displayName = createMemo(() =>
- getPreferredInfrastructureDisplayName(resource),
- );
- const serviceLink = createMemo(() => buildServiceDetailLinks(resource)[0] ?? null);
- const statusIndicator = createMemo(() =>
- getAgentStatusIndicator({ status: resource.status }),
- );
- const pmgRow = createMemo(() => getPMGTableRow(resource));
- const platformBadge = createMemo(() => getPlatformBadge(resource.platformType));
- const sourceBadge = createMemo(() => getSourceBadge(resource.sourceType));
- const unifiedSources = createMemo(() => table.getUnifiedSources(resource));
- const sourceBadges = createMemo(() => getUnifiedSourceBadges(unifiedSources()));
- const systemBadges = createMemo(() =>
- getInfrastructureSystemIdentityBadges(resource),
- );
- const systemTitleBadges = createMemo(() =>
- dedupeResourceBadges([...systemBadges(), ...sourceBadges()]),
- );
- const healthClass = createMemo(
- () =>
- getServiceHealthSummaryPresentation(resource.status, pmgRow()?.health)
- .textClass,
- );
- const queueClass = createMemo(() =>
- (pmgRow()?.deferred || 0) + (pmgRow()?.hold || 0) > 0
- ? 'text-amber-600 dark:text-amber-400'
- : 'text-base-content',
- );
+ <Table class={`whitespace-nowrap ${table.tableShellClass()}`}>
+ <TableHeader>
+ <TableRow class="bg-surface-alt text-muted border-b border-border">
+ <TableHead
+ class={`text-left pl-2 sm:pl-3 ${table.serviceResourceColumn().className}`}
+ width={table.serviceResourceColumn().width}
+ >
+ {table.headerLabels().resource}
+ </TableHead>
+ <TableHead
+ classList={{ hidden: !table.isServiceVisible('primary') }}
+ class={table.serviceQueueColumn().className}
+ width={table.serviceQueueColumn().width}
+ >
+ {table.headerLabels().queue}
+ </TableHead>
+ <TableHead
+ classList={{ hidden: !table.isServiceVisible('secondary') }}
+ class={table.serviceQueueColumn().className}
+ width={table.serviceQueueColumn().width}
+ >
+ {table.headerLabels().deferred}
+ </TableHead>
+ <TableHead
+ classList={{ hidden: !table.isServiceVisible('detailed') }}
+ class={table.serviceQueueColumn().className}
+ width={table.serviceQueueColumn().width}
+ >
+ {table.headerLabels().hold}
+ </TableHead>
+ <TableHead
+ classList={{ hidden: !table.isServiceVisible('secondary') }}
+ class={table.serviceCountColumn().className}
+ width={table.serviceCountColumn().width}
+ >
+ {table.headerLabels().nodes}
+ </TableHead>
+ <TableHead
+ class={table.serviceHealthColumn().className}
+ width={table.serviceHealthColumn().width}
+ >
+ {table.headerLabels().health}
+ </TableHead>
+ <TableHead
+ classList={{ hidden: !table.isServiceVisible('secondary') }}
+ class={table.serviceSourceColumn().className}
+ width={table.serviceSourceColumn().width}
+ >
+ {table.headerLabels().source}
+ </TableHead>
+ <TableHead
+ classList={{ hidden: !table.isServiceVisible('supplementary') }}
+ class={table.uptimeColumn().className}
+ width={table.uptimeColumn().width}
+ >
+ {table.headerLabels().uptime}
+ </TableHead>
+ <TableHead
+ class={table.serviceActionColumn().className}
+ width={table.serviceActionColumn().width}
+ >
+ {table.headerLabels().action}
+ </TableHead>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ <For each={table.sortedPMGResources()}>
+ {(resource) => {
+ const isExpanded = createMemo(() => tableProps.expandedResourceId === resource.id);
+ const isHighlighted = createMemo(
+ () => tableProps.highlightedResourceId === resource.id,
+ );
+ const displayName = createMemo(() => getPreferredInfrastructureDisplayName(resource));
+ const serviceLink = createMemo(() => buildServiceDetailLinks(resource)[0] ?? null);
+ const statusIndicator = createMemo(() =>
+ getAgentStatusIndicator({ status: resource.status }),
+ );
+ const pmgRow = createMemo(() => getPMGTableRow(resource));
+ const platformBadge = createMemo(() => getPlatformBadge(resource.platformType));
+ const sourceBadge = createMemo(() => getSourceBadge(resource.sourceType));
+ const unifiedSources = createMemo(() => table.getUnifiedSources(resource));
+ const sourceBadges = createMemo(() => getUnifiedSourceBadges(unifiedSources()));
+ const systemBadges = createMemo(() =>
+ getInfrastructureSystemIdentityBadges(resource),
+ );
+ const systemTitleBadges = createMemo(() =>
+ dedupeResourceBadges([...systemBadges(), ...sourceBadges()]),
+ );
+ const healthClass = createMemo(
+ () =>
+ getServiceHealthSummaryPresentation(resource.status, pmgRow()?.health).textClass,
+ );
+ const queueClass = createMemo(() =>
+ (pmgRow()?.deferred || 0) + (pmgRow()?.hold || 0) > 0
+ ? 'text-amber-600 dark:text-amber-400'
+ : 'text-base-content',
+ );
- const rowClass = createMemo(() => {
- const baseBorder = 'border-b border-border-subtle';
- const baseHover = `cursor-pointer transition-all duration-200 relative hover:shadow-sm group ${baseBorder}`;
+ const rowClass = createMemo(() => {
+ const baseBorder = 'border-b border-border-subtle';
+ const baseHover = `cursor-pointer transition-all duration-200 relative hover:shadow-sm group ${baseBorder}`;
- if (isExpanded()) {
- return `cursor-pointer transition-all duration-200 relative hover:shadow-sm z-10 group bg-blue-50 dark:bg-blue-900 ${baseBorder}`;
- }
+ if (isExpanded()) {
+ return `cursor-pointer transition-all duration-200 relative hover:shadow-sm z-10 group bg-blue-50 dark:bg-blue-900 ${baseBorder}`;
+ }
- let className = baseHover;
- if (!isResourceOnline(resource)) {
- className += ' opacity-60';
- }
+ let className = baseHover;
+ if (!isResourceOnline(resource)) {
+ className += ' opacity-60';
+ }
- return className;
- });
- const detailControlsId = createMemo(() =>
- buildSummaryDisclosureControlsId(resource.id),
- );
- const resourceRowInteraction = createSummaryInteractiveRowPreviewHandlers({
- onPreview: () => tableProps.onHoverChange?.(resource.id),
- onPreviewClear: () => tableProps.onHoverChange?.(null),
- });
+ return className;
+ });
+ const detailControlsId = createMemo(() =>
+ buildSummaryDisclosureControlsId(resource.id),
+ );
+ const resourceRowInteraction = createSummaryInteractiveRowPreviewHandlers({
+ onPreview: () => tableProps.onHoverChange?.(resource.id),
+ onPreviewClear: () => tableProps.onHoverChange?.(null),
+ });
- return (
- <>
- <TableRow
- data-summary-series-id={resource.id}
- data-summary-row-active={
- (tableProps.hoveredResourceId === resource.id || isHighlighted()) &&
- !isExpanded()
- ? 'true'
- : 'false'
- }
- class={`${rowClass()} h-8`}
- onClick={() => table.toggleExpand(resource.id)}
- {...resourceRowInteraction}
- >
- <TableCell class="pr-1.5 sm:pr-2 py-0.5 align-middle overflow-hidden pl-2 sm:pl-3">
- <div class="flex items-center gap-1.5 min-w-0">
- <SummaryRowActionButton
- kind="disclosure"
- subjectLabel={displayName()}
- expanded={isExpanded()}
- controlsId={detailControlsId()}
- onAction={() => table.toggleExpand(resource.id)}
- onPreviewClear={() => tableProps.onHoverChange?.(null)}
- />
- <StatusDot
- variant={statusIndicator().variant}
- title={statusIndicator().label}
- ariaLabel={statusIndicator().label}
- size="xs"
- />
- <span
- class="block min-w-0 flex-1 truncate font-medium text-[11px] text-base-content select-text"
- title={displayName()}
- >
- {displayName()}
+ return (
+ <>
+ <TableRow
+ data-summary-series-id={resource.id}
+ data-summary-row-active={
+ (tableProps.hoveredResourceId === resource.id || isHighlighted()) &&
+ !isExpanded()
+ ? 'true'
+ : 'false'
+ }
+ class={`${rowClass()} h-8`}
+ onClick={() => table.toggleExpand(resource.id)}
+ {...resourceRowInteraction}
+ >
+ <TableCell class="pr-1.5 sm:pr-2 py-0.5 align-middle overflow-hidden pl-2 sm:pl-3">
+ <div class="flex items-center gap-1.5 min-w-0">
+ <SummaryRowActionButton
+ kind="disclosure"
+ subjectLabel={displayName()}
+ expanded={isExpanded()}
+ controlsId={detailControlsId()}
+ onAction={() => table.toggleExpand(resource.id)}
+ onPreviewClear={() => tableProps.onHoverChange?.(null)}
+ />
+ <StatusDot
+ variant={statusIndicator().variant}
+ title={statusIndicator().label}
+ ariaLabel={statusIndicator().label}
+ size="xs"
+ />
+ <span
+ class="block min-w-0 flex-1 truncate font-medium text-[11px] text-base-content select-text"
+ title={displayName()}
+ >
+ {displayName()}
+ </span>
+ <Show when={shouldShowResourceAlternateName(resource)}>
+ <span class="hidden min-w-0 max-w-[35%] shrink truncate text-[9px] text-muted lg:inline">
+ ({resource.name})
</span>
- <Show when={shouldShowResourceAlternateName(resource)}>
- <span class="hidden min-w-0 max-w-[35%] shrink truncate text-[9px] text-muted lg:inline">
- ({resource.name})
- </span>
- </Show>
- <ResourceFacetSummary
- recentChanges={resource.recentChanges}
- counts={resource.facetCounts}
- class="mt-0.5"
- />
- </div>
- </TableCell>
+ </Show>
+ <ResourceFacetSummary
+ recentChanges={resource.recentChanges}
+ counts={resource.facetCounts}
+ class="mt-0.5"
+ />
+ </div>
+ </TableCell>
- <TableCell classList={{ hidden: !table.isServiceVisible('primary') }}>
- <div class="flex justify-center">
- <Show
- when={pmgRow()?.queue != null}
- fallback={<span class="text-xs text-slate-400">—</span>}
- >
- <span class={`text-xs font-medium ${queueClass()}`}>
- {pmgRow()!.queue}
- </span>
- </Show>
- </div>
- </TableCell>
+ <TableCell classList={{ hidden: !table.isServiceVisible('primary') }}>
+ <div class="flex justify-center">
+ <Show
+ when={pmgRow()?.queue != null}
+ fallback={<span class="text-xs text-slate-400">—</span>}
+ >
+ <span class={`text-xs font-medium ${queueClass()}`}>
+ {pmgRow()!.queue}
+ </span>
+ </Show>
+ </div>
+ </TableCell>
- <TableCell classList={{ hidden: !table.isServiceVisible('secondary') }}>
- <div class="flex justify-center">
- <Show
- when={pmgRow()?.deferred != null}
- fallback={<span class="text-xs text-slate-400">—</span>}
- >
- <span class="text-xs text-base-content">{pmgRow()!.deferred}</span>
- </Show>
- </div>
- </TableCell>
+ <TableCell classList={{ hidden: !table.isServiceVisible('secondary') }}>
+ <div class="flex justify-center">
+ <Show
+ when={pmgRow()?.deferred != null}
+ fallback={<span class="text-xs text-slate-400">—</span>}
+ >
+ <span class="text-xs text-base-content">{pmgRow()!.deferred}</span>
+ </Show>
+ </div>
+ </TableCell>
- <TableCell
- classList={{
- hidden: !table.isServiceVisible('detailed'),
- }}
- >
- <div class="flex justify-center">
- <Show
- when={pmgRow()?.hold != null}
- fallback={<span class="text-xs text-slate-400">—</span>}
- >
- <span class="text-xs text-base-content">{pmgRow()!.hold}</span>
- </Show>
- </div>
- </TableCell>
+ <TableCell
+ classList={{
+ hidden: !table.isServiceVisible('detailed'),
+ }}
+ >
+ <div class="flex justify-center">
+ <Show
+ when={pmgRow()?.hold != null}
+ fallback={<span class="text-xs text-slate-400">—</span>}
+ >
+ <span class="text-xs text-base-content">{pmgRow()!.hold}</span>
+ </Show>
+ </div>
+ </TableCell>
- <TableCell classList={{ hidden: !table.isServiceVisible('secondary') }}>
- <div class="flex justify-center">
- <Show
- when={pmgRow()?.nodes != null}
- fallback={<span class="text-xs text-slate-400">—</span>}
- >
- <span class="text-xs text-base-content">{pmgRow()!.nodes}</span>
- </Show>
- </div>
- </TableCell>
+ <TableCell classList={{ hidden: !table.isServiceVisible('secondary') }}>
+ <div class="flex justify-center">
+ <Show
+ when={pmgRow()?.nodes != null}
+ fallback={<span class="text-xs text-slate-400">—</span>}
+ >
+ <span class="text-xs text-base-content">{pmgRow()!.nodes}</span>
+ </Show>
+ </div>
+ </TableCell>
- <TableCell>
- <div class="flex justify-center">
- <Show
- when={pmgRow()?.health}
- fallback={<span class="text-xs text-slate-400">—</span>}
- >
- <span class={`text-xs font-medium ${healthClass()}`}>
- {pmgRow()!.health}
- </span>
- </Show>
- </div>
- </TableCell>
+ <TableCell>
+ <div class="flex justify-center">
+ <Show
+ when={pmgRow()?.health}
+ fallback={<span class="text-xs text-slate-400">—</span>}
+ >
+ <span class={`text-xs font-medium ${healthClass()}`}>
+ {pmgRow()!.health}
+ </span>
+ </Show>
+ </div>
+ </TableCell>
- <TableCell classList={{ hidden: !table.isServiceVisible('secondary') }}>
- <UnifiedResourceSourceBadgeCell
- unifiedBadges={systemBadges()}
- platformBadge={platformBadge()}
- sourceBadge={sourceBadge()}
- titleBadges={systemTitleBadges()}
- layoutMode={table.layoutMode()}
- />
- </TableCell>
+ <TableCell classList={{ hidden: !table.isServiceVisible('secondary') }}>
+ <UnifiedResourceSourceBadgeCell
+ unifiedBadges={systemBadges()}
+ platformBadge={platformBadge()}
+ sourceBadge={sourceBadge()}
+ titleBadges={systemTitleBadges()}
+ layoutMode={table.layoutMode()}
+ />
+ </TableCell>
+
+ <TableCell
+ classList={{
+ hidden: !table.isServiceVisible('supplementary'),
+ }}
+ >
+ <div class="flex justify-center">
+ <Show
+ when={resource.uptime}
+ fallback={<span class="text-xs text-slate-400">—</span>}
+ >
+ <span class="text-xs text-base-content whitespace-nowrap">
+ {formatUptime(resource.uptime ?? 0)}
+ </span>
+ </Show>
+ </div>
+ </TableCell>
+ <TableCell>
+ <div class="flex justify-center">
+ <Show
+ when={serviceLink()}
+ fallback={<span class="text-xs text-slate-400">—</span>}
+ >
+ {(link) => (
+ <a
+ href={link().href}
+ class="inline-flex items-center rounded border border-blue-200 bg-blue-50 px-1.5 py-0.5 text-[10px] font-medium text-blue-700 transition-colors hover:bg-blue-100 dark:border-blue-700 dark:bg-blue-900 dark:text-blue-200 dark:hover:bg-blue-800"
+ title={link().label}
+ aria-label={link().ariaLabel}
+ onClick={(event) => event.stopPropagation()}
+ >
+ {link().compactLabel}
+ </a>
+ )}
+ </Show>
+ </div>
+ </TableCell>
+ </TableRow>
+ <Show when={isExpanded()}>
+ <TableRow data-inline-detail-for={resource.id}>
<TableCell
- classList={{
- hidden: !table.isServiceVisible('supplementary'),
- }}
+ id={detailControlsId()}
+ colspan={9}
+ class="bg-surface-alt px-4 py-4 border-b border-border-subtle shadow-inner"
>
- <div class="flex justify-center">
- <Show
- when={resource.uptime}
- fallback={<span class="text-xs text-slate-400">—</span>}
- >
- <span class="text-xs text-base-content whitespace-nowrap">
- {formatUptime(resource.uptime ?? 0)}
- </span>
- </Show>
- </div>
- </TableCell>
-
- <TableCell>
- <div class="flex justify-center">
- <Show
- when={serviceLink()}
- fallback={<span class="text-xs text-slate-400">—</span>}
- >
- {(link) => (
- <a
- href={link().href}
- class="inline-flex items-center rounded border border-blue-200 bg-blue-50 px-1.5 py-0.5 text-[10px] font-medium text-blue-700 transition-colors hover:bg-blue-100 dark:border-blue-700 dark:bg-blue-900 dark:text-blue-200 dark:hover:bg-blue-800"
- title={link().label}
- aria-label={link().ariaLabel}
- onClick={(event) => event.stopPropagation()}
- >
- {link().compactLabel}
- </a>
- )}
- </Show>
- </div>
+ <ResourceDetailDrawer
+ resource={resource}
+ resolveResourceLabel={table.resolveResourceLabel}
+ onClose={() => tableProps.onExpandedResourceChange(null)}
+ />
</TableCell>
</TableRow>
- <Show when={isExpanded()}>
- <TableRow data-inline-detail-for={resource.id}>
- <TableCell
- id={detailControlsId()}
- colspan={9}
- class="bg-surface-alt px-4 py-4 border-b border-border-subtle shadow-inner"
- >
- <ResourceDetailDrawer
- resource={resource}
- resolveResourceLabel={table.resolveResourceLabel}
- onClose={() => tableProps.onExpandedResourceChange(null)}
- />
- </TableCell>
- </TableRow>
- </Show>
- </>
- );
- }}
- </For>
- </TableBody>
- </Table>
- </div>
+ </Show>
+ </>
+ );
+ }}
+ </For>
+ </TableBody>
+ </Table>
</Show>
);
};
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx
index 497dc065b3..440e9034f9 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx
@@ -523,6 +523,15 @@ describe('UnifiedResourceTable performance contract', () => {
expect(unifiedResourceHostTableCardSource).toContain(
'onClear={tableProps.clearPinnedSummaryScope}',
);
+ for (const source of [
+ unifiedResourceHostTableCardSource,
+ unifiedResourcePBSTableSectionSource,
+ unifiedResourcePMGTableSectionSource,
+ ]) {
+ expect(source).toMatch(/<Table(?:\s|>)/);
+ expect(source).not.toContain('<div class="overflow-x-auto">');
+ expect(source).not.toContain('<div class="overflow-x-auto bg-surface">');
+ }
expect(unifiedResourceServiceInfrastructureCardSource).toContain('TableCard');
expect(unifiedResourceServiceInfrastructureCardSource).toContain('TableCardHeader');
expect(unifiedResourceServiceInfrastructureCardSource).toContain('showClearAction');
diff --git a/frontend-modern/src/components/Recovery/RecoveryHistoryTable.tsx b/frontend-modern/src/components/Recovery/RecoveryHistoryTable.tsx
index 20aa687772..de523d684f 100644
--- a/frontend-modern/src/components/Recovery/RecoveryHistoryTable.tsx
+++ b/frontend-modern/src/components/Recovery/RecoveryHistoryTable.tsx
@@ -15,14 +15,15 @@ import {
} from '@/components/shared/Table';
import type { ColumnDef } from '@/hooks/useColumnVisibility';
import { formatBytes } from '@/utils/format';
-import { getRecoveryDrawerCloseButtonClass, getRecoveryEmptyStateActionClass } from '@/utils/recoveryActionPresentation';
+import {
+ getRecoveryDrawerCloseButtonClass,
+ getRecoveryEmptyStateActionClass,
+} from '@/utils/recoveryActionPresentation';
import {
getRecoveryHistoryEmptyState,
getRecoveryPointsLoadingState,
} from '@/utils/recoveryEmptyStatePresentation';
-import {
- getRecoveryOutcomeLabel,
-} from '@/utils/recoveryOutcomePresentation';
+import { getRecoveryOutcomeLabel } from '@/utils/recoveryOutcomePresentation';
import {
getRecoveryPointDetailsSummary,
getRecoveryPointItemLabel,
@@ -121,358 +122,361 @@ export const RecoveryHistoryTable: Component<RecoveryHistoryTableProps> = (props
</div>
}
>
- <div class="overflow-x-auto">
- <Table
- class="w-full border-collapse whitespace-nowrap"
- style={{ 'min-width': props.tableMinWidth(), 'table-layout': 'fixed' }}
- >
- <TableHeader>
- <TableRow class="bg-surface-alt text-muted border-b border-border">
- <For each={props.mobileVisibleArtifactColumns()}>
- {(column) => (
- <TableHead
- class={`px-3 py-1.5 text-left text-[11px] font-medium whitespace-nowrap ${getRecoveryArtifactColumnHeaderClass(
- column.id,
- )}`}
+ <Table
+ class="w-full border-collapse whitespace-nowrap"
+ style={{ 'min-width': props.tableMinWidth(), 'table-layout': 'fixed' }}
+ >
+ <TableHeader>
+ <TableRow class="bg-surface-alt text-muted border-b border-border">
+ <For each={props.mobileVisibleArtifactColumns()}>
+ {(column) => (
+ <TableHead
+ class={`px-3 py-1.5 text-left text-[11px] font-medium whitespace-nowrap ${getRecoveryArtifactColumnHeaderClass(
+ column.id,
+ )}`}
+ >
+ {column.label}
+ </TableHead>
+ )}
+ </For>
+ </TableRow>
+ </TableHeader>
+ <TableBody class="divide-y divide-border">
+ <For each={props.groupedByDay()}>
+ {(group) => (
+ <>
+ <TableRow class={RECOVERY_GROUP_HEADER_ROW_CLASS}>
+ <TableCell
+ colSpan={props.tableColumnCount()}
+ class={RECOVERY_GROUP_HEADER_TEXT_CLASS}
>
- {column.label}
- </TableHead>
- )}
- </For>
- </TableRow>
- </TableHeader>
- <TableBody class="divide-y divide-border">
- <For each={props.groupedByDay()}>
- {(group) => (
- <>
- <TableRow class={RECOVERY_GROUP_HEADER_ROW_CLASS}>
- <TableCell colSpan={props.tableColumnCount()} class={RECOVERY_GROUP_HEADER_TEXT_CLASS}>
- <div class="flex items-center justify-between gap-3">
- <div class="flex min-w-0 items-center gap-2">
- <span class="truncate" title={group.label}>
- {group.label}
- </span>
- </div>
- <span class="shrink-0 text-[10px] tabular-nums text-muted">
- {group.items.length} event{group.items.length === 1 ? '' : 's'}
+ <div class="flex items-center justify-between gap-3">
+ <div class="flex min-w-0 items-center gap-2">
+ <span class="truncate" title={group.label}>
+ {group.label}
</span>
</div>
- </TableCell>
- </TableRow>
+ <span class="shrink-0 text-[10px] tabular-nums text-muted">
+ {group.items.length} event{group.items.length === 1 ? '' : 's'}
+ </span>
+ </div>
+ </TableCell>
+ </TableRow>
- <For each={group.items}>
- {(point) => {
- const resourceIndex = props.resourcesById();
- const item = getRecoveryPointItemLabel(point, resourceIndex);
- const itemSecondary = getRecoveryPointItemSecondaryLabel(point);
- const tsMs = getRecoveryPointTimestampMs(point);
- const timeOnly =
- point.completedAt && Number.isFinite(tsMs)
- ? formatRecoveryTimeOnly(tsMs)
- : '—';
- const itemTypePresentation =
- getRecoveryItemTypePresentation(getRecoveryPointItemTypeKey(point));
- const platform = normalizeSourcePlatformQueryValue(getRecoveryPointPlatform(point));
- const outcome =
- (String(point.outcome || 'unknown').toLowerCase() as RecoveryOutcome) ||
- 'unknown';
- const outcomeVariant = (() => {
- switch (outcome) {
- case 'success':
- return 'success' as const;
- case 'warning':
- return 'warning' as const;
- case 'failed':
- return 'danger' as const;
- default:
- return 'muted' as const;
- }
- })();
- const repoLabel = getRecoveryPointRepositoryLabel(point);
- const detailsSummary = getRecoveryPointDetailsSummary(point);
- const verificationLabel =
- point.verified === true
- ? 'Verified'
- : point.verified === false
- ? 'Verification failed'
- : 'Verification unknown';
- const entityId = String(point.entityId || '').trim();
- const cluster = String(
- point.display?.clusterLabel || point.cluster || '',
- ).trim();
- const nodeAgent = String(
- point.display?.nodeHostLabel || point.display?.nodeAgentLabel || point.node || '',
- ).trim();
- const namespace = String(
- point.display?.namespaceLabel || point.namespace || '',
- ).trim();
+ <For each={group.items}>
+ {(point) => {
+ const resourceIndex = props.resourcesById();
+ const item = getRecoveryPointItemLabel(point, resourceIndex);
+ const itemSecondary = getRecoveryPointItemSecondaryLabel(point);
+ const tsMs = getRecoveryPointTimestampMs(point);
+ const timeOnly =
+ point.completedAt && Number.isFinite(tsMs) ? formatRecoveryTimeOnly(tsMs) : '—';
+ const itemTypePresentation = getRecoveryItemTypePresentation(
+ getRecoveryPointItemTypeKey(point),
+ );
+ const platform = normalizeSourcePlatformQueryValue(
+ getRecoveryPointPlatform(point),
+ );
+ const outcome =
+ (String(point.outcome || 'unknown').toLowerCase() as RecoveryOutcome) ||
+ 'unknown';
+ const outcomeVariant = (() => {
+ switch (outcome) {
+ case 'success':
+ return 'success' as const;
+ case 'warning':
+ return 'warning' as const;
+ case 'failed':
+ return 'danger' as const;
+ default:
+ return 'muted' as const;
+ }
+ })();
+ const repoLabel = getRecoveryPointRepositoryLabel(point);
+ const detailsSummary = getRecoveryPointDetailsSummary(point);
+ const verificationLabel =
+ point.verified === true
+ ? 'Verified'
+ : point.verified === false
+ ? 'Verification failed'
+ : 'Verification unknown';
+ const entityId = String(point.entityId || '').trim();
+ const cluster = String(point.display?.clusterLabel || point.cluster || '').trim();
+ const nodeAgent = String(
+ point.display?.nodeHostLabel ||
+ point.display?.nodeAgentLabel ||
+ point.node ||
+ '',
+ ).trim();
+ const namespace = String(
+ point.display?.namespaceLabel || point.namespace || '',
+ ).trim();
- return (
- <>
- <TableRow
- class={`cursor-pointer ${getRecoveryArtifactRowClass(
- props.selectedPoint()?.id === point.id,
- )}`}
- onClick={() => props.toggleSelectedPoint(point)}
- >
- <For each={props.mobileVisibleArtifactColumns()}>
- {(column) => {
- switch (column.id) {
- case 'time':
- return (
- <TableCell
- class={`whitespace-nowrap px-3 py-1 text-right font-mono text-[11px] tabular-nums ${getRecoveryEventTimeTextClass(
- tsMs,
- )}`}
- >
- {timeOnly}
- </TableCell>
- );
- case 'type':
- return (
- <TableCell class="whitespace-nowrap px-3 py-1 text-center">
- <Show
- when={itemTypePresentation}
- fallback={<span class="text-muted">—</span>}
- >
- <span class={itemTypePresentation?.tableBadgeClasses}>
- {itemTypePresentation?.label}
- </span>
- </Show>
- </TableCell>
- );
- case 'item':
- return (
- <TableCell
- class="max-w-[420px] whitespace-nowrap px-3 py-1 text-base-content"
- title={item}
+ return (
+ <>
+ <TableRow
+ class={`cursor-pointer ${getRecoveryArtifactRowClass(
+ props.selectedPoint()?.id === point.id,
+ )}`}
+ onClick={() => props.toggleSelectedPoint(point)}
+ >
+ <For each={props.mobileVisibleArtifactColumns()}>
+ {(column) => {
+ switch (column.id) {
+ case 'time':
+ return (
+ <TableCell
+ class={`whitespace-nowrap px-3 py-1 text-right font-mono text-[11px] tabular-nums ${getRecoveryEventTimeTextClass(
+ tsMs,
+ )}`}
+ >
+ {timeOnly}
+ </TableCell>
+ );
+ case 'type':
+ return (
+ <TableCell class="whitespace-nowrap px-3 py-1 text-center">
+ <Show
+ when={itemTypePresentation}
+ fallback={<span class="text-muted">—</span>}
>
- <div class="flex min-w-0 max-w-full items-center gap-2">
- <StatusDot
- variant={outcomeVariant}
- size="xs"
- pulse={outcome === 'running'}
- title={getRecoveryOutcomeLabel(outcome)}
- ariaLabel={getRecoveryOutcomeLabel(outcome)}
- />
- <div class="min-w-0 flex-1">
- <div class="flex min-w-0 items-baseline gap-1.5">
- <span class="min-w-0 truncate text-[12px] font-medium">
- {item}
+ <span class={itemTypePresentation?.tableBadgeClasses}>
+ {itemTypePresentation?.label}
+ </span>
+ </Show>
+ </TableCell>
+ );
+ case 'item':
+ return (
+ <TableCell
+ class="max-w-[420px] whitespace-nowrap px-3 py-1 text-base-content"
+ title={item}
+ >
+ <div class="flex min-w-0 max-w-full items-center gap-2">
+ <StatusDot
+ variant={outcomeVariant}
+ size="xs"
+ pulse={outcome === 'running'}
+ title={getRecoveryOutcomeLabel(outcome)}
+ ariaLabel={getRecoveryOutcomeLabel(outcome)}
+ />
+ <div class="min-w-0 flex-1">
+ <div class="flex min-w-0 items-baseline gap-1.5">
+ <span class="min-w-0 truncate text-[12px] font-medium">
+ {item}
+ </span>
+ <Show when={itemSecondary}>
+ <span class="shrink-0 text-[10px] font-mono tabular-nums text-muted">
+ {itemSecondary}
</span>
- <Show when={itemSecondary}>
- <span class="shrink-0 text-[10px] font-mono tabular-nums text-muted">
- {itemSecondary}
- </span>
- </Show>
- </div>
- <Show when={props.isMobile}>
- <div class="mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[10px] leading-4 text-muted">
- <span>{getRecoveryPointModeLabel(point.mode)}</span>
- <span>{getSourcePlatformLabel(platform)}</span>
- <Show when={repoLabel}>
- <span class="max-w-full truncate">{repoLabel}</span>
- </Show>
- <span>{verificationLabel}</span>
- </div>
</Show>
</div>
+ <Show when={props.isMobile}>
+ <div class="mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[10px] leading-4 text-muted">
+ <span>{getRecoveryPointModeLabel(point.mode)}</span>
+ <span>{getSourcePlatformLabel(platform)}</span>
+ <Show when={repoLabel}>
+ <span class="max-w-full truncate">{repoLabel}</span>
+ </Show>
+ <span>{verificationLabel}</span>
+ </div>
+ </Show>
</div>
- </TableCell>
- );
- case 'entityId':
- return (
- <TableCell class="whitespace-nowrap px-3 py-1 text-[11px] text-muted font-mono tabular-nums">
- {entityId || '—'}
- </TableCell>
- );
- case 'cluster':
- return (
- <TableCell class="whitespace-nowrap px-3 py-1 text-[11px] text-muted font-mono">
- {cluster || '—'}
- </TableCell>
- );
- case 'nodeAgent':
- return (
- <TableCell class="whitespace-nowrap px-3 py-1 text-[11px] text-muted font-mono">
- {nodeAgent || '—'}
- </TableCell>
- );
- case 'namespace':
- return (
- <TableCell class="whitespace-nowrap px-3 py-1 text-[11px] text-muted font-mono">
- {namespace || '—'}
- </TableCell>
- );
- case 'platform': {
- const badge = getSourcePlatformBadge(platform);
- return (
- <TableCell class="whitespace-nowrap px-3 py-1 text-center">
- <span
- class={`${badge?.classes || ''} inline-flex justify-center px-1.5 py-px text-[9px] font-medium`}
- >
- {badge?.label || getSourcePlatformLabel(platform)}
- </span>
- </TableCell>
- );
- }
- case 'verified':
- return (
- <TableCell class="whitespace-nowrap px-3 py-1 text-center">
- {typeof point.verified === 'boolean' ? (
- point.verified ? (
- <span
- class="inline-flex min-w-[1.25rem] items-center justify-center text-green-600 dark:text-green-400"
- title="Verified"
- >
- <svg
- class="h-3.5 w-3.5"
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- >
- <path
- stroke-linecap="round"
- stroke-linejoin="round"
- stroke-width="2.5"
- d="M5 13l4 4L19 7"
- />
- </svg>
- </span>
- ) : (
- <span
- class="inline-flex min-w-[1.25rem] items-center justify-center text-amber-500 dark:text-amber-400"
- title="Unverified"
+ </div>
+ </TableCell>
+ );
+ case 'entityId':
+ return (
+ <TableCell class="whitespace-nowrap px-3 py-1 text-[11px] text-muted font-mono tabular-nums">
+ {entityId || '—'}
+ </TableCell>
+ );
+ case 'cluster':
+ return (
+ <TableCell class="whitespace-nowrap px-3 py-1 text-[11px] text-muted font-mono">
+ {cluster || '—'}
+ </TableCell>
+ );
+ case 'nodeAgent':
+ return (
+ <TableCell class="whitespace-nowrap px-3 py-1 text-[11px] text-muted font-mono">
+ {nodeAgent || '—'}
+ </TableCell>
+ );
+ case 'namespace':
+ return (
+ <TableCell class="whitespace-nowrap px-3 py-1 text-[11px] text-muted font-mono">
+ {namespace || '—'}
+ </TableCell>
+ );
+ case 'platform': {
+ const badge = getSourcePlatformBadge(platform);
+ return (
+ <TableCell class="whitespace-nowrap px-3 py-1 text-center">
+ <span
+ class={`${badge?.classes || ''} inline-flex justify-center px-1.5 py-px text-[9px] font-medium`}
+ >
+ {badge?.label || getSourcePlatformLabel(platform)}
+ </span>
+ </TableCell>
+ );
+ }
+ case 'verified':
+ return (
+ <TableCell class="whitespace-nowrap px-3 py-1 text-center">
+ {typeof point.verified === 'boolean' ? (
+ point.verified ? (
+ <span
+ class="inline-flex min-w-[1.25rem] items-center justify-center text-green-600 dark:text-green-400"
+ title="Verified"
+ >
+ <svg
+ class="h-3.5 w-3.5"
+ fill="none"
+ stroke="currentColor"
+ viewBox="0 0 24 24"
>
- <svg
- class="h-3.5 w-3.5"
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- >
- <path
- stroke-linecap="round"
- stroke-linejoin="round"
- stroke-width="2.5"
- d="M12 9v2m0 4h.01M12 3a9 9 0 100 18 9 9 0 000-18z"
- />
- </svg>
- </span>
- )
+ <path
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ stroke-width="2.5"
+ d="M5 13l4 4L19 7"
+ />
+ </svg>
+ </span>
) : (
- <span class="text-muted">—</span>
- )}
- </TableCell>
- );
- case 'size':
- return (
- <TableCell class="whitespace-nowrap px-3 py-1 text-right font-mono text-[11px] tabular-nums text-muted">
- {point.sizeBytes && point.sizeBytes > 0
- ? formatBytes(point.sizeBytes)
- : '—'}
- </TableCell>
- );
- case 'method':
- return (
- <TableCell class="whitespace-nowrap px-3 py-1 text-center">
- <span class={getRecoveryArtifactMetadataTextClass()}>
- {getRecoveryPointModeLabel(point.mode)}
- </span>
- </TableCell>
- );
- case 'repository':
- return (
- <TableCell
- class="max-w-[220px] truncate whitespace-nowrap px-3 py-1 text-[11px] leading-4 text-base-content"
- title={repoLabel}
- >
- {repoLabel || '—'}
- </TableCell>
- );
- case 'details':
- return (
- <TableCell
- class="max-w-[280px] truncate whitespace-nowrap px-3 py-1 text-[10px] leading-4 text-muted"
- title={detailsSummary}
+ <span
+ class="inline-flex min-w-[1.25rem] items-center justify-center text-amber-500 dark:text-amber-400"
+ title="Unverified"
+ >
+ <svg
+ class="h-3.5 w-3.5"
+ fill="none"
+ stroke="currentColor"
+ viewBox="0 0 24 24"
+ >
+ <path
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ stroke-width="2.5"
+ d="M12 9v2m0 4h.01M12 3a9 9 0 100 18 9 9 0 000-18z"
+ />
+ </svg>
+ </span>
+ )
+ ) : (
+ <span class="text-muted">—</span>
+ )}
+ </TableCell>
+ );
+ case 'size':
+ return (
+ <TableCell class="whitespace-nowrap px-3 py-1 text-right font-mono text-[11px] tabular-nums text-muted">
+ {point.sizeBytes && point.sizeBytes > 0
+ ? formatBytes(point.sizeBytes)
+ : '—'}
+ </TableCell>
+ );
+ case 'method':
+ return (
+ <TableCell class="whitespace-nowrap px-3 py-1 text-center">
+ <span class={getRecoveryArtifactMetadataTextClass()}>
+ {getRecoveryPointModeLabel(point.mode)}
+ </span>
+ </TableCell>
+ );
+ case 'repository':
+ return (
+ <TableCell
+ class="max-w-[220px] truncate whitespace-nowrap px-3 py-1 text-[11px] leading-4 text-base-content"
+ title={repoLabel}
+ >
+ {repoLabel || '—'}
+ </TableCell>
+ );
+ case 'details':
+ return (
+ <TableCell
+ class="max-w-[280px] truncate whitespace-nowrap px-3 py-1 text-[10px] leading-4 text-muted"
+ title={detailsSummary}
+ >
+ {detailsSummary || '—'}
+ </TableCell>
+ );
+ case 'outcome':
+ return (
+ <TableCell class="whitespace-nowrap px-3 py-1 text-center">
+ <span
+ class={getRecoveryArtifactOutcomeTextClass(outcome)}
+ title={getRecoveryOutcomeLabel(outcome)}
>
- {detailsSummary || '—'}
- </TableCell>
- );
- case 'outcome':
- return (
- <TableCell class="whitespace-nowrap px-3 py-1 text-center">
- <span
- class={getRecoveryArtifactOutcomeTextClass(outcome)}
- title={getRecoveryOutcomeLabel(outcome)}
- >
- {titleCaseDelimitedLabel(outcome)}
- </span>
- </TableCell>
- );
- default:
- return (
- <TableCell class="whitespace-nowrap px-3 py-1 text-muted">
- -
- </TableCell>
- );
- }
- }}
- </For>
- </TableRow>
+ {titleCaseDelimitedLabel(outcome)}
+ </span>
+ </TableCell>
+ );
+ default:
+ return (
+ <TableCell class="whitespace-nowrap px-3 py-1 text-muted">
+ -
+ </TableCell>
+ );
+ }
+ }}
+ </For>
+ </TableRow>
- <Show when={props.selectedPoint()?.id === point.id}>
- <TableRow>
- <TableCell
- colSpan={props.tableColumnCount()}
- class="bg-surface-alt px-0 sm:px-4 py-4 relative"
- >
- <div class="flex items-center justify-between px-4 pb-2 mb-2 border-b border-border">
- <h2 class="text-sm font-semibold text-base-content">
- Recovery Point Details
- </h2>
- <button
- type="button"
- onClick={(event) => {
- event.stopPropagation();
- props.clearSelectedPoint();
- }}
- class={getRecoveryDrawerCloseButtonClass()}
- aria-label="Close details"
+ <Show when={props.selectedPoint()?.id === point.id}>
+ <TableRow>
+ <TableCell
+ colSpan={props.tableColumnCount()}
+ class="bg-surface-alt px-0 sm:px-4 py-4 relative"
+ >
+ <div class="flex items-center justify-between px-4 pb-2 mb-2 border-b border-border">
+ <h2 class="text-sm font-semibold text-base-content">
+ Recovery Point Details
+ </h2>
+ <button
+ type="button"
+ onClick={(event) => {
+ event.stopPropagation();
+ props.clearSelectedPoint();
+ }}
+ class={getRecoveryDrawerCloseButtonClass()}
+ aria-label="Close details"
+ >
+ <svg
+ class="h-5 w-5"
+ fill="none"
+ stroke="currentColor"
+ viewBox="0 0 24 24"
>
- <svg
- class="h-5 w-5"
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- >
- <path
- stroke-linecap="round"
- stroke-linejoin="round"
- stroke-width="2"
- d="M6 18L18 6M6 6l12 12"
- />
- </svg>
- </button>
- </div>
- <div class="px-4">
- <RecoveryPointDetails
- point={point}
- relatedPoints={props.relatedPoints()}
- />
- </div>
- </TableCell>
- </TableRow>
- </Show>
- </>
- );
- }}
- </For>
- </>
- )}
- </For>
- </TableBody>
- </Table>
- </div>
+ <path
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ stroke-width="2"
+ d="M6 18L18 6M6 6l12 12"
+ />
+ </svg>
+ </button>
+ </div>
+ <div class="px-4">
+ <RecoveryPointDetails
+ point={point}
+ relatedPoints={props.relatedPoints()}
+ />
+ </div>
+ </TableCell>
+ </TableRow>
+ </Show>
+ </>
+ );
+ }}
+ </For>
+ </>
+ )}
+ </For>
+ </TableBody>
+ </Table>
<div class="flex items-center justify-between gap-2 px-3 py-1.5 text-[11px] text-muted border-t border-border">
<div>
@@ -481,7 +485,8 @@ export const RecoveryHistoryTable: Component<RecoveryHistoryTableProps> = (props
fallback={<span>Showing 0 of 0 recovery points</span>}
>
<span>
- Showing {(props.recoveryPoints.meta().page - 1) * props.recoveryPoints.meta().limit + 1} -{' '}
+ Showing {(props.recoveryPoints.meta().page - 1) * props.recoveryPoints.meta().limit + 1}{' '}
+ -{' '}
{Math.min(
props.recoveryPoints.meta().page * props.recoveryPoints.meta().limit,
props.recoveryPoints.meta().total,
@@ -505,7 +510,9 @@ export const RecoveryHistoryTable: Component<RecoveryHistoryTableProps> = (props
<button
type="button"
disabled={props.currentPage() >= props.totalPages()}
- onClick={() => props.setCurrentPage(Math.min(props.totalPages(), props.currentPage() + 1))}
+ onClick={() =>
+ props.setCurrentPage(Math.min(props.totalPages(), props.currentPage() + 1))
+ }
class="rounded-md border border-border bg-surface px-2 py-1 text-xs font-medium text-base-content disabled:opacity-50"
>
Next
diff --git a/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx b/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
index 82e1090ddf..43fdb4d135 100644
--- a/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
+++ b/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
@@ -414,205 +414,199 @@ export const RecoveryProtectedInventorySection: Component<
</Show>
<Show when={props.filteredRollups().length > 0}>
- <div class="overflow-x-auto bg-surface">
- <Table
- class={`w-full border-collapse whitespace-nowrap table-fixed ${
- props.isMobile ? 'min-w-full' : 'min-w-[640px]'
- }`}
- >
- <TableHeader>
- <TableRow class="bg-surface-alt/95 text-muted">
- {(
- [
- ['item', getRecoveryArtifactColumnLabel('item', 'Item')],
- ['type', getRecoveryArtifactColumnLabel('type', 'Item Type')],
- ['platform', getRecoveryArtifactColumnLabel('platform', 'Platform')],
- ['lastBackup', 'Latest Point'],
- ['outcome', 'Protection State'],
- ] as const
- ).map(([column, label]) => (
- <TableHead
- class={`sticky top-0 z-[1] bg-surface-alt/95 px-3 py-2 whitespace-nowrap text-left text-[11px] font-medium cursor-pointer select-none hover:text-base-content transition-colors${
- column === 'type'
- ? ' hidden md:table-cell w-[96px]'
- : column === 'platform'
- ? ' hidden lg:table-cell w-[110px]'
- : column === 'lastBackup'
- ? ' w-[120px]'
- : column === 'outcome'
- ? ' w-[116px]'
- : ''
- }`}
- onClick={() => toggleProtectedSort(column)}
+ <Table
+ wrapperClass="bg-surface"
+ class={`w-full border-collapse whitespace-nowrap table-fixed ${
+ props.isMobile ? 'min-w-full' : 'min-w-[640px]'
+ }`}
+ >
+ <TableHeader>
+ <TableRow class="bg-surface-alt/95 text-muted">
+ {(
+ [
+ ['item', getRecoveryArtifactColumnLabel('item', 'Item')],
+ ['type', getRecoveryArtifactColumnLabel('type', 'Item Type')],
+ ['platform', getRecoveryArtifactColumnLabel('platform', 'Platform')],
+ ['lastBackup', 'Latest Point'],
+ ['outcome', 'Protection State'],
+ ] as const
+ ).map(([column, label]) => (
+ <TableHead
+ class={`sticky top-0 z-[1] bg-surface-alt/95 px-3 py-2 whitespace-nowrap text-left text-[11px] font-medium cursor-pointer select-none hover:text-base-content transition-colors${
+ column === 'type'
+ ? ' hidden md:table-cell w-[96px]'
+ : column === 'platform'
+ ? ' hidden lg:table-cell w-[110px]'
+ : column === 'lastBackup'
+ ? ' w-[120px]'
+ : column === 'outcome'
+ ? ' w-[116px]'
+ : ''
+ }`}
+ onClick={() => toggleProtectedSort(column)}
+ >
+ <span class="inline-flex items-center gap-1">
+ {label}
+ <Show when={protectedSortCol() === column}>
+ <svg class="h-3 w-3" viewBox="0 0 12 12" fill="currentColor">
+ {protectedSortDir() === 'asc' ? (
+ <path d="M6 3l3.5 5h-7z" />
+ ) : (
+ <path d="M6 9l3.5-5h-7z" />
+ )}
+ </svg>
+ </Show>
+ </span>
+ </TableHead>
+ ))}
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ <For each={sortedRollups()}>
+ {(rollup) => {
+ const resourceIndex = props.resourcesById();
+ const label = getRecoveryRollupItemLabel(rollup, resourceIndex);
+ const secondaryLabel = getRecoveryRollupItemSecondaryLabel(rollup);
+ const attemptMs = rollup.lastAttemptAt ? Date.parse(rollup.lastAttemptAt) : 0;
+ const successMs = rollup.lastSuccessAt ? Date.parse(rollup.lastSuccessAt) : 0;
+ const inventoryStatus = getRecoveryRollupInventoryStatus(rollup);
+ const inventoryStatusLabel =
+ getRecoveryRollupInventoryStatusLabel(inventoryStatus);
+ const platforms = getRecoveryRollupPlatforms(rollup)
+ .map((platform) => String(platform || '').trim())
+ .filter(Boolean)
+ .sort((left, right) =>
+ getSourcePlatformLabel(left).localeCompare(getSourcePlatformLabel(right)),
+ );
+ const itemTypePresentation =
+ getRecoveryItemTypePresentation(getRecoveryRollupItemTypeKey(rollup)) || null;
+ const nowMs = Date.now();
+ const neverSucceeded = inventoryStatus === 'never-succeeded';
+ const protectionInsight = getProtectionInsight(rollup, inventoryStatus, nowMs);
+
+ return (
+ <TableRow
+ class="cursor-pointer odd:bg-surface even:bg-surface-alt/35 transition-colors hover:bg-surface-hover/95"
+ onClick={() => props.onSelectRollup(rollup.rollupId)}
>
- <span class="inline-flex items-center gap-1">
- {label}
- <Show when={protectedSortCol() === column}>
- <svg class="h-3 w-3" viewBox="0 0 12 12" fill="currentColor">
- {protectedSortDir() === 'asc' ? (
- <path d="M6 3l3.5 5h-7z" />
- ) : (
- <path d="M6 9l3.5-5h-7z" />
- )}
- </svg>
- </Show>
- </span>
- </TableHead>
- ))}
- </TableRow>
- </TableHeader>
- <TableBody>
- <For each={sortedRollups()}>
- {(rollup) => {
- const resourceIndex = props.resourcesById();
- const label = getRecoveryRollupItemLabel(rollup, resourceIndex);
- const secondaryLabel = getRecoveryRollupItemSecondaryLabel(rollup);
- const attemptMs = rollup.lastAttemptAt ? Date.parse(rollup.lastAttemptAt) : 0;
- const successMs = rollup.lastSuccessAt ? Date.parse(rollup.lastSuccessAt) : 0;
- const inventoryStatus = getRecoveryRollupInventoryStatus(rollup);
- const inventoryStatusLabel =
- getRecoveryRollupInventoryStatusLabel(inventoryStatus);
- const platforms = getRecoveryRollupPlatforms(rollup)
- .map((platform) => String(platform || '').trim())
- .filter(Boolean)
- .sort((left, right) =>
- getSourcePlatformLabel(left).localeCompare(getSourcePlatformLabel(right)),
- );
- const itemTypePresentation =
- getRecoveryItemTypePresentation(getRecoveryRollupItemTypeKey(rollup)) || null;
- const nowMs = Date.now();
- const neverSucceeded = inventoryStatus === 'never-succeeded';
- const protectionInsight = getProtectionInsight(rollup, inventoryStatus, nowMs);
-
- return (
- <TableRow
- class="cursor-pointer odd:bg-surface even:bg-surface-alt/35 transition-colors hover:bg-surface-hover/95"
- onClick={() => props.onSelectRollup(rollup.rollupId)}
- >
- <TableCell
- class="max-w-[420px] px-3 py-1.5 text-base-content"
- title={label}
- >
- <div class="flex min-w-0 flex-col gap-1">
- <div class="flex min-w-0 items-center gap-2">
- <StatusDot
- variant={getRecoveryRollupInventoryStatusVariant(inventoryStatus)}
- size="xs"
- pulse={inventoryStatus === 'running'}
- title={inventoryStatusLabel}
- ariaLabel={inventoryStatusLabel}
- />
- <div class="flex min-w-0 items-baseline gap-1.5">
- <span class="truncate text-[13px] font-medium">{label}</span>
- <Show when={secondaryLabel}>
- <span class="shrink-0 text-[10px] font-mono tabular-nums text-muted">
- {secondaryLabel}
- </span>
- </Show>
- </div>
- </div>
- <Show when={protectionInsight}>
- <div class="pl-4 text-[10px] leading-4 text-muted">
- {protectionInsight}
- </div>
- </Show>
- <div class="flex flex-wrap items-center gap-1.5 text-[10px] md:hidden">
- <Show when={itemTypePresentation?.label}>
- <span class={itemTypePresentation?.tableBadgeClasses}>
- {itemTypePresentation?.label}
+ <TableCell class="max-w-[420px] px-3 py-1.5 text-base-content" title={label}>
+ <div class="flex min-w-0 flex-col gap-1">
+ <div class="flex min-w-0 items-center gap-2">
+ <StatusDot
+ variant={getRecoveryRollupInventoryStatusVariant(inventoryStatus)}
+ size="xs"
+ pulse={inventoryStatus === 'running'}
+ title={inventoryStatusLabel}
+ ariaLabel={inventoryStatusLabel}
+ />
+ <div class="flex min-w-0 items-baseline gap-1.5">
+ <span class="truncate text-[13px] font-medium">{label}</span>
+ <Show when={secondaryLabel}>
+ <span class="shrink-0 text-[10px] font-mono tabular-nums text-muted">
+ {secondaryLabel}
</span>
</Show>
- <Show when={platforms.length > 0}>
- <For each={platforms.slice(0, 2)}>
- {(platform) => {
- const badge = getSourcePlatformBadge(platform);
- return (
- <span class={`${badge?.classes || ''} lg:hidden`}>
- {badge?.label || getSourcePlatformLabel(platform)}
- </span>
- );
- }}
- </For>
- </Show>
</div>
</div>
- </TableCell>
-
- <TableCell class="hidden md:table-cell whitespace-nowrap px-3 py-1.5">
- <Show
- when={itemTypePresentation}
- fallback={<span class="text-muted">—</span>}
- >
- <span class={itemTypePresentation?.tableBadgeClasses}>
- {itemTypePresentation?.label}
- </span>
+ <Show when={protectionInsight}>
+ <div class="pl-4 text-[10px] leading-4 text-muted">
+ {protectionInsight}
+ </div>
</Show>
- </TableCell>
-
- <TableCell class="hidden lg:table-cell whitespace-nowrap px-3 py-1.5">
- <div class="flex flex-wrap gap-1.5">
- <For each={platforms}>
- {(platform) => {
- const badge = getSourcePlatformBadge(platform);
- return (
- <span class={badge?.classes || ''}>
- {badge?.label || getSourcePlatformLabel(platform)}
- </span>
- );
- }}
- </For>
+ <div class="flex flex-wrap items-center gap-1.5 text-[10px] md:hidden">
+ <Show when={itemTypePresentation?.label}>
+ <span class={itemTypePresentation?.tableBadgeClasses}>
+ {itemTypePresentation?.label}
+ </span>
+ </Show>
+ <Show when={platforms.length > 0}>
+ <For each={platforms.slice(0, 2)}>
+ {(platform) => {
+ const badge = getSourcePlatformBadge(platform);
+ return (
+ <span class={`${badge?.classes || ''} lg:hidden`}>
+ {badge?.label || getSourcePlatformLabel(platform)}
+ </span>
+ );
+ }}
+ </For>
+ </Show>
</div>
- </TableCell>
+ </div>
+ </TableCell>
- <TableCell
- class={`whitespace-nowrap px-3 py-1.5 ${getRecoveryRollupAgeTextClass(
- rollup,
- nowMs,
- )}`}
- title={
- successMs > 0
- ? formatAbsoluteTime(successMs)
- : attemptMs > 0
- ? formatAbsoluteTime(attemptMs)
- : undefined
- }
+ <TableCell class="hidden md:table-cell whitespace-nowrap px-3 py-1.5">
+ <Show
+ when={itemTypePresentation}
+ fallback={<span class="text-muted">—</span>}
>
- <div class="flex flex-col">
- <span>
- {successMs > 0 ? (
- formatRelativeTime(successMs)
- ) : neverSucceeded ? (
- <span class={getRecoverySpecialOutcomeTextClass('never')}>
- never
+ <span class={itemTypePresentation?.tableBadgeClasses}>
+ {itemTypePresentation?.label}
+ </span>
+ </Show>
+ </TableCell>
+
+ <TableCell class="hidden lg:table-cell whitespace-nowrap px-3 py-1.5">
+ <div class="flex flex-wrap gap-1.5">
+ <For each={platforms}>
+ {(platform) => {
+ const badge = getSourcePlatformBadge(platform);
+ return (
+ <span class={badge?.classes || ''}>
+ {badge?.label || getSourcePlatformLabel(platform)}
</span>
- ) : (
- '—'
- )}
- </span>
- <Show when={inventoryStatus !== 'healthy' && attemptMs > 0}>
- <span class="text-[10px] font-normal text-muted">
- Attempt {formatRelativeTime(attemptMs)}
- </span>
- </Show>
- </div>
- </TableCell>
-
- <TableCell class="whitespace-nowrap px-3 py-1.5">
- <span
- class={`text-[11px] font-medium ${getRecoveryRollupInventoryStatusTextClass(
- inventoryStatus,
- )}`}
- >
- {inventoryStatusLabel}
+ );
+ }}
+ </For>
+ </div>
+ </TableCell>
+
+ <TableCell
+ class={`whitespace-nowrap px-3 py-1.5 ${getRecoveryRollupAgeTextClass(
+ rollup,
+ nowMs,
+ )}`}
+ title={
+ successMs > 0
+ ? formatAbsoluteTime(successMs)
+ : attemptMs > 0
+ ? formatAbsoluteTime(attemptMs)
+ : undefined
+ }
+ >
+ <div class="flex flex-col">
+ <span>
+ {successMs > 0 ? (
+ formatRelativeTime(successMs)
+ ) : neverSucceeded ? (
+ <span class={getRecoverySpecialOutcomeTextClass('never')}>never</span>
+ ) : (
+ '—'
+ )}
</span>
- </TableCell>
- </TableRow>
- );
- }}
- </For>
- </TableBody>
- </Table>
- </div>
+ <Show when={inventoryStatus !== 'healthy' && attemptMs > 0}>
+ <span class="text-[10px] font-normal text-muted">
+ Attempt {formatRelativeTime(attemptMs)}
+ </span>
+ </Show>
+ </div>
+ </TableCell>
+
+ <TableCell class="whitespace-nowrap px-3 py-1.5">
+ <span
+ class={`text-[11px] font-medium ${getRecoveryRollupInventoryStatusTextClass(
+ inventoryStatus,
+ )}`}
+ >
+ {inventoryStatusLabel}
+ </span>
+ </TableCell>
+ </TableRow>
+ );
+ }}
+ </For>
+ </TableBody>
+ </Table>
<div class="flex items-center justify-between gap-2 border-t border-border bg-surface px-4 py-3 text-xs text-muted">
<div>
<Show
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index 5b01874d49..eb06b982b3 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -64,6 +64,7 @@ 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 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';
@@ -134,13 +135,16 @@ import storageGroupRowSource from '@/components/Storage/StorageGroupRow.tsx?raw'
import storageGroupPresentationSource from '@/features/storageBackups/groupPresentation.ts?raw';
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 recoveryComponentSource from '@/components/Recovery/Recovery.tsx?raw';
import recoveryHistorySectionSource from '@/components/Recovery/RecoveryHistorySection.tsx?raw';
+import recoveryHistoryTableSource from '@/components/Recovery/RecoveryHistoryTable.tsx?raw';
import recoveryProtectedInventorySectionSource from '@/components/Recovery/RecoveryProtectedInventorySection.tsx?raw';
import recoveryTablePresentationSource from '@/utils/recoveryTablePresentation.ts?raw';
+import alertHistoryTableSectionSource from '@/features/alerts/AlertHistoryTableSection.tsx?raw';
import alertHistoryTableGroupRowSource from '@/features/alerts/AlertHistoryTableGroupRow.tsx?raw';
import alertResourceTableDesktopSource from '@/components/Alerts/AlertResourceTableDesktop.tsx?raw';
import resourceDetailDrawerOverviewSource from '@/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx?raw';
@@ -503,6 +507,57 @@ describe('shared primitive guardrails', () => {
expect(unifiedResourceHostTableCardSource).toContain('data-summary-group-member-active');
});
+ it('keeps product table scroll frames on the shared table shell', () => {
+ expect(tableSource).toContain('wrapperClass');
+ expect(tableSource).toContain('w-full overflow-x-auto touch-scroll');
+ expect(tableSource).toContain('w-full border-collapse text-left whitespace-nowrap');
+ expect(tableCardSource).toContain('TABLE_CARD_FRAME_CLASS');
+ expect(tableCardSource).toContain('overflow-hidden');
+ expect(tableCardHeaderSource).toContain('TABLE_CARD_HEADER_CLASS');
+
+ for (const source of [
+ unifiedResourceHostTableCardSource,
+ unifiedResourcePBSTableSectionSource,
+ unifiedResourcePMGTableSectionSource,
+ recoveryHistoryTableSource,
+ recoveryProtectedInventorySectionSource,
+ alertHistoryTableSectionSource,
+ workloadsTableSource,
+ storagePoolsTableSource,
+ ]) {
+ expect(source).toContain('<Table');
+ expect(source).not.toContain('<div class="overflow-x-auto">');
+ expect(source).not.toContain('<div class="overflow-x-auto bg-surface">');
+ }
+
+ for (const source of [
+ unifiedResourceHostTableCardSource,
+ recoveryHistorySectionSource,
+ recoveryProtectedInventorySectionSource,
+ alertHistoryTableSectionSource,
+ workloadsTableSource,
+ storageContentCardSource,
+ ]) {
+ expect(source).toContain('<TableCard');
+ }
+
+ for (const source of [
+ unifiedResourceHostTableCardSource,
+ recoveryHistorySectionSource,
+ recoveryProtectedInventorySectionSource,
+ workloadsTableSource,
+ storageContentCardSource,
+ ]) {
+ expect(source).toContain('TableCardHeader');
+ }
+
+ expect(alertHistoryTableSectionSource).not.toContain(
+ 'overflow-hidden rounded border border-border',
+ );
+ expect(recoveryProtectedInventorySectionSource).toContain('wrapperClass="bg-surface"');
+ expect(storageContentCardSource).toContain('<StoragePoolsTable');
+ });
+
it('keeps grouped/list table-mode controls on one shared presentation contract', () => {
expect(groupedTableModeSegmentedControlSource).toContain('GroupedTableModeSegmentedControl');
expect(groupedTableModeSegmentedControlSource).toContain('GROUPED_TABLE_MODE_ARIA_LABEL');
diff --git a/frontend-modern/src/features/alerts/AlertHistoryTableSection.tsx b/frontend-modern/src/features/alerts/AlertHistoryTableSection.tsx
index 73c7e58761..4cbb5e07de 100644
--- a/frontend-modern/src/features/alerts/AlertHistoryTableSection.tsx
+++ b/frontend-modern/src/features/alerts/AlertHistoryTableSection.tsx
@@ -1,12 +1,7 @@
import { For, Show } from 'solid-js';
-import {
- Table,
- TableBody,
- TableHead,
- TableHeader,
- TableRow,
-} from '@/components/shared/Table';
+import { Table, TableBody, TableHead, TableHeader, TableRow } from '@/components/shared/Table';
+import { TableCard } from '@/components/shared/TableCard';
import {
getAlertHistoryEmptyState,
getAlertHistoryLoadingState,
@@ -35,64 +30,57 @@ export function AlertHistoryTableSection(props: AlertHistoryTableSectionProps) {
</div>
}
>
- <div class="mb-2 overflow-hidden rounded border border-border">
- <div class="overflow-x-auto">
- <Table class="w-full min-w-[max-content] text-[11px] sm:text-sm">
- <TableHeader>
- <TableRow class="border-b border-border bg-surface-hover text-muted">
- <TableHead class="p-1 px-1 text-left text-[10px] font-medium uppercase tracking-wider sm:p-1.5 sm:px-2 sm:text-xs">
- Timestamp
- </TableHead>
- <TableHead class="p-1 px-1 text-center text-[10px] font-medium uppercase tracking-wider sm:p-1.5 sm:px-2 sm:text-xs">
- Source
- </TableHead>
- <TableHead class="p-1 px-1 text-left text-[10px] font-medium uppercase tracking-wider sm:p-1.5 sm:px-2 sm:text-xs">
- Resource
- </TableHead>
- <TableHead class="p-1 px-1 text-left text-[10px] font-medium uppercase tracking-wider sm:p-1.5 sm:px-2 sm:text-xs">
- {getTypeColumnLabel()}
- </TableHead>
- <TableHead class="p-1 px-1 text-center text-[10px] font-medium uppercase tracking-wider sm:p-1.5 sm:px-2 sm:text-xs">
- Severity
- </TableHead>
- <TableHead class="p-1 px-1 text-left text-[10px] font-medium uppercase tracking-wider sm:p-1.5 sm:px-2 sm:text-xs">
- Message
- </TableHead>
- <TableHead class="p-1 px-1 text-center text-[10px] font-medium uppercase tracking-wider sm:p-1.5 sm:px-2 sm:text-xs">
- Duration
- </TableHead>
- <TableHead class="p-1 px-1 text-center text-[10px] font-medium uppercase tracking-wider sm:p-1.5 sm:px-2 sm:text-xs">
- Status
- </TableHead>
- <TableHead class="p-1 px-1 text-left text-[10px] font-medium uppercase tracking-wider sm:p-1.5 sm:px-2 sm:text-xs">
- Node
- </TableHead>
- <TableHead class="p-1 px-1 text-center text-[10px] font-medium uppercase tracking-wider sm:p-1.5 sm:px-2 sm:text-xs">
- Actions
- </TableHead>
- </TableRow>
- </TableHeader>
- <TableBody>
- <For each={props.state.groupedAlerts()}>
- {(group) => (
- <>
- <AlertHistoryTableGroupRow group={group} />
+ <TableCard class="mb-2">
+ <Table class="w-full min-w-[max-content] text-[11px] sm:text-sm">
+ <TableHeader>
+ <TableRow class="border-b border-border bg-surface-hover text-muted">
+ <TableHead class="p-1 px-1 text-left text-[10px] font-medium uppercase tracking-wider sm:p-1.5 sm:px-2 sm:text-xs">
+ Timestamp
+ </TableHead>
+ <TableHead class="p-1 px-1 text-center text-[10px] font-medium uppercase tracking-wider sm:p-1.5 sm:px-2 sm:text-xs">
+ Source
+ </TableHead>
+ <TableHead class="p-1 px-1 text-left text-[10px] font-medium uppercase tracking-wider sm:p-1.5 sm:px-2 sm:text-xs">
+ Resource
+ </TableHead>
+ <TableHead class="p-1 px-1 text-left text-[10px] font-medium uppercase tracking-wider sm:p-1.5 sm:px-2 sm:text-xs">
+ {getTypeColumnLabel()}
+ </TableHead>
+ <TableHead class="p-1 px-1 text-center text-[10px] font-medium uppercase tracking-wider sm:p-1.5 sm:px-2 sm:text-xs">
+ Severity
+ </TableHead>
+ <TableHead class="p-1 px-1 text-left text-[10px] font-medium uppercase tracking-wider sm:p-1.5 sm:px-2 sm:text-xs">
+ Message
+ </TableHead>
+ <TableHead class="p-1 px-1 text-center text-[10px] font-medium uppercase tracking-wider sm:p-1.5 sm:px-2 sm:text-xs">
+ Duration
+ </TableHead>
+ <TableHead class="p-1 px-1 text-center text-[10px] font-medium uppercase tracking-wider sm:p-1.5 sm:px-2 sm:text-xs">
+ Status
+ </TableHead>
+ <TableHead class="p-1 px-1 text-left text-[10px] font-medium uppercase tracking-wider sm:p-1.5 sm:px-2 sm:text-xs">
+ Node
+ </TableHead>
+ <TableHead class="p-1 px-1 text-center text-[10px] font-medium uppercase tracking-wider sm:p-1.5 sm:px-2 sm:text-xs">
+ Actions
+ </TableHead>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ <For each={props.state.groupedAlerts()}>
+ {(group) => (
+ <>
+ <AlertHistoryTableGroupRow group={group} />
- <For each={group.alerts}>
- {(alert) => (
- <AlertHistoryTableAlertRow
- alert={alert}
- state={props.state}
- />
- )}
- </For>
- </>
- )}
- </For>
- </TableBody>
- </Table>
- </div>
- </div>
+ <For each={group.alerts}>
+ {(alert) => <AlertHistoryTableAlertRow alert={alert} state={props.state} />}
+ </For>
+ </>
+ )}
+ </For>
+ </TableBody>
+ </Table>
+ </TableCard>
</Show>
}
>
diff --git a/frontend-modern/src/pages/__tests__/Alerts.helpers.test.ts b/frontend-modern/src/pages/__tests__/Alerts.helpers.test.ts
index df5a4cd961..800fffb4bc 100644
--- a/frontend-modern/src/pages/__tests__/Alerts.helpers.test.ts
+++ b/frontend-modern/src/pages/__tests__/Alerts.helpers.test.ts
@@ -465,6 +465,15 @@ describe('tab path helpers', () => {
expect(alertHistoryTableSectionSource).toContain('export function AlertHistoryTableSection');
expect(alertHistoryTableSectionSource).toContain('AlertHistoryTableGroupRow');
expect(alertHistoryTableSectionSource).toContain('AlertHistoryTableAlertRow');
+ expect(alertHistoryTableSectionSource).toContain('<TableCard');
+ expect(alertHistoryTableSectionSource).toMatch(/<Table(?:\s|>)/);
+ expect(alertHistoryTableSectionSource).not.toContain(
+ 'overflow-hidden rounded border border-border',
+ );
+ expect(alertHistoryTableSectionSource).not.toContain('<div class="overflow-x-auto">');
+ expect(alertHistoryTableSectionSource).not.toContain(
+ '<div class="overflow-x-auto bg-surface">',
+ );
expect(alertHistoryTableSectionSource).not.toContain('IncidentTimelinePanel');
expect(alertHistoryTableSectionSource).not.toContain('InvestigateAlertButton');
expect(alertHistoryTableGroupRowSource).toContain('export function AlertHistoryTableGroupRow');
diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
index f56745d257..0373c70a41 100644
--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
@@ -1101,11 +1101,24 @@ describe('frontend resource type boundaries', () => {
expect(recoveryHistorySectionSource).toContain('RecoveryHistoryTable');
expect(recoveryHistorySectionSource).toContain('TableCard');
expect(recoveryHistorySectionSource).toContain('getRecoveryAllHistoryLabel');
+ expect(recoveryHistoryTableSource).toMatch(/<Table(?:\s|>)/);
+ expect(recoveryHistoryTableSource).not.toContain('<div class="overflow-x-auto">');
+ expect(recoveryHistoryTableSource).not.toContain(
+ '<div class="overflow-x-auto bg-surface">',
+ );
expect(recoveryTablePresentationSource).toContain('getAllFilterOptionLabel');
expect(recoveryHistorySectionSource).not.toContain(
'overflow-hidden border-border-subtle bg-surface',
);
expect(recoveryProtectedInventorySectionSource).toContain('TableCard');
+ expect(recoveryProtectedInventorySectionSource).toMatch(/<Table(?:\s|>)/);
+ expect(recoveryProtectedInventorySectionSource).toContain('wrapperClass="bg-surface"');
+ expect(recoveryProtectedInventorySectionSource).not.toContain(
+ '<div class="overflow-x-auto">',
+ );
+ expect(recoveryProtectedInventorySectionSource).not.toContain(
+ '<div class="overflow-x-auto bg-surface">',
+ );
expect(recoveryProtectedInventorySectionSource).not.toContain(
'overflow-hidden border-border-subtle bg-surface',
);
@@ -2008,6 +2021,11 @@ describe('frontend resource type boundaries', () => {
expect(storageContentCardSource).toContain('TableCard');
expect(storageContentCardSource).toContain('TableCardHeader');
expect(storageContentCardSource).toContain('STORAGE_CONTENT_CARD_BODY_CLASS');
+ expect(storagePoolsTableSource).toMatch(/<Table(?:\s|>)/);
+ expect(storagePoolsTableSource).not.toContain('<div class="overflow-x-auto">');
+ expect(storagePoolsTableSource).not.toContain(
+ '<div class="overflow-x-auto bg-surface">',
+ );
expect(storageContentCardSource).not.toContain(
"props.selectedNodeId() === 'all' ? null : props.selectedNodeId()",
);