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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Split unified resource table render owners
rcourtman38c621fed3cb
diff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.mdindex c58d4c968e..563e3b8c05 100644--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md@@ -84,37 +84,47 @@ regression protection.62. `frontend-modern/src/components/Dashboard/__tests__/workloadTopology.test.ts`63. `frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx`64. `frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts`-65. `frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts`-66. `frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts`-67. `frontend-modern/src/components/Dashboard/__tests__/Dashboard.performance.contract.test.tsx`-68. `frontend-modern/src/components/Dashboard/__tests__/DashboardFilter.test.tsx`-69. `frontend-modern/src/components/Dashboard/__tests__/useDashboardFilterState.test.ts`-70. `frontend-modern/src/components/Dashboard/__tests__/useDashboardSelectionState.test.ts`-71. `frontend-modern/src/components/Dashboard/MetricBar.test.tsx`-72. `frontend-modern/src/components/Dashboard/__tests__/useMetricBarState.test.tsx`-73. `frontend-modern/src/components/Dashboard/__tests__/EnhancedCPUBar.test.tsx`-74. `frontend-modern/src/components/Dashboard/__tests__/useEnhancedCPUBarState.test.tsx`-75. `frontend-modern/src/components/Dashboard/ThresholdSlider.test.tsx`-76. `frontend-modern/src/components/Dashboard/__tests__/useThresholdSliderState.test.ts`-77. `frontend-modern/src/components/Dashboard/__tests__/StackedDiskBar.test.tsx`-78. `frontend-modern/src/components/Dashboard/__tests__/useStackedDiskBarState.test.tsx`-79. `frontend-modern/src/components/Dashboard/StackedMemoryBar.test.tsx`-80. `frontend-modern/src/components/Dashboard/__tests__/useStackedMemoryBarState.test.tsx`-81. `frontend-modern/src/components/Dashboard/__tests__/DiskList.test.tsx`-82. `frontend-modern/src/components/Dashboard/__tests__/GuestRow.test.tsx`-83. `frontend-modern/src/components/Dashboard/GuestDrawer.test.tsx`-84. `frontend-modern/src/components/Dashboard/__tests__/useGroupedTableWindowing.test.ts`-85. `frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx`-86. `frontend-modern/src/components/Dashboard/useDashboardWorkloadViewportSync.ts`-87. `frontend-modern/src/components/Dashboard/__tests__/useDashboardWorkloadViewportSync.test.tsx`+65. `frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx`+66. `frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx`+67. `frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx`+68. `frontend-modern/src/components/Infrastructure/UnifiedResourceServiceInfrastructureCard.tsx`+69. `frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts`+70. `frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts`+71. `frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts`+72. `frontend-modern/src/components/Dashboard/__tests__/Dashboard.performance.contract.test.tsx`+73. `frontend-modern/src/components/Dashboard/__tests__/DashboardFilter.test.tsx`+74. `frontend-modern/src/components/Dashboard/__tests__/useDashboardFilterState.test.ts`+75. `frontend-modern/src/components/Dashboard/__tests__/useDashboardSelectionState.test.ts`+76. `frontend-modern/src/components/Dashboard/MetricBar.test.tsx`+77. `frontend-modern/src/components/Dashboard/__tests__/useMetricBarState.test.tsx`+78. `frontend-modern/src/components/Dashboard/__tests__/EnhancedCPUBar.test.tsx`+79. `frontend-modern/src/components/Dashboard/__tests__/useEnhancedCPUBarState.test.tsx`+80. `frontend-modern/src/components/Dashboard/ThresholdSlider.test.tsx`+81. `frontend-modern/src/components/Dashboard/__tests__/useThresholdSliderState.test.ts`+82. `frontend-modern/src/components/Dashboard/__tests__/StackedDiskBar.test.tsx`+83. `frontend-modern/src/components/Dashboard/__tests__/useStackedDiskBarState.test.tsx`+84. `frontend-modern/src/components/Dashboard/StackedMemoryBar.test.tsx`+85. `frontend-modern/src/components/Dashboard/__tests__/useStackedMemoryBarState.test.tsx`+86. `frontend-modern/src/components/Dashboard/__tests__/DiskList.test.tsx`+87. `frontend-modern/src/components/Dashboard/__tests__/GuestRow.test.tsx`+88. `frontend-modern/src/components/Dashboard/GuestDrawer.test.tsx`+89. `frontend-modern/src/components/Dashboard/__tests__/useGroupedTableWindowing.test.ts`+90. `frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx`+91. `frontend-modern/src/components/Dashboard/useDashboardWorkloadViewportSync.ts`+92. `frontend-modern/src/components/Dashboard/__tests__/useDashboardWorkloadViewportSync.test.tsx`## Shared Boundaries1. `frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts` shared with `unified-resources`: the infrastructure selector pipeline is both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.2. `frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts` shared with `unified-resources`: resource detail mappers are both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.-3. `frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx` shared with `unified-resources`: the unified resource table is both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.-4. `frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts` shared with `unified-resources`: unified resource table state, grouping, and windowing are both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.-5. `internal/api/slo.go` shared with `api-contracts`: the SLO endpoint is both an API contract surface and a protected performance hot-path boundary.+3. `frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx` shared with `unified-resources`: the unified resource host table card is both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.+4. `frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx` shared with `unified-resources`: the unified resource PBS section is both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.+5. `frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx` shared with `unified-resources`: the unified resource PMG section is both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.+6. `frontend-modern/src/components/Infrastructure/UnifiedResourceServiceInfrastructureCard.tsx` shared with `unified-resources`: the unified resource service infrastructure card is both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.+7. `frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx` shared with `unified-resources`: the unified resource table is both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.+8. `frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts` shared with `unified-resources`: unified resource service row shaping and I/O emphasis are both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.+9. `frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts` shared with `unified-resources`: unified resource table state, grouping, and windowing are both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.+10. `internal/api/slo.go` shared with `api-contracts`: the SLO endpoint is both an API contract surface and a protected performance hot-path boundary.## Extension Pointsdiff --git a/docs/release-control/v6/internal/subsystems/registry.json b/docs/release-control/v6/internal/subsystems/registry.jsonindex cf5d4c0350..b9d73e1c4f 100644--- a/docs/release-control/v6/internal/subsystems/registry.json+++ b/docs/release-control/v6/internal/subsystems/registry.json@@ -73,6 +73,38 @@"unified-resources"]},+ {+ "path": "frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx",+ "rationale": "the unified resource host table card is both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary",+ "subsystems": [+ "performance-and-scalability",+ "unified-resources"+ ]+ },+ {+ "path": "frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx",+ "rationale": "the unified resource PBS section is both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary",+ "subsystems": [+ "performance-and-scalability",+ "unified-resources"+ ]+ },+ {+ "path": "frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx",+ "rationale": "the unified resource PMG section is both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary",+ "subsystems": [+ "performance-and-scalability",+ "unified-resources"+ ]+ },+ {+ "path": "frontend-modern/src/components/Infrastructure/UnifiedResourceServiceInfrastructureCard.tsx",+ "rationale": "the unified resource service infrastructure card is both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary",+ "subsystems": [+ "performance-and-scalability",+ "unified-resources"+ ]+ },{"path": "frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx","rationale": "the unified resource table is both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary",@@ -81,6 +113,14 @@"unified-resources"]},+ {+ "path": "frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts",+ "rationale": "unified resource service row shaping and I/O emphasis are both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary",+ "subsystems": [+ "performance-and-scalability",+ "unified-resources"+ ]+ },{"path": "frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts","rationale": "unified resource table state, grouping, and windowing are both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary",@@ -2616,7 +2656,12 @@"frontend-modern/src/components/Dashboard/workloadTopology.ts","frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts","frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts",+ "frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx",+ "frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx",+ "frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx",+ "frontend-modern/src/components/Infrastructure/UnifiedResourceServiceInfrastructureCard.tsx","frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx",+ "frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts","frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts","internal/api/router_bench_test.go","internal/api/slo.go",@@ -2731,7 +2776,12 @@"frontend-modern/src/components/Dashboard/workloadTopology.ts","frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts","frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts",+ "frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx",+ "frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx",+ "frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx",+ "frontend-modern/src/components/Infrastructure/UnifiedResourceServiceInfrastructureCard.tsx","frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx",+ "frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts","frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts"],"allow_same_subsystem_tests": false,@@ -3110,7 +3160,12 @@"frontend-modern/src/components/Infrastructure/ResourceDetailDrawerSupportDisclosure.tsx","frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts","frontend-modern/src/components/Infrastructure/ResourceFacetSummary.tsx",+ "frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx",+ "frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx",+ "frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx",+ "frontend-modern/src/components/Infrastructure/UnifiedResourceServiceInfrastructureCard.tsx","frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx",+ "frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts","frontend-modern/src/components/Infrastructure/useResourceDetailDrawerState.ts","frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts","frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx",@@ -3187,7 +3242,12 @@"frontend-modern/src/components/Infrastructure/ResourceDetailDrawerSupportDisclosure.tsx","frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts","frontend-modern/src/components/Infrastructure/ResourceFacetSummary.tsx",+ "frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx",+ "frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx",+ "frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx",+ "frontend-modern/src/components/Infrastructure/UnifiedResourceServiceInfrastructureCard.tsx","frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx",+ "frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts","frontend-modern/src/components/Infrastructure/useResourceDetailDrawerState.ts","frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts","frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx",diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.mdindex 17e59d0b53..8f243550d2 100644--- a/docs/release-control/v6/internal/subsystems/unified-resources.md+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md@@ -48,20 +48,30 @@ cross-source deduplication.26. `frontend-modern/src/components/Infrastructure/ResourceDetailDrawerDebugTab.tsx`27. `frontend-modern/src/components/Infrastructure/ResourceDetailDrawerSupportDisclosure.tsx`28. `frontend-modern/src/components/Infrastructure/ResourceFacetSummary.tsx`-29. `frontend-modern/src/components/Infrastructure/useResourceDetailDrawerState.ts`-30. `frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts`-31. `frontend-modern/src/components/Discovery/DiscoveryTab.tsx`-32. `frontend-modern/src/components/Discovery/useDiscoveryTabState.ts`-33. `frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx`-34. `frontend-modern/src/features/infrastructure/useInfrastructurePageState.ts`+29. `frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx`+30. `frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx`+31. `frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx`+32. `frontend-modern/src/components/Infrastructure/UnifiedResourceServiceInfrastructureCard.tsx`+33. `frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts`+34. `frontend-modern/src/components/Infrastructure/useResourceDetailDrawerState.ts`+35. `frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts`+36. `frontend-modern/src/components/Discovery/DiscoveryTab.tsx`+37. `frontend-modern/src/components/Discovery/useDiscoveryTabState.ts`+38. `frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx`+39. `frontend-modern/src/features/infrastructure/useInfrastructurePageState.ts`## Shared Boundaries1. `frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts` shared with `performance-and-scalability`: the infrastructure selector pipeline is both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.2. `frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts` shared with `performance-and-scalability`: resource detail mappers are both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.-3. `frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx` shared with `performance-and-scalability`: the unified resource table is both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.-4. `frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts` shared with `performance-and-scalability`: unified resource table state, grouping, and windowing are both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.-5. `internal/api/resources.go` shared with `api-contracts`: the unified resource endpoint is both a backend payload contract surface and a unified-resource runtime boundary.+3. `frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx` shared with `performance-and-scalability`: the unified resource host table card is both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.+4. `frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx` shared with `performance-and-scalability`: the unified resource PBS section is both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.+5. `frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx` shared with `performance-and-scalability`: the unified resource PMG section is both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.+6. `frontend-modern/src/components/Infrastructure/UnifiedResourceServiceInfrastructureCard.tsx` shared with `performance-and-scalability`: the unified resource service infrastructure card is both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.+7. `frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx` shared with `performance-and-scalability`: the unified resource table is both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.+8. `frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts` shared with `performance-and-scalability`: unified resource service row shaping and I/O emphasis are both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.+9. `frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts` shared with `performance-and-scalability`: unified resource table state, grouping, and windowing are both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.+10. `internal/api/resources.go` shared with `api-contracts`: the unified resource endpoint is both a backend payload contract surface and a unified-resource runtime boundary.## Extension Pointsdiff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsxnew file mode 100644index 0000000000..8d99ad8d51--- /dev/null+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx@@ -0,0 +1,632 @@+import { For, Show, createMemo } from 'solid-js';+import type { Component } from 'solid-js';+import type { Disk } from '@/types/api';+import { formatBytes, formatSpeed, formatUptime, normalizeDiskArray } from '@/utils/format';+import { formatTemperature } from '@/utils/temperature';+import { Card } from '@/components/shared/Card';+import {+ Table,+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableRow,+} from '@/components/shared/Table';+import { StatusDot } from '@/components/shared/StatusDot';+import { ResponsiveMetricCell } from '@/components/shared/responsive';+import { StackedDiskBar } from '@/components/Dashboard/StackedDiskBar';+import { StackedMemoryBar } from '@/components/Dashboard/StackedMemoryBar';+import { buildMetricKeyForUnifiedResource } from '@/utils/metricsKeys';+import {+ getPlatformBadge,+ getSourceBadge,+ getUnifiedSourceBadges,+} from '@/utils/resourceBadgePresentation';+import { getAgentStatusIndicator } from '@/utils/status';+import { getPreferredResourceDisplayName } from '@/utils/resourceIdentity';+import {+ getResourcePolicyBadges,+ shouldShowResourceAlternateName,+} from '@/utils/resourcePolicyPresentation';+import { ResourceDetailDrawer } from './ResourceDetailDrawer';+import { buildWorkloadsHref } from './workloadsLink';+import { ClusterDeployBanner } from './ClusterDeployBanner';+import { ResourceFacetSummary } from './ResourceFacetSummary';+import {+ type UnifiedResourceTableProps,+ type UnifiedResourceTableState,+} from './useUnifiedResourceTableState';+import { getOutlierEmphasis, isResourceOnline } from './unifiedResourceTableModel';+import { getCpuPercent, getDiskPercent, getMemoryPercent } from '@/types/resource';++interface UnifiedResourceHostTableCardProps {+ tableProps: UnifiedResourceTableProps;+ table: UnifiedResourceTableState;+}++export const UnifiedResourceHostTableCard: Component<UnifiedResourceHostTableCardProps> = (+ props,+) => {+ const { table, tableProps } = props;++ return (+ <Show when={table.showHostTable()}>+ <Card padding="none" tone="card" class="mb-0 overflow-hidden">+ <div class="border-b border-border bg-surface-hover px-3 py-2 text-[11px] font-semibold uppercase tracking-wide text-muted">+ Agent Infrastructure+ </div>+ <div class="overflow-x-auto">+ <Table+ class="whitespace-nowrap min-w-[max-content]"+ style={{+ 'table-layout': 'fixed',+ 'min-width': table.isMobile() ? '100%' : 'max-content',+ }}+ >+ <TableHeader>+ <TableRow class="bg-surface-alt text-muted border-b border-border">+ <TableHead+ class="text-left pl-2 sm:pl-3"+ style={table.resourceColumnStyle()}+ onClick={() => table.handleSort('name')}+ >+ Resource {table.renderSortIndicator('name')}+ </TableHead>+ <TableHead+ style={table.metricColumnStyle()}+ onClick={() => table.handleSort('cpu')}+ >+ CPU {table.renderSortIndicator('cpu')}+ </TableHead>+ <TableHead+ style={table.metricColumnStyle()}+ onClick={() => table.handleSort('memory')}+ >+ Memory {table.renderSortIndicator('memory')}+ </TableHead>+ <TableHead+ style={table.metricColumnStyle()}+ onClick={() => table.handleSort('disk')}+ >+ Disk {table.renderSortIndicator('disk')}+ </TableHead>+ <TableHead+ classList={{ hidden: table.isMobile() || !table.isVisible('secondary') }}+ style={table.ioColumnStyle()}+ onClick={() => table.handleSort('network')}+ >+ Net I/O {table.renderSortIndicator('network')}+ </TableHead>+ <TableHead+ classList={{ hidden: table.isMobile() || !table.isVisible('supplementary') }}+ style={table.ioColumnStyle()}+ onClick={() => table.handleSort('diskio')}+ >+ Disk I/O {table.renderSortIndicator('diskio')}+ </TableHead>+ <TableHead+ classList={{ hidden: table.isMobile() || !table.isVisible('secondary') }}+ style={table.sourceColumnStyle()}+ onClick={() => table.handleSort('source')}+ >+ Source {table.renderSortIndicator('source')}+ </TableHead>+ <TableHead+ classList={{ hidden: table.isMobile() || !table.isVisible('supplementary') }}+ style={table.uptimeColumnStyle()}+ onClick={() => table.handleSort('uptime')}+ >+ Uptime {table.renderSortIndicator('uptime')}+ </TableHead>+ <TableHead+ classList={{ hidden: table.isMobile() || !table.isVisible('supplementary') }}+ style={table.tempColumnStyle()}+ onClick={() => table.handleSort('temp')}+ >+ 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}+ style={{+ height: `${table.hostTopSpacerHeight()}px`,+ padding: '0',+ border: '0',+ }}+ />+ </TableRow>+ </Show>++ <For each={table.visibleHostTableItems()}>+ {(item) => {+ if (item.type === 'header') {+ const group = item.group;+ return (+ <TableRow class="bg-surface-alt">+ <TableCell+ colspan={9}+ class="py-1 pr-2 pl-4 text-[12px] sm:text-sm font-semibold text-base-content"+ >+ <div class="flex items-center gap-2">+ <Show+ when={group.cluster}+ fallback={<span class="text-muted">Standalone</span>}+ >+ <span>{group.cluster}</span>+ <span class="inline-flex items-center rounded px-2 py-0.5 text-[10px] font-medium whitespace-nowrap bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300">+ Cluster+ </span>+ </Show>+ <span class="text-[10px] text-muted font-normal">+ {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(() => getPreferredResourceDisplayName(resource));+ const statusIndicator = createMemo(() =>+ getAgentStatusIndicator({ status: resource.status }),+ );+ const metricsKey = createMemo(() =>+ buildMetricKeyForUnifiedResource(resource),+ );++ 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 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 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 rowClass = createMemo(() => {+ const baseHover =+ 'cursor-pointer transition-all duration-200 relative group hover:bg-surface-hover';++ if (isExpanded()) {+ return 'cursor-pointer transition-all duration-200 relative z-10 group bg-blue-50 dark:bg-blue-900';+ }++ let className = baseHover;+ if (isHighlighted()) {+ className +=+ ' bg-blue-50 dark:bg-blue-900 ring-1 ring-blue-300 dark:ring-blue-600';+ }+ if (tableProps.hoveredResourceId === resource.id && !isHighlighted()) {+ className += ' bg-surface-hover';+ }+ if (!isResourceOnline(resource)) {+ className += ' opacity-60';+ }++ return className;+ });+ const platformBadge = createMemo(() =>+ getPlatformBadge(resource.platformType),+ );+ const sourceBadge = createMemo(() => getSourceBadge(resource.sourceType));+ const unifiedSourceBadges = createMemo(() =>+ getUnifiedSourceBadges(table.getUnifiedSources(resource)),+ );+ const hasUnifiedSources = createMemo(+ () => unifiedSourceBadges().length > 0,+ );+ const policyBadges = createMemo(() =>+ getResourcePolicyBadges(resource.policy),+ );+ const workloadsHref = createMemo(() => buildWorkloadsHref(resource));++ return (+ <>+ <TableRow+ ref={(el) => table.registerRowRef(resource.id, el)}+ class={rowClass()}+ style={{ 'min-height': '32px' }}+ onClick={() => table.toggleExpand(resource.id)}+ onMouseEnter={() => tableProps.onHoverChange?.(resource.id)}+ onMouseLeave={() => tableProps.onHoverChange?.(null)}+ >+ <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">+ <div+ class={`shrink-0 transition-transform duration-200 ${isExpanded() ? 'rotate-90' : ''}`}+ >+ <svg+ class="w-3.5 h-3.5 text-muted group-hover:text-base-content"+ fill="none"+ viewBox="0 0 24 24"+ stroke="currentColor"+ >+ <path+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M9 5l7 7-7 7"+ />+ </svg>+ </div>+ <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>+ </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>+ </div>+ }+ >+ <ResponsiveMetricCell+ class="w-full"+ value={cpuPercentValue() ?? 0}+ type="cpu"+ resourceId={table.isMobile() ? undefined : metricsKey()}+ isRunning={isResourceOnline(resource)}+ showMobile={false}+ />+ </Show>+ </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}+ />+ </div>+ </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+ }+ />+ </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="grid w-full grid-cols-[0.75rem_minmax(0,1fr)_0.75rem_minmax(0,1fr)] items-center gap-x-1 text-[11px] tabular-nums">+ <span class="inline-flex w-3 justify-center text-emerald-500">↓</span>+ <span+ class={`min-w-0 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 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.isVisible('supplementary') }}+ >+ <Show+ when={resource.diskIO}+ fallback={+ <div class="text-center">+ <span class="text-xs text-slate-400">—</span>+ </div>+ }+ >+ <div class="grid w-full grid-cols-[0.75rem_minmax(0,1fr)_0.75rem_minmax(0,1fr)] items-center gap-x-1 text-[11px] tabular-nums">+ <span class="inline-flex w-3 justify-center font-mono text-blue-500">+ R+ </span>+ <span+ class={`min-w-0 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 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') }}>+ <div class="flex items-center justify-center gap-1">+ <Show+ when={hasUnifiedSources()}+ fallback={+ <>+ <Show when={platformBadge()}>+ {(badge) => (+ <span class={badge().classes} title={badge().title}>+ {badge().label}+ </span>+ )}+ </Show>+ <Show when={sourceBadge()}>+ {(badge) => (+ <span class={badge().classes} title={badge().title}>+ {badge().label}+ </span>+ )}+ </Show>+ </>+ }+ >+ <For each={unifiedSourceBadges()}>+ {(badge) => (+ <span class={badge.classes} title={badge.title}>+ {badge.label}+ </span>+ )}+ </For>+ </Show>+ </div>+ </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>+ <TableCell+ 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 when={table.hostWindowing.isWindowed() && table.hostBottomSpacerHeight() > 0}>+ <TableRow aria-hidden="true">+ <TableCell+ colspan={9}+ style={{+ height: `${table.hostBottomSpacerHeight()}px`,+ padding: '0',+ border: '0',+ }}+ />+ </TableRow>+ </Show>+ </TableBody>+ </Table>+ </div>+ </Card>+ </Show>+ );+};diff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsxnew file mode 100644index 0000000000..d712c506ac--- /dev/null+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx@@ -0,0 +1,317 @@+import { For, Show, createMemo } from 'solid-js';+import type { Component } from 'solid-js';+import { formatUptime } from '@/utils/format';+import { StatusDot } from '@/components/shared/StatusDot';+import {+ Table,+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableRow,+} from '@/components/shared/Table';+import {+ getPlatformBadge,+ getSourceBadge,+ getUnifiedSourceBadges,+} from '@/utils/resourceBadgePresentation';+import { getAgentStatusIndicator } from '@/utils/status';+import { getServiceHealthSummaryPresentation } from '@/utils/serviceHealthPresentation';+import { getPreferredResourceDisplayName } from '@/utils/resourceIdentity';+import { shouldShowResourceAlternateName } from '@/utils/resourcePolicyPresentation';+import { ResourceDetailDrawer } from './ResourceDetailDrawer';+import { ResourceFacetSummary } from './ResourceFacetSummary';+import {+ type UnifiedResourceTableProps,+ type UnifiedResourceTableState,+} from './useUnifiedResourceTableState';+import { getPBSTableRow, isResourceOnline } from './unifiedResourceTableModel';+import { buildServiceDetailLinks } from './serviceDetailLinks';++interface UnifiedResourcePBSTableSectionProps {+ tableProps: UnifiedResourceTableProps;+ table: UnifiedResourceTableState;+}++export const UnifiedResourcePBSTableSection: Component<UnifiedResourcePBSTableSectionProps> = (+ props,+) => {+ const { table, tableProps } = props;++ return (+ <Show when={table.sortedPBSResources().length > 0}>+ <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 min-w-[max-content]"+ style={{+ 'table-layout': 'fixed',+ 'min-width': table.isMobile() ? '100%' : 'max-content',+ }}+ >+ <TableHeader>+ <TableRow class="bg-surface-alt text-muted border-b border-border">+ <TableHead class="text-left pl-2 sm:pl-3" style={table.resourceColumnStyle()}>+ Resource+ </TableHead>+ <TableHead+ classList={{ hidden: !table.isVisible('primary') && !table.isMobile() }}+ style={table.serviceCountColumnStyle()}+ >+ Datastores+ </TableHead>+ <TableHead+ classList={{ hidden: !table.isVisible('secondary') && !table.isMobile() }}+ style={table.serviceCountColumnStyle()}+ >+ Jobs+ </TableHead>+ <TableHead style={table.serviceHealthColumnStyle()}>Health</TableHead>+ <TableHead+ classList={{ hidden: !table.isVisible('secondary') && !table.isMobile() }}+ style={table.sourceColumnStyle()}+ >+ Source+ </TableHead>+ <TableHead+ classList={{ hidden: !table.isVisible('supplementary') && !table.isMobile() }}+ style={table.uptimeColumnStyle()}+ >+ Uptime+ </TableHead>+ <TableHead style={table.serviceActionColumnStyle()}>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(() => getPreferredResourceDisplayName(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 unifiedSourceBadges = createMemo(() =>+ getUnifiedSourceBadges(table.getUnifiedSources(resource)),+ );+ const hasUnifiedSources = createMemo(() => unifiedSourceBadges().length > 0);+ const healthClass = createMemo(+ () =>+ getServiceHealthSummaryPresentation(resource.status, pbsRow()?.health)+ .textClass,+ );++ 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}`;+ }++ let className = baseHover;+ if (isHighlighted()) {+ className +=+ ' bg-blue-50 dark:bg-blue-900 ring-1 ring-blue-300 dark:ring-blue-600';+ }+ if (tableProps.hoveredResourceId === resource.id) {+ className += ' bg-blue-100 dark:bg-blue-800';+ }+ if (!isResourceOnline(resource)) {+ className += ' opacity-60';+ }++ return className;+ });++ return (+ <>+ <TableRow+ ref={(el) => table.registerRowRef(resource.id, el)}+ class={rowClass()}+ style={{ 'min-height': '32px' }}+ onClick={() => table.toggleExpand(resource.id)}+ onMouseEnter={() => tableProps.onHoverChange?.(resource.id)}+ onMouseLeave={() => tableProps.onHoverChange?.(null)}+ >+ <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">+ <div+ class={`shrink-0 transition-transform duration-200 ${isExpanded() ? 'rotate-90' : ''}`}+ >+ <svg+ class="w-3.5 h-3.5 text-muted group-hover:text-base-content"+ fill="none"+ viewBox="0 0 24 24"+ stroke="currentColor"+ >+ <path+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M9 5l7 7-7 7"+ />+ </svg>+ </div>+ <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>+ <ResourceFacetSummary+ recentChanges={resource.recentChanges}+ counts={resource.facetCounts}+ class="mt-0.5"+ />+ </div>+ </TableCell>++ <TableCell classList={{ hidden: !table.isVisible('primary') && !table.isMobile() }}>+ <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.isVisible('secondary') && !table.isMobile() }}>+ <div class="flex justify-center">+ <Show+ when={pbsRow()?.jobs != null}+ fallback={<span class="text-xs text-slate-400">—</span>}+ >+ <span class="text-xs text-base-content">{pbsRow()!.jobs}</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.isVisible('secondary') && !table.isMobile() }}>+ <div class="flex items-center justify-center gap-1">+ <Show+ when={hasUnifiedSources()}+ fallback={+ <>+ <Show when={platformBadge()}>+ {(badge) => (+ <span class={badge().classes} title={badge().title}>+ {badge().label}+ </span>+ )}+ </Show>+ <Show when={sourceBadge()}>+ {(badge) => (+ <span class={badge().classes} title={badge().title}>+ {badge().label}+ </span>+ )}+ </Show>+ </>+ }+ >+ <For each={unifiedSourceBadges()}>+ {(badge) => (+ <span class={badge.classes} title={badge.title}>+ {badge.label}+ </span>+ )}+ </For>+ </Show>+ </div>+ </TableCell>++ <TableCell classList={{ hidden: !table.isVisible('supplementary') && !table.isMobile() }}>+ <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>+ <TableCell+ 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>+ );+};diff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsxnew file mode 100644index 0000000000..4db8babc4c--- /dev/null+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx@@ -0,0 +1,356 @@+import { For, Show, createMemo } from 'solid-js';+import type { Component } from 'solid-js';+import { formatUptime } from '@/utils/format';+import { StatusDot } from '@/components/shared/StatusDot';+import {+ Table,+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableRow,+} from '@/components/shared/Table';+import {+ getPlatformBadge,+ getSourceBadge,+ getUnifiedSourceBadges,+} from '@/utils/resourceBadgePresentation';+import { getAgentStatusIndicator } from '@/utils/status';+import { getServiceHealthSummaryPresentation } from '@/utils/serviceHealthPresentation';+import { getPreferredResourceDisplayName } from '@/utils/resourceIdentity';+import { shouldShowResourceAlternateName } from '@/utils/resourcePolicyPresentation';+import { ResourceDetailDrawer } from './ResourceDetailDrawer';+import { ResourceFacetSummary } from './ResourceFacetSummary';+import {+ type UnifiedResourceTableProps,+ type UnifiedResourceTableState,+} from './useUnifiedResourceTableState';+import { getPMGTableRow, isResourceOnline } from './unifiedResourceTableModel';+import { buildServiceDetailLinks } from './serviceDetailLinks';++interface UnifiedResourcePMGTableSectionProps {+ tableProps: UnifiedResourceTableProps;+ table: UnifiedResourceTableState;+}++export const UnifiedResourcePMGTableSection: Component<UnifiedResourcePMGTableSectionProps> = (+ props,+) => {+ const { table, tableProps } = props;++ return (+ <Show when={table.sortedPMGResources().length > 0}>+ <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 min-w-[max-content]"+ style={{+ 'table-layout': 'fixed',+ 'min-width': table.isMobile() ? '100%' : 'max-content',+ }}+ >+ <TableHeader>+ <TableRow class="bg-surface-alt text-muted border-b border-border">+ <TableHead class="text-left pl-2 sm:pl-3" style={table.resourceColumnStyle()}>+ Resource+ </TableHead>+ <TableHead+ classList={{ hidden: !table.isVisible('primary') && !table.isMobile() }}+ style={table.serviceQueueColumnStyle()}+ >+ Queue+ </TableHead>+ <TableHead+ classList={{ hidden: !table.isVisible('secondary') && !table.isMobile() }}+ style={table.serviceQueueColumnStyle()}+ >+ Deferred+ </TableHead>+ <TableHead+ classList={{ hidden: !table.isVisible('supplementary') && !table.isMobile() }}+ style={table.serviceQueueColumnStyle()}+ >+ Hold+ </TableHead>+ <TableHead+ classList={{ hidden: !table.isVisible('secondary') && !table.isMobile() }}+ style={table.serviceCountColumnStyle()}+ >+ Nodes+ </TableHead>+ <TableHead style={table.serviceHealthColumnStyle()}>Health</TableHead>+ <TableHead+ classList={{ hidden: !table.isVisible('secondary') && !table.isMobile() }}+ style={table.sourceColumnStyle()}+ >+ Source+ </TableHead>+ <TableHead+ classList={{ hidden: !table.isVisible('supplementary') && !table.isMobile() }}+ style={table.uptimeColumnStyle()}+ >+ Uptime+ </TableHead>+ <TableHead style={table.serviceActionColumnStyle()}>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(() => getPreferredResourceDisplayName(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 unifiedSourceBadges = createMemo(() =>+ getUnifiedSourceBadges(table.getUnifiedSources(resource)),+ );+ const hasUnifiedSources = createMemo(() => unifiedSourceBadges().length > 0);+ 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}`;++ 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 (isHighlighted()) {+ className +=+ ' bg-blue-50 dark:bg-blue-900 ring-1 ring-blue-300 dark:ring-blue-600';+ }+ if (tableProps.hoveredResourceId === resource.id) {+ className += ' bg-blue-100 dark:bg-blue-800';+ }+ if (!isResourceOnline(resource)) {+ className += ' opacity-60';+ }++ return className;+ });++ return (+ <>+ <TableRow+ ref={(el) => table.registerRowRef(resource.id, el)}+ class={rowClass()}+ style={{ 'min-height': '32px' }}+ onClick={() => table.toggleExpand(resource.id)}+ onMouseEnter={() => tableProps.onHoverChange?.(resource.id)}+ onMouseLeave={() => tableProps.onHoverChange?.(null)}+ >+ <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">+ <div+ class={`shrink-0 transition-transform duration-200 ${isExpanded() ? 'rotate-90' : ''}`}+ >+ <svg+ class="w-3.5 h-3.5 text-muted group-hover:text-base-content"+ fill="none"+ viewBox="0 0 24 24"+ stroke="currentColor"+ >+ <path+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M9 5l7 7-7 7"+ />+ </svg>+ </div>+ <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>+ <ResourceFacetSummary+ recentChanges={resource.recentChanges}+ counts={resource.facetCounts}+ class="mt-0.5"+ />+ </div>+ </TableCell>++ <TableCell classList={{ hidden: !table.isVisible('primary') && !table.isMobile() }}>+ <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.isVisible('secondary') && !table.isMobile() }}>+ <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.isVisible('supplementary') && !table.isMobile() }}>+ <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.isVisible('secondary') && !table.isMobile() }}>+ <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 classList={{ hidden: !table.isVisible('secondary') && !table.isMobile() }}>+ <div class="flex items-center justify-center gap-1">+ <Show+ when={hasUnifiedSources()}+ fallback={+ <>+ <Show when={platformBadge()}>+ {(badge) => (+ <span class={badge().classes} title={badge().title}>+ {badge().label}+ </span>+ )}+ </Show>+ <Show when={sourceBadge()}>+ {(badge) => (+ <span class={badge().classes} title={badge().title}>+ {badge().label}+ </span>+ )}+ </Show>+ </>+ }+ >+ <For each={unifiedSourceBadges()}>+ {(badge) => (+ <span class={badge.classes} title={badge.title}>+ {badge.label}+ </span>+ )}+ </For>+ </Show>+ </div>+ </TableCell>++ <TableCell classList={{ hidden: !table.isVisible('supplementary') && !table.isMobile() }}>+ <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>+ <TableCell+ 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>+ );+};diff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourceServiceInfrastructureCard.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourceServiceInfrastructureCard.tsxnew file mode 100644index 0000000000..a2504d4458--- /dev/null+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourceServiceInfrastructureCard.tsx@@ -0,0 +1,32 @@+import { Show } from 'solid-js';+import type { Component } from 'solid-js';+import { Card } from '@/components/shared/Card';+import {+ type UnifiedResourceTableProps,+ type UnifiedResourceTableState,+} from './useUnifiedResourceTableState';+import { UnifiedResourcePBSTableSection } from './UnifiedResourcePBSTableSection';+import { UnifiedResourcePMGTableSection } from './UnifiedResourcePMGTableSection';++interface UnifiedResourceServiceInfrastructureCardProps {+ tableProps: UnifiedResourceTableProps;+ table: UnifiedResourceTableState;+}++export const UnifiedResourceServiceInfrastructureCard: Component<+ UnifiedResourceServiceInfrastructureCardProps+> = (props) => {+ const { table, tableProps } = props;++ return (+ <Show when={table.sortedPBSResources().length > 0 || table.sortedPMGResources().length > 0}>+ <Card padding="none" tone="card" class="mb-0 overflow-hidden">+ <div class="border-b border-border bg-surface-hover px-3 py-2 text-[11px] font-semibold uppercase tracking-wide text-muted">+ Service Infrastructure+ </div>+ <UnifiedResourcePBSTableSection tableProps={tableProps} table={table} />+ <UnifiedResourcePMGTableSection tableProps={tableProps} table={table} />+ </Card>+ </Show>+ );+};diff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsxindex a0d3898567..2701c42e1e 100644--- a/frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx@@ -1,1377 +1,18 @@-import { Component, For, Show, createMemo } from 'solid-js';-import type { Resource } from '@/types/resource';-import { getCpuPercent, getMemoryPercent, getDiskPercent } from '@/types/resource';-import { formatBytes, formatUptime, formatSpeed, normalizeDiskArray } from '@/utils/format';-import { formatTemperature } from '@/utils/temperature';-import { Card } from '@/components/shared/Card';-import {- Table,- TableHeader,- TableBody,- TableRow,- TableHead,- TableCell,-} from '@/components/shared/Table';-import { StatusDot } from '@/components/shared/StatusDot';-import { ResponsiveMetricCell } from '@/components/shared/responsive';-import { StackedDiskBar } from '@/components/Dashboard/StackedDiskBar';-import { StackedMemoryBar } from '@/components/Dashboard/StackedMemoryBar';-import { buildMetricKeyForUnifiedResource } from '@/utils/metricsKeys';-import {- getPlatformBadge,- getSourceBadge,- getUnifiedSourceBadges,-} from '@/utils/resourceBadgePresentation';-import { getAgentStatusIndicator } from '@/utils/status';-import { getServiceHealthSummaryPresentation } from '@/utils/serviceHealthPresentation';-import { getPreferredResourceDisplayName } from '@/utils/resourceIdentity';-import {- getResourcePolicyBadges,- shouldShowResourceAlternateName,-} from '@/utils/resourcePolicyPresentation';-import type { Disk } from '@/types/api';-import type { IODistributionStats } from '@/components/Infrastructure/infrastructureSelectors';-import { ResourceDetailDrawer } from './ResourceDetailDrawer';-import { buildWorkloadsHref } from './workloadsLink';-import { buildServiceDetailLinks } from './serviceDetailLinks';-import { ClusterDeployBanner } from './ClusterDeployBanner';-import { ResourceFacetSummary } from './ResourceFacetSummary';+import type { Component } from 'solid-js';import {useUnifiedResourceTableState,type UnifiedResourceTableProps,} from './useUnifiedResourceTableState';--type PBSServiceData = {- datastoreCount?: number;- backupJobCount?: number;- syncJobCount?: number;- verifyJobCount?: number;- pruneJobCount?: number;- garbageJobCount?: number;- connectionHealth?: string;-};--type PMGServiceData = {- nodeCount?: number;- queueTotal?: number;- queueDeferred?: number;- queueHold?: number;- connectionHealth?: string;-};--type PBSTableRow = {- datastores: number | null;- jobs: number | null;- health: string | null;- tone: ReturnType<typeof getServiceHealthSummaryPresentation>['tone'];-};--type PMGTableRow = {- queue: number | null;- deferred: number | null;- hold: number | null;- nodes: number | null;- health: string | null;- tone: ReturnType<typeof getServiceHealthSummaryPresentation>['tone'];-};--const isResourceOnline = (resource: Resource) => {- const status = resource.status?.toLowerCase();- return status !== 'offline' && status !== 'stopped';-};--const getPBSTableRow = (resource: Resource): PBSTableRow | null => {- if (resource.type !== 'pbs') return null;- const platformData = resource.platformData as- | { pbs?: PBSServiceData; pmg?: PMGServiceData }- | undefined;- const pbs = platformData?.pbs;- const totalJobs =- (pbs?.backupJobCount || 0) +- (pbs?.syncJobCount || 0) +- (pbs?.verifyJobCount || 0) +- (pbs?.pruneJobCount || 0) +- (pbs?.garbageJobCount || 0);- const health = pbs?.connectionHealth?.trim() || null;-- return {- datastores: (pbs?.datastoreCount || 0) > 0 ? pbs?.datastoreCount || 0 : null,- jobs: totalJobs > 0 ? totalJobs : null,- health,- tone: getServiceHealthSummaryPresentation(resource.status, health).tone,- };-};--const getPMGTableRow = (resource: Resource): PMGTableRow | null => {- if (resource.type !== 'pmg') return null;- const platformData = resource.platformData as- | { pbs?: PBSServiceData; pmg?: PMGServiceData }- | undefined;- const pmg = platformData?.pmg;- const health = pmg?.connectionHealth?.trim() || null;- const backlog = (pmg?.queueDeferred || 0) + (pmg?.queueHold || 0);-- return {- queue: (pmg?.queueTotal || 0) > 0 ? pmg?.queueTotal || 0 : null,- deferred: (pmg?.queueDeferred || 0) > 0 ? pmg?.queueDeferred || 0 : null,- hold: (pmg?.queueHold || 0) > 0 ? pmg?.queueHold || 0 : null,- nodes: (pmg?.nodeCount || 0) > 0 ? pmg?.nodeCount || 0 : null,- health,- tone:- backlog > 0 ? 'warning' : getServiceHealthSummaryPresentation(resource.status, health).tone,- };-};--interface IOEmphasis {- className: string;- showOutlierHint: boolean;-}--const getOutlierEmphasis = (value: number, stats: IODistributionStats): IOEmphasis => {- if (!Number.isFinite(value) || value <= 0 || stats.max <= 0) {- return { className: 'text-muted', showOutlierHint: false };- }-- // For tiny sets, avoid aggressive highlighting.- if (stats.count < 4) {- const ratio = value / stats.max;- if (ratio >= 0.995) {- return { className: 'text-base-content font-medium', showOutlierHint: true };- }- return { className: 'text-muted', showOutlierHint: false };- }-- // Robust outlier score: only values meaningfully far from the cluster brighten.- if (stats.mad > 0) {- const modifiedZ = (0.6745 * (value - stats.median)) / stats.mad;- if (modifiedZ >= 6.5 && value >= stats.p99) {- return { className: 'text-base-content font-semibold', showOutlierHint: true };- }- if (modifiedZ >= 5.5 && value >= stats.p97) {- return { className: 'text-base-content font-medium', showOutlierHint: true };- }- return { className: 'text-muted', showOutlierHint: false };- }-- // Fallback when values are too uniform for MAD to separate:- // only near-peak values should get emphasis.- if (value >= stats.p99)- return { className: 'text-base-content font-semibold', showOutlierHint: true };- if (value >= stats.p97)- return { className: 'text-base-content font-medium', showOutlierHint: true };- if (value > 0) return { className: 'text-muted', showOutlierHint: false };- return { className: 'text-muted', showOutlierHint: false };-};+import { UnifiedResourceHostTableCard } from './UnifiedResourceHostTableCard';+import { UnifiedResourceServiceInfrastructureCard } from './UnifiedResourceServiceInfrastructureCard';export const UnifiedResourceTable: Component<UnifiedResourceTableProps> = (props) => {- const {- isMobile,- isVisible,- handleSort,- renderSortIndicator,- resolveResourceLabel,- visibleHostTableItems,- hostTopSpacerHeight,- hostBottomSpacerHeight,- hostWindowing,- sortedPBSResources,- sortedPMGResources,- ioScale,- registerRowRef,- setHostBodyRef,- resourceColumnStyle,- metricColumnStyle,- ioColumnStyle,- sourceColumnStyle,- uptimeColumnStyle,- tempColumnStyle,- showHostTable,- serviceCountColumnStyle,- serviceQueueColumnStyle,- serviceHealthColumnStyle,- serviceActionColumnStyle,- toggleExpand,- getUnifiedSources,- } = useUnifiedResourceTableState(props);-- const setExpandedResourceId = (id: string | null) => props.onExpandedResourceChange(id);+ const table = useUnifiedResourceTableState(props);return (<div class="space-y-4">- <Show when={showHostTable()}>- <Card padding="none" tone="card" class="mb-0 overflow-hidden">- <div class="border-b border-border bg-surface-hover px-3 py-2 text-[11px] font-semibold uppercase tracking-wide text-muted">- Agent Infrastructure- </div>- <div class="overflow-x-auto">- <Table- class="whitespace-nowrap min-w-[max-content]"- style={{ 'table-layout': 'fixed', 'min-width': isMobile() ? '100%' : 'max-content' }}- >- <TableHeader>- <TableRow class="bg-surface-alt text-muted border-b border-border">- <TableHead- class="text-left pl-2 sm:pl-3"- style={resourceColumnStyle()}- onClick={() => handleSort('name')}- >- Resource {renderSortIndicator('name')}- </TableHead>- <TableHead style={metricColumnStyle()} onClick={() => handleSort('cpu')}>- CPU {renderSortIndicator('cpu')}- </TableHead>- <TableHead style={metricColumnStyle()} onClick={() => handleSort('memory')}>- Memory {renderSortIndicator('memory')}- </TableHead>- <TableHead style={metricColumnStyle()} onClick={() => handleSort('disk')}>- Disk {renderSortIndicator('disk')}- </TableHead>- <TableHead- classList={{ hidden: isMobile() || !isVisible('secondary') }}- style={ioColumnStyle()}- onClick={() => handleSort('network')}- >- Net I/O {renderSortIndicator('network')}- </TableHead>- <TableHead- classList={{ hidden: isMobile() || !isVisible('supplementary') }}- style={ioColumnStyle()}- onClick={() => handleSort('diskio')}- >- Disk I/O {renderSortIndicator('diskio')}- </TableHead>- <TableHead- classList={{ hidden: isMobile() || !isVisible('secondary') }}- style={sourceColumnStyle()}- onClick={() => handleSort('source')}- >- Source {renderSortIndicator('source')}- </TableHead>- <TableHead- classList={{ hidden: isMobile() || !isVisible('supplementary') }}- style={uptimeColumnStyle()}- onClick={() => handleSort('uptime')}- >- Uptime {renderSortIndicator('uptime')}- </TableHead>- <TableHead- classList={{ hidden: isMobile() || !isVisible('supplementary') }}- style={tempColumnStyle()}- onClick={() => handleSort('temp')}- >- Temp {renderSortIndicator('temp')}- </TableHead>- </TableRow>- </TableHeader>- <TableBody ref={setHostBodyRef}>- <Show when={hostWindowing.isWindowed() && hostTopSpacerHeight() > 0}>- <TableRow aria-hidden="true">- <TableCell- colspan={9}- style={{ height: `${hostTopSpacerHeight()}px`, padding: '0', border: '0' }}- />- </TableRow>- </Show>-- <For each={visibleHostTableItems()}>- {(item) => {- if (item.type === 'header') {- const group = item.group;- return (- <TableRow class="bg-surface-alt">- <TableCell- colspan={9}- class="py-1 pr-2 pl-4 text-[12px] sm:text-sm font-semibold text-base-content"- >- <div class="flex items-center gap-2">- <Show- when={group.cluster}- fallback={<span class="text-muted">Standalone</span>}- >- <span>{group.cluster}</span>- <span class="inline-flex items-center rounded px-2 py-0.5 text-[10px] font-medium whitespace-nowrap bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300">- Cluster- </span>- </Show>- <span class="text-[10px] text-muted font-normal">- {group.resources.length}{' '}- {group.resources.length === 1 ? 'resource' : 'resources'}- </span>- </div>- <Show when={props.onDeployCluster}>- <ClusterDeployBanner- group={group}- onDeploy={props.onDeployCluster!}- />- </Show>- </TableCell>- </TableRow>- );- }-- const resource = item.resource;- const isExpanded = createMemo(() => props.expandedResourceId === resource.id);- const isHighlighted = createMemo(- () => props.highlightedResourceId === resource.id,- );- const displayName = createMemo(() => getPreferredResourceDisplayName(resource));- const statusIndicator = createMemo(() =>- getAgentStatusIndicator({ status: resource.status }),- );- const metricsKey = createMemo(() => buildMetricKeyForUnifiedResource(resource));-- 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 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 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(), ioScale().network),- );- const diskIOTotal = createMemo(- () => (resource.diskIO?.readRate ?? 0) + (resource.diskIO?.writeRate ?? 0),- );- const diskIOEmphasis = createMemo(() =>- getOutlierEmphasis(diskIOTotal(), ioScale().diskIO),- );-- const rowClass = createMemo(() => {- const baseHover = `cursor-pointer transition-all duration-200 relative group hover:bg-surface-hover`;-- if (isExpanded()) {- return `cursor-pointer transition-all duration-200 relative z-10 group bg-blue-50 dark:bg-blue-900`;- }-- let className = baseHover;- if (isHighlighted()) {- className +=- ' bg-blue-50 dark:bg-blue-900 ring-1 ring-blue-300 dark:ring-blue-600';- }- if (props.hoveredResourceId === resource.id && !isHighlighted()) {- className += ' bg-surface-hover';- }- if (!isResourceOnline(resource)) {- className += ' opacity-60';- }-- return className;- });- const platformBadge = createMemo(() => getPlatformBadge(resource.platformType));- const sourceBadge = createMemo(() => getSourceBadge(resource.sourceType));- const unifiedSourceBadges = createMemo(() =>- getUnifiedSourceBadges(getUnifiedSources(resource)),- );- const hasUnifiedSources = createMemo(() => unifiedSourceBadges().length > 0);- const policyBadges = createMemo(() => getResourcePolicyBadges(resource.policy));- const workloadsHref = createMemo(() => buildWorkloadsHref(resource));-- return (- <>- <TableRow- ref={(el) => registerRowRef(resource.id, el)}- class={rowClass()}- style={{ 'min-height': '32px' }}- onClick={() => toggleExpand(resource.id)}- onMouseEnter={() => props.onHoverChange?.(resource.id)}- onMouseLeave={() => props.onHoverChange?.(null)}- >- <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">- <div- class={`shrink-0 transition-transform duration-200 ${isExpanded() ? 'rotate-90' : ''}`}- >- <svg- class="w-3.5 h-3.5 text-muted group-hover:text-base-content"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M9 5l7 7-7 7"- />- </svg>- </div>- <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>- </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>- </div>- }- >- <ResponsiveMetricCell- class="w-full"- value={cpuPercentValue() ?? 0}- type="cpu"- resourceId={isMobile() ? undefined : metricsKey()}- isRunning={isResourceOnline(resource)}- showMobile={false}- />- </Show>- </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}- />- </div>- </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- }- />- </div>- </Show>- </TableCell>-- <TableCell classList={{ hidden: isMobile() || !isVisible('secondary') }}>- <Show- when={resource.network}- fallback={- <div class="text-center">- <span class="text-xs text-slate-400">—</span>- </div>- }- >- <div class="grid w-full grid-cols-[0.75rem_minmax(0,1fr)_0.75rem_minmax(0,1fr)] items-center gap-x-1 text-[11px] tabular-nums">- <span class="inline-flex w-3 justify-center text-emerald-500">- ↓- </span>- <span- class={`min-w-0 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 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: isMobile() || !isVisible('supplementary') }}- >- <Show- when={resource.diskIO}- fallback={- <div class="text-center">- <span class="text-xs text-slate-400">—</span>- </div>- }- >- <div class="grid w-full grid-cols-[0.75rem_minmax(0,1fr)_0.75rem_minmax(0,1fr)] items-center gap-x-1 text-[11px] tabular-nums">- <span class="inline-flex w-3 justify-center font-mono text-blue-500">- R- </span>- <span- class={`min-w-0 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 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: isMobile() || !isVisible('secondary') }}>- <div class="flex items-center justify-center gap-1">- <Show- when={hasUnifiedSources()}- fallback={- <>- <Show when={platformBadge()}>- {(badge) => (- <span class={badge().classes} title={badge().title}>- {badge().label}- </span>- )}- </Show>- <Show when={sourceBadge()}>- {(badge) => (- <span class={badge().classes} title={badge().title}>- {badge().label}- </span>- )}- </Show>- </>- }- >- <For each={unifiedSourceBadges()}>- {(badge) => (- <span class={badge.classes} title={badge.title}>- {badge.label}- </span>- )}- </For>- </Show>- </div>- </TableCell>-- <TableCell- classList={{ hidden: isMobile() || !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: isMobile() || !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>- <TableCell- colspan={9}- class="bg-surface-alt px-4 py-4 border-b border-border-subtle shadow-inner"- >- <ResourceDetailDrawer- resource={resource}- resolveResourceLabel={resolveResourceLabel}- onClose={() => setExpandedResourceId(null)}- />- </TableCell>- </TableRow>- </Show>- </>- );- }}- </For>-- <Show when={hostWindowing.isWindowed() && hostBottomSpacerHeight() > 0}>- <TableRow aria-hidden="true">- <TableCell- colspan={9}- style={{ height: `${hostBottomSpacerHeight()}px`, padding: '0', border: '0' }}- />- </TableRow>- </Show>- </TableBody>- </Table>- </div>- </Card>- </Show>-- <Show when={sortedPBSResources().length > 0 || sortedPMGResources().length > 0}>- <Card padding="none" tone="card" class="mb-0 overflow-hidden">- <div class="border-b border-border bg-surface-hover px-3 py-2 text-[11px] font-semibold uppercase tracking-wide text-muted">- Service Infrastructure- </div>-- <Show when={sortedPBSResources().length > 0}>- <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 min-w-[max-content]"- style={{- 'table-layout': 'fixed',- 'min-width': isMobile() ? '100%' : 'max-content',- }}- >- <TableHeader>- <TableRow class="bg-surface-alt text-muted border-b border-border">- <TableHead class="text-left pl-2 sm:pl-3" style={resourceColumnStyle()}>- Resource- </TableHead>- <TableHead- classList={{ hidden: !isVisible('primary') && !isMobile() }}- style={serviceCountColumnStyle()}- >- Datastores- </TableHead>- <TableHead- classList={{ hidden: !isVisible('secondary') && !isMobile() }}- style={serviceCountColumnStyle()}- >- Jobs- </TableHead>- <TableHead style={serviceHealthColumnStyle()}>Health</TableHead>- <TableHead- classList={{ hidden: !isVisible('secondary') && !isMobile() }}- style={sourceColumnStyle()}- >- Source- </TableHead>- <TableHead- classList={{ hidden: !isVisible('supplementary') && !isMobile() }}- style={uptimeColumnStyle()}- >- Uptime- </TableHead>- <TableHead style={serviceActionColumnStyle()}>Action</TableHead>- </TableRow>- </TableHeader>- <TableBody>- <For each={sortedPBSResources()}>- {(resource) => {- const isExpanded = createMemo(() => props.expandedResourceId === resource.id);- const isHighlighted = createMemo(- () => props.highlightedResourceId === resource.id,- );- const displayName = createMemo(() => getPreferredResourceDisplayName(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 unifiedSourceBadges = createMemo(() =>- getUnifiedSourceBadges(getUnifiedSources(resource)),- );- const hasUnifiedSources = createMemo(() => unifiedSourceBadges().length > 0);- const healthClass = createMemo(- () =>- getServiceHealthSummaryPresentation(resource.status, pbsRow()?.health)- .textClass,- );-- 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}`;- }-- let className = baseHover;- if (isHighlighted()) {- className +=- ' bg-blue-50 dark:bg-blue-900 ring-1 ring-blue-300 dark:ring-blue-600';- }- if (props.hoveredResourceId === resource.id) {- className += ' bg-blue-100 dark:bg-blue-800';- }- if (!isResourceOnline(resource)) {- className += ' opacity-60';- }-- return className;- });-- return (- <>- <TableRow- ref={(el) => registerRowRef(resource.id, el)}- class={rowClass()}- style={{ 'min-height': '32px' }}- onClick={() => toggleExpand(resource.id)}- onMouseEnter={() => props.onHoverChange?.(resource.id)}- onMouseLeave={() => props.onHoverChange?.(null)}- >- <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">- <div- class={`shrink-0 transition-transform duration-200 ${isExpanded() ? 'rotate-90' : ''}`}- >- <svg- class="w-3.5 h-3.5 text-muted group-hover:text-base-content"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M9 5l7 7-7 7"- />- </svg>- </div>- <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>- <ResourceFacetSummary- recentChanges={resource.recentChanges}- counts={resource.facetCounts}- class="mt-0.5"- />- </div>- </TableCell>-- <TableCell classList={{ hidden: !isVisible('primary') && !isMobile() }}>- <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: !isVisible('secondary') && !isMobile() }}- >- <div class="flex justify-center">- <Show- when={pbsRow()?.jobs != null}- fallback={<span class="text-xs text-slate-400">—</span>}- >- <span class="text-xs text-base-content">{pbsRow()!.jobs}</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: !isVisible('secondary') && !isMobile() }}- >- <div class="flex items-center justify-center gap-1">- <Show- when={hasUnifiedSources()}- fallback={- <>- <Show when={platformBadge()}>- {(badge) => (- <span class={badge().classes} title={badge().title}>- {badge().label}- </span>- )}- </Show>- <Show when={sourceBadge()}>- {(badge) => (- <span class={badge().classes} title={badge().title}>- {badge().label}- </span>- )}- </Show>- </>- }- >- <For each={unifiedSourceBadges()}>- {(badge) => (- <span class={badge.classes} title={badge.title}>- {badge.label}- </span>- )}- </For>- </Show>- </div>- </TableCell>-- <TableCell- classList={{ hidden: !isVisible('supplementary') && !isMobile() }}- >- <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>- <TableCell- colspan={7}- class="bg-surface-alt px-4 py-4 border-b border-border-subtle shadow-inner"- >- <ResourceDetailDrawer- resource={resource}- resolveResourceLabel={resolveResourceLabel}- onClose={() => setExpandedResourceId(null)}- />- </TableCell>- </TableRow>- </Show>- </>- );- }}- </For>- </TableBody>- </Table>- </div>- </Show>-- <Show when={sortedPMGResources().length > 0}>- <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 min-w-[max-content]"- style={{- 'table-layout': 'fixed',- 'min-width': isMobile() ? '100%' : 'max-content',- }}- >- <TableHeader>- <TableRow class="bg-surface-alt text-muted border-b border-border">- <TableHead class="text-left pl-2 sm:pl-3" style={resourceColumnStyle()}>- Resource- </TableHead>- <TableHead- classList={{ hidden: !isVisible('primary') && !isMobile() }}- style={serviceQueueColumnStyle()}- >- Queue- </TableHead>- <TableHead- classList={{ hidden: !isVisible('secondary') && !isMobile() }}- style={serviceQueueColumnStyle()}- >- Deferred- </TableHead>- <TableHead- classList={{ hidden: !isVisible('supplementary') && !isMobile() }}- style={serviceQueueColumnStyle()}- >- Hold- </TableHead>- <TableHead- classList={{ hidden: !isVisible('secondary') && !isMobile() }}- style={serviceCountColumnStyle()}- >- Nodes- </TableHead>- <TableHead style={serviceHealthColumnStyle()}>Health</TableHead>- <TableHead- classList={{ hidden: !isVisible('secondary') && !isMobile() }}- style={sourceColumnStyle()}- >- Source- </TableHead>- <TableHead- classList={{ hidden: !isVisible('supplementary') && !isMobile() }}- style={uptimeColumnStyle()}- >- Uptime- </TableHead>- <TableHead style={serviceActionColumnStyle()}>Action</TableHead>- </TableRow>- </TableHeader>- <TableBody>- <For each={sortedPMGResources()}>- {(resource) => {- const isExpanded = createMemo(() => props.expandedResourceId === resource.id);- const isHighlighted = createMemo(- () => props.highlightedResourceId === resource.id,- );- const displayName = createMemo(() => getPreferredResourceDisplayName(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 unifiedSourceBadges = createMemo(() =>- getUnifiedSourceBadges(getUnifiedSources(resource)),- );- const hasUnifiedSources = createMemo(() => unifiedSourceBadges().length > 0);- 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}`;-- 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 (isHighlighted()) {- className +=- ' bg-blue-50 dark:bg-blue-900 ring-1 ring-blue-300 dark:ring-blue-600';- }- if (props.hoveredResourceId === resource.id) {- className += ' bg-blue-100 dark:bg-blue-800';- }- if (!isResourceOnline(resource)) {- className += ' opacity-60';- }-- return className;- });-- return (- <>- <TableRow- ref={(el) => registerRowRef(resource.id, el)}- class={rowClass()}- style={{ 'min-height': '32px' }}- onClick={() => toggleExpand(resource.id)}- onMouseEnter={() => props.onHoverChange?.(resource.id)}- onMouseLeave={() => props.onHoverChange?.(null)}- >- <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">- <div- class={`shrink-0 transition-transform duration-200 ${isExpanded() ? 'rotate-90' : ''}`}- >- <svg- class="w-3.5 h-3.5 text-muted group-hover:text-base-content"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M9 5l7 7-7 7"- />- </svg>- </div>- <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>- <ResourceFacetSummary- recentChanges={resource.recentChanges}- counts={resource.facetCounts}- class="mt-0.5"- />- </div>- </TableCell>-- <TableCell classList={{ hidden: !isVisible('primary') && !isMobile() }}>- <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: !isVisible('secondary') && !isMobile() }}- >- <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: !isVisible('supplementary') && !isMobile() }}- >- <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: !isVisible('secondary') && !isMobile() }}- >- <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- classList={{ hidden: !isVisible('secondary') && !isMobile() }}- >- <div class="flex items-center justify-center gap-1">- <Show- when={hasUnifiedSources()}- fallback={- <>- <Show when={platformBadge()}>- {(badge) => (- <span class={badge().classes} title={badge().title}>- {badge().label}- </span>- )}- </Show>- <Show when={sourceBadge()}>- {(badge) => (- <span class={badge().classes} title={badge().title}>- {badge().label}- </span>- )}- </Show>- </>- }- >- <For each={unifiedSourceBadges()}>- {(badge) => (- <span class={badge.classes} title={badge.title}>- {badge.label}- </span>- )}- </For>- </Show>- </div>- </TableCell>-- <TableCell- classList={{ hidden: !isVisible('supplementary') && !isMobile() }}- >- <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>- <TableCell- colspan={9}- class="bg-surface-alt px-4 py-4 border-b border-border-subtle shadow-inner"- >- <ResourceDetailDrawer- resource={resource}- resolveResourceLabel={resolveResourceLabel}- onClose={() => setExpandedResourceId(null)}- />- </TableCell>- </TableRow>- </Show>- </>- );- }}- </For>- </TableBody>- </Table>- </div>- </Show>- </Card>- </Show>+ <UnifiedResourceHostTableCard table={table} tableProps={props} />+ <UnifiedResourceServiceInfrastructureCard table={table} tableProps={props} /></div>);};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.tsxindex 2535a8f34e..925e7c9bc5 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@@ -7,6 +7,7 @@ import { formatSensorName } from '@/components/Infrastructure/resourceDetailMappimport { getPreferredResourceDisplayName } from '@/utils/resourceIdentity';import unifiedResourceTableSource from '@/components/Infrastructure/UnifiedResourceTable.tsx?raw';import unifiedResourceTableStateSource from '@/components/Infrastructure/useUnifiedResourceTableState.ts?raw';+import unifiedResourceTableModelSource from '@/components/Infrastructure/unifiedResourceTableModel.ts?raw';import {buildStatusOptions,filterResources,@@ -179,9 +180,16 @@ describe('UnifiedResourceTable performance contract', () => {it('keeps hot-path table state and windowing in the shared table state owner', () => {expect(unifiedResourceTableSource).toContain('useUnifiedResourceTableState');+ expect(unifiedResourceTableSource).toContain('UnifiedResourceHostTableCard');+ expect(unifiedResourceTableSource).toContain('UnifiedResourceServiceInfrastructureCard');expect(unifiedResourceTableSource).not.toContain('const sortedPBSResources = createMemo(() =>');+ expect(unifiedResourceTableSource).not.toContain('const getOutlierEmphasis =');+ expect(unifiedResourceTableSource).not.toContain('const getPBSTableRow =');expect(unifiedResourceTableStateSource).toContain('splitPrimaryAndServiceResources');expect(unifiedResourceTableStateSource).toContain('useTableWindowing');+ expect(unifiedResourceTableModelSource).toContain('export const getPBSTableRow');+ expect(unifiedResourceTableModelSource).toContain('export const getPMGTableRow');+ expect(unifiedResourceTableModelSource).toContain('export const getOutlierEmphasis');});it('keeps source filtering on the shared canonical source-platform helper', () => {diff --git a/frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts b/frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.tsnew file mode 100644index 0000000000..3711b6a764--- /dev/null+++ b/frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts@@ -0,0 +1,124 @@+import type { Resource } from '@/types/resource';+import { getServiceHealthSummaryPresentation } from '@/utils/serviceHealthPresentation';+import type { IODistributionStats } from '@/components/Infrastructure/infrastructureSelectors';++type PBSServiceData = {+ datastoreCount?: number;+ backupJobCount?: number;+ syncJobCount?: number;+ verifyJobCount?: number;+ pruneJobCount?: number;+ garbageJobCount?: number;+ connectionHealth?: string;+};++type PMGServiceData = {+ nodeCount?: number;+ queueTotal?: number;+ queueDeferred?: number;+ queueHold?: number;+ connectionHealth?: string;+};++export type PBSTableRow = {+ datastores: number | null;+ jobs: number | null;+ health: string | null;+ tone: ReturnType<typeof getServiceHealthSummaryPresentation>['tone'];+};++export type PMGTableRow = {+ queue: number | null;+ deferred: number | null;+ hold: number | null;+ nodes: number | null;+ health: string | null;+ tone: ReturnType<typeof getServiceHealthSummaryPresentation>['tone'];+};++export interface IOEmphasis {+ className: string;+ showOutlierHint: boolean;+}++export const isResourceOnline = (resource: Resource) => {+ const status = resource.status?.toLowerCase();+ return status !== 'offline' && status !== 'stopped';+};++export const getPBSTableRow = (resource: Resource): PBSTableRow | null => {+ if (resource.type !== 'pbs') return null;+ const platformData = resource.platformData as+ | { pbs?: PBSServiceData; pmg?: PMGServiceData }+ | undefined;+ const pbs = platformData?.pbs;+ const totalJobs =+ (pbs?.backupJobCount || 0) ++ (pbs?.syncJobCount || 0) ++ (pbs?.verifyJobCount || 0) ++ (pbs?.pruneJobCount || 0) ++ (pbs?.garbageJobCount || 0);+ const health = pbs?.connectionHealth?.trim() || null;++ return {+ datastores: (pbs?.datastoreCount || 0) > 0 ? pbs?.datastoreCount || 0 : null,+ jobs: totalJobs > 0 ? totalJobs : null,+ health,+ tone: getServiceHealthSummaryPresentation(resource.status, health).tone,+ };+};++export const getPMGTableRow = (resource: Resource): PMGTableRow | null => {+ if (resource.type !== 'pmg') return null;+ const platformData = resource.platformData as+ | { pbs?: PBSServiceData; pmg?: PMGServiceData }+ | undefined;+ const pmg = platformData?.pmg;+ const health = pmg?.connectionHealth?.trim() || null;+ const backlog = (pmg?.queueDeferred || 0) + (pmg?.queueHold || 0);++ return {+ queue: (pmg?.queueTotal || 0) > 0 ? pmg?.queueTotal || 0 : null,+ deferred: (pmg?.queueDeferred || 0) > 0 ? pmg?.queueDeferred || 0 : null,+ hold: (pmg?.queueHold || 0) > 0 ? pmg?.queueHold || 0 : null,+ nodes: (pmg?.nodeCount || 0) > 0 ? pmg?.nodeCount || 0 : null,+ health,+ tone:+ backlog > 0 ? 'warning' : getServiceHealthSummaryPresentation(resource.status, health).tone,+ };+};++export const getOutlierEmphasis = (+ value: number,+ stats: IODistributionStats,+): IOEmphasis => {+ if (!Number.isFinite(value) || value <= 0 || stats.max <= 0) {+ return { className: 'text-muted', showOutlierHint: false };+ }++ if (stats.count < 4) {+ const ratio = value / stats.max;+ if (ratio >= 0.995) {+ return { className: 'text-base-content font-medium', showOutlierHint: true };+ }+ return { className: 'text-muted', showOutlierHint: false };+ }++ if (stats.mad > 0) {+ const modifiedZ = (0.6745 * (value - stats.median)) / stats.mad;+ if (modifiedZ >= 6.5 && value >= stats.p99) {+ return { className: 'text-base-content font-semibold', showOutlierHint: true };+ }+ if (modifiedZ >= 5.5 && value >= stats.p97) {+ return { className: 'text-base-content font-medium', showOutlierHint: true };+ }+ return { className: 'text-muted', showOutlierHint: false };+ }++ if (value >= stats.p99)+ return { className: 'text-base-content font-semibold', showOutlierHint: true };+ if (value >= stats.p97)+ return { className: 'text-base-content font-medium', showOutlierHint: true };+ if (value > 0) return { className: 'text-muted', showOutlierHint: false };+ return { className: 'text-muted', showOutlierHint: false };+};diff --git a/frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts b/frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.tsindex 6b059acac2..c087dfe517 100644--- a/frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts+++ b/frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts@@ -309,3 +309,5 @@ export function useUnifiedResourceTableState(props: UnifiedResourceTableProps) {getUnifiedSources,};}++export type UnifiedResourceTableState = ReturnType<typeof useUnifiedResourceTableState>;diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.tsindex e8d7bbf74d..452d423eaf 100644--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts@@ -250,6 +250,7 @@ import resourceDetailMappersSource from '@/components/Infrastructure/resourceDetimport resourceDetailDrawerStateSource from '@/components/Infrastructure/useResourceDetailDrawerState.ts?raw';import unifiedResourceTableSource from '@/components/Infrastructure/UnifiedResourceTable.tsx?raw';import unifiedResourceTableStateSource from '@/components/Infrastructure/useUnifiedResourceTableState.ts?raw';+import unifiedResourceTableModelSource from '@/components/Infrastructure/unifiedResourceTableModel.ts?raw';import useUnifiedResourcesSource from '@/hooks/useUnifiedResources.ts?raw';import useWorkloadsSource from '@/hooks/useWorkloads.ts?raw';import findingsPanelSource from '@/components/AI/FindingsPanel.tsx?raw';@@ -2578,12 +2579,17 @@ describe('frontend resource type boundaries', () => {expect(resourceDetailMappersSource).not.toContain('export const normalizeHealthLabel');expect(resourceDetailMappersSource).not.toContain('export const healthToneClass');expect(unifiedResourceTableSource).toContain('useUnifiedResourceTableState');+ expect(unifiedResourceTableSource).toContain('UnifiedResourceHostTableCard');+ expect(unifiedResourceTableSource).toContain('UnifiedResourceServiceInfrastructureCard');expect(unifiedResourceTableSource).not.toContain('const split = createMemo(() =>');expect(unifiedResourceTableSource).not.toContain('const sortedPBSResources = createMemo(() =>');expect(unifiedResourceTableSource).not.toContain('const resourceColumnStyle = createMemo(() =>');- expect(unifiedResourceTableSource).toContain('getServiceHealthSummaryPresentation');+ expect(unifiedResourceTableSource).not.toContain('getServiceHealthSummaryPresentation');+ expect(unifiedResourceTableSource).not.toContain('const getOutlierEmphasis =');expect(unifiedResourceTableSource).not.toContain('const summarizeServiceHealthTone =');expect(unifiedResourceTableStateSource).toContain('export function useUnifiedResourceTableState');+ expect(unifiedResourceTableModelSource).toContain('getServiceHealthSummaryPresentation');+ expect(unifiedResourceTableModelSource).toContain('export const getOutlierEmphasis');expect(unifiedResourceTableStateSource).toContain('splitPrimaryAndServiceResources');expect(unifiedResourceTableStateSource).toContain('useTableWindowing');expect(exploreStatusBlockSource).toContain('getAIExploreStatusPresentation');