Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Extract dashboard guest row cell owner

rcourtman089f976f7d54
diff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
index e4c8fa4bd2..5da9a57672 100644
--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
@@ -49,33 +49,34 @@ regression protection.
27. `frontend-modern/src/components/Dashboard/diskListModel.ts`
28. `frontend-modern/src/components/Dashboard/useDiskListState.ts`
29. `frontend-modern/src/components/Dashboard/GuestRow.tsx`
-30. `frontend-modern/src/components/Dashboard/guestRowModel.tsx`
-31. `frontend-modern/src/components/Dashboard/useGuestRowState.ts`
-32. `frontend-modern/src/components/Dashboard/GuestDrawer.tsx`
-33. `frontend-modern/src/components/Dashboard/guestDrawerModel.ts`
-34. `frontend-modern/src/components/Dashboard/useGuestDrawerState.ts`
-35. `frontend-modern/src/components/Dashboard/workloadSelectors.ts`
-36. `frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx`
-37. `frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts`
-38. `frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts`
-39. `frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts`
-40. `frontend-modern/src/components/Dashboard/__tests__/Dashboard.performance.contract.test.tsx`
-41. `frontend-modern/src/components/Dashboard/__tests__/DashboardFilter.test.tsx`
-42. `frontend-modern/src/components/Dashboard/__tests__/useDashboardFilterState.test.ts`
-43. `frontend-modern/src/components/Dashboard/MetricBar.test.tsx`
-44. `frontend-modern/src/components/Dashboard/__tests__/useMetricBarState.test.tsx`
-45. `frontend-modern/src/components/Dashboard/__tests__/EnhancedCPUBar.test.tsx`
-46. `frontend-modern/src/components/Dashboard/__tests__/useEnhancedCPUBarState.test.tsx`
-47. `frontend-modern/src/components/Dashboard/ThresholdSlider.test.tsx`
-48. `frontend-modern/src/components/Dashboard/__tests__/useThresholdSliderState.test.ts`
-49. `frontend-modern/src/components/Dashboard/__tests__/StackedDiskBar.test.tsx`
-50. `frontend-modern/src/components/Dashboard/__tests__/useStackedDiskBarState.test.tsx`
-51. `frontend-modern/src/components/Dashboard/StackedMemoryBar.test.tsx`
-52. `frontend-modern/src/components/Dashboard/__tests__/useStackedMemoryBarState.test.tsx`
-53. `frontend-modern/src/components/Dashboard/__tests__/DiskList.test.tsx`
-54. `frontend-modern/src/components/Dashboard/__tests__/GuestRow.test.tsx`
-55. `frontend-modern/src/components/Dashboard/GuestDrawer.test.tsx`
-56. `frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx`
+30. `frontend-modern/src/components/Dashboard/GuestRowCells.tsx`
+31. `frontend-modern/src/components/Dashboard/guestRowModel.tsx`
+32. `frontend-modern/src/components/Dashboard/useGuestRowState.ts`
+33. `frontend-modern/src/components/Dashboard/GuestDrawer.tsx`
+34. `frontend-modern/src/components/Dashboard/guestDrawerModel.ts`
+35. `frontend-modern/src/components/Dashboard/useGuestDrawerState.ts`
+36. `frontend-modern/src/components/Dashboard/workloadSelectors.ts`
+37. `frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx`
+38. `frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts`
+39. `frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts`
+40. `frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts`
+41. `frontend-modern/src/components/Dashboard/__tests__/Dashboard.performance.contract.test.tsx`
+42. `frontend-modern/src/components/Dashboard/__tests__/DashboardFilter.test.tsx`
+43. `frontend-modern/src/components/Dashboard/__tests__/useDashboardFilterState.test.ts`
+44. `frontend-modern/src/components/Dashboard/MetricBar.test.tsx`
+45. `frontend-modern/src/components/Dashboard/__tests__/useMetricBarState.test.tsx`
+46. `frontend-modern/src/components/Dashboard/__tests__/EnhancedCPUBar.test.tsx`
+47. `frontend-modern/src/components/Dashboard/__tests__/useEnhancedCPUBarState.test.tsx`
+48. `frontend-modern/src/components/Dashboard/ThresholdSlider.test.tsx`
+49. `frontend-modern/src/components/Dashboard/__tests__/useThresholdSliderState.test.ts`
+50. `frontend-modern/src/components/Dashboard/__tests__/StackedDiskBar.test.tsx`
+51. `frontend-modern/src/components/Dashboard/__tests__/useStackedDiskBarState.test.tsx`
+52. `frontend-modern/src/components/Dashboard/StackedMemoryBar.test.tsx`
+53. `frontend-modern/src/components/Dashboard/__tests__/useStackedMemoryBarState.test.tsx`
+54. `frontend-modern/src/components/Dashboard/__tests__/DiskList.test.tsx`
+55. `frontend-modern/src/components/Dashboard/__tests__/GuestRow.test.tsx`
+56. `frontend-modern/src/components/Dashboard/GuestDrawer.test.tsx`
+57. `frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx`
## Shared Boundaries
@@ -95,7 +96,7 @@ regression protection.
6. Deduplicate dashboard workload rows by canonical workload ID from `frontend-modern/src/utils/workloads.ts` rather than via local pass-through wrappers in `frontend-modern/src/components/Dashboard/Dashboard.tsx`
7. Render dashboard row identity directly from the shared canonical workload helper so row selection, hover, and fallback metadata lookup stay aligned with the same workload contract
8. Format infrastructure sensor labels through the shared `frontend-modern/src/utils/textPresentation.ts` presentation helper instead of maintaining a local title-casing implementation in `frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts`
-9. Extend dashboard row contract and per-row hot-path derivations through `frontend-modern/src/components/Dashboard/guestRowModel.tsx` and `frontend-modern/src/components/Dashboard/useGuestRowState.ts` rather than rebuilding column metadata, row identity, or anomaly correlation inside `frontend-modern/src/components/Dashboard/GuestRow.tsx`
+9. Extend dashboard row contract and per-row hot-path derivations through `frontend-modern/src/components/Dashboard/guestRowModel.tsx` and `frontend-modern/src/components/Dashboard/useGuestRowState.ts`, and extend tooltip-backed row cell presentation through `frontend-modern/src/components/Dashboard/GuestRowCells.tsx`, rather than rebuilding column metadata, row identity, cell tooltips, or anomaly correlation inside `frontend-modern/src/components/Dashboard/GuestRow.tsx`
10. Extend dashboard drawer derivations and runtime wiring through `frontend-modern/src/components/Dashboard/guestDrawerModel.ts` and `frontend-modern/src/components/Dashboard/useGuestDrawerState.ts` rather than rebuilding canonical guest identity, discovery routing, or drawer-local normalization inside `frontend-modern/src/components/Dashboard/GuestDrawer.tsx`
11. Extend dashboard disk-list derivations and fallback runtime wiring through `frontend-modern/src/components/Dashboard/diskListModel.ts` and `frontend-modern/src/components/Dashboard/useDiskListState.ts` rather than rebuilding usage math, progress-state mapping, or tooltip fallback logic inside `frontend-modern/src/components/Dashboard/DiskList.tsx`
12. Extend dashboard filter defaults, active-filter counting, reset semantics, and mobile toolbar state through `frontend-modern/src/components/Dashboard/dashboardFilterModel.ts` and `frontend-modern/src/components/Dashboard/useDashboardFilterState.ts`, and keep dashboard-owned filter-config assembly in `frontend-modern/src/components/Dashboard/useDashboardState.ts`, rather than rebuilding filter-local state inside `frontend-modern/src/components/Dashboard/DashboardFilter.tsx` or inline config IIFEs in `frontend-modern/src/components/Dashboard/Dashboard.tsx`
@@ -137,12 +138,14 @@ metadata persistence, workload-route synchronization, grouping/windowing, and
filter/sort state must extend through that owner instead of accreting back into
`frontend-modern/src/components/Dashboard/Dashboard.tsx`.
The dashboard guest-row path now follows the same pattern: the render shell
-stays in `frontend-modern/src/components/Dashboard/GuestRow.tsx`, while the
-canonical row contract and per-row hot-path derivations live in
+stays in `frontend-modern/src/components/Dashboard/GuestRow.tsx`, tooltip-backed
+cell presentation lives in `frontend-modern/src/components/Dashboard/GuestRowCells.tsx`,
+and the canonical row contract and per-row hot-path derivations live in
`frontend-modern/src/components/Dashboard/guestRowModel.tsx` and
`frontend-modern/src/components/Dashboard/useGuestRowState.ts`. Future row
-identity, column, anomaly-correlation, and link-state changes must extend
-through those owners instead of rebuilding row-local state inside the shell.
+identity, column, cell-tooltip, anomaly-correlation, and link-state changes
+must extend through those owners instead of rebuilding row-local state inside
+the shell.
The dashboard guest drawer now follows that same ownership rule: the shell
stays in `frontend-modern/src/components/Dashboard/GuestDrawer.tsx`, while
drawer-local normalization, backup/tag formatting, discovery identity wiring,
diff --git a/docs/release-control/v6/internal/subsystems/registry.json b/docs/release-control/v6/internal/subsystems/registry.json
index aeccd95c7b..43fb686a83 100644
--- a/docs/release-control/v6/internal/subsystems/registry.json
+++ b/docs/release-control/v6/internal/subsystems/registry.json
@@ -2527,6 +2527,7 @@
"frontend-modern/src/components/Dashboard/GuestDrawer.tsx",
"frontend-modern/src/components/Dashboard/guestDrawerModel.ts",
"frontend-modern/src/components/Dashboard/GuestRow.tsx",
+ "frontend-modern/src/components/Dashboard/GuestRowCells.tsx",
"frontend-modern/src/components/Dashboard/guestRowModel.tsx",
"frontend-modern/src/components/Dashboard/MetricBar.tsx",
"frontend-modern/src/components/Dashboard/metricBarModel.ts",
@@ -2612,6 +2613,7 @@
"frontend-modern/src/components/Dashboard/GuestDrawer.tsx",
"frontend-modern/src/components/Dashboard/guestDrawerModel.ts",
"frontend-modern/src/components/Dashboard/GuestRow.tsx",
+ "frontend-modern/src/components/Dashboard/GuestRowCells.tsx",
"frontend-modern/src/components/Dashboard/guestRowModel.tsx",
"frontend-modern/src/components/Dashboard/MetricBar.tsx",
"frontend-modern/src/components/Dashboard/metricBarModel.ts",
diff --git a/frontend-modern/src/components/Dashboard/GuestRow.tsx b/frontend-modern/src/components/Dashboard/GuestRow.tsx
index 6fd7502294..ec37496a61 100644
--- a/frontend-modern/src/components/Dashboard/GuestRow.tsx
+++ b/frontend-modern/src/components/Dashboard/GuestRow.tsx
@@ -1,32 +1,24 @@
-import { createMemo, Show, For } from 'solid-js';
-import { useTooltip } from '@/hooks/useTooltip';
-import { TooltipPortal } from '@/components/shared/TooltipPortal';
+import { createMemo, Show } from 'solid-js';
import { useNavigate } from '@solidjs/router';
-import type { VM, GuestNetworkInterface } from '@/types/api';
+import type { VM } from '@/types/api';
import type { WorkloadGuest } from '@/types/workloads';
-import {
- formatBytes,
- formatUptime,
- formatSpeed,
- getBackupInfo,
- getShortImageName,
-} from '@/utils/format';
+import { formatUptime, formatSpeed, getShortImageName } from '@/utils/format';
import { TagBadges } from './TagBadges';
import { StackedDiskBar } from './StackedDiskBar';
import { StackedMemoryBar } from './StackedMemoryBar';
+import {
+ BackupIndicator,
+ BackupStatusCell,
+ InfoTooltipCell,
+ NetworkInfoCell,
+ OSInfoCell,
+} from './GuestRowCells';
import { StatusDot } from '@/components/shared/StatusDot';
import { resolveWorkloadType } from '@/utils/workloads';
import { EnhancedCPUBar } from '@/components/Dashboard/EnhancedCPUBar';
import { UpdateButton } from '@/components/shared/ContainerUpdateBadge';
-import {
- getDashboardGuestBackupStatusPresentation,
- getDashboardGuestBackupTooltip,
- getDashboardGuestDiskStatusMessage,
- getDashboardGuestNetworkEmptyState,
-} from '@/utils/dashboardGuestPresentation';
-
-import { useAlertsActivation } from '@/stores/alertsActivation';
+import { getDashboardGuestDiskStatusMessage } from '@/utils/dashboardGuestPresentation';
import type { GuestRowProps } from './guestRowModel';
import { useGuestRowState } from './useGuestRowState';
@@ -37,379 +29,6 @@ const isVM = (guest: Guest): guest is VM => {
return resolveWorkloadType(guest) === 'vm';
};
-function BackupIndicator(props: {
- lastBackup: string | number | null | undefined;
- isTemplate: boolean;
-}) {
- // Don't show for templates
- if (props.isTemplate) return null;
-
- const alertsActivation = useAlertsActivation();
- const backupInfo = createMemo(() =>
- getBackupInfo(props.lastBackup, alertsActivation.getBackupThresholds()),
- );
- const config = createMemo(() => getDashboardGuestBackupStatusPresentation(backupInfo().status));
-
- // Only show when there's a problem (stale, critical, or never)
- const shouldShow = createMemo(() => {
- const status = backupInfo().status;
- return status === 'stale' || status === 'critical' || status === 'never';
- });
-
- const tooltipText = createMemo(() => {
- const info = backupInfo();
- return getDashboardGuestBackupTooltip(info.status, info.ageFormatted);
- });
-
- return (
- <Show when={shouldShow()}>
- <span class={`flex-shrink-0 ${config().color}`} title={tooltipText()}>
- <svg class="w-3.5 h-3.5" viewBox="0 0 24 24" fill="currentColor">
- {/* Shield shape */}
- <path
- d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"
- fill="none"
- stroke="currentColor"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
- />
- {/* Inner icon based on status */}
- <Show when={config().icon === 'warning'}>
- <path
- d="M12 8v4M12 16h.01"
- fill="none"
- stroke="currentColor"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
- />
- </Show>
- <Show when={config().icon === 'x'}>
- <path
- d="M10 10l4 4M14 10l-4 4"
- fill="none"
- stroke="currentColor"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
- />
- </Show>
- </svg>
- </span>
- </Show>
- );
-}
-
-// Network info cell with rich tooltip showing interfaces, IPs, and MACs
-function NetworkInfoCell(props: {
- ipAddresses: string[];
- networkInterfaces: GuestNetworkInterface[];
-}) {
- const tip = useTooltip();
-
- const hasInterfaces = () => props.networkInterfaces.length > 0;
- const primaryIp = () =>
- props.ipAddresses[0] || props.networkInterfaces[0]?.addresses?.[0] || null;
- const totalIps = () => {
- if (props.ipAddresses.length > 0) return props.ipAddresses.length;
- return props.networkInterfaces.reduce((sum, iface) => sum + (iface.addresses?.length || 0), 0);
- };
-
- return (
- <>
- <span
- class="inline-flex items-center gap-1 text-xs text-muted"
- onMouseEnter={tip.onMouseEnter}
- onMouseLeave={tip.onMouseLeave}
- >
- <Show when={primaryIp()} fallback="-">
- {/* Network icon */}
- <svg
- class="w-3.5 h-3.5"
- fill="none"
- viewBox="0 0 24 24"
- stroke="currentColor"
- stroke-width="1.5"
- >
- <path
- stroke-linecap="round"
- stroke-linejoin="round"
- d="M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418"
- />
- </svg>
- <span class="text-[10px] font-medium">{totalIps()}</span>
- </Show>
- </span>
-
- <TooltipPortal
- when={tip.show() && (hasInterfaces() || props.ipAddresses.length > 0)}
- x={tip.pos().x}
- y={tip.pos().y}
- >
- <div class="min-w-[180px] max-w-[280px]">
- <div class="font-medium mb-1 text-slate-300 border-b border-border pb-1">
- Network Interfaces
- </div>
-
- <Show when={hasInterfaces()}>
- <For each={props.networkInterfaces}>
- {(iface, idx) => (
- <div class="py-1" classList={{ 'border-t border-border': idx() > 0 }}>
- <div class="flex items-center gap-2 text-blue-400 font-medium">
- <span>{iface.name || 'eth' + idx()}</span>
- <Show when={iface.mac}>
- <span class="text-[9px] text-slate-500 font-normal">{iface.mac}</span>
- </Show>
- </div>
- <Show when={iface.addresses && iface.addresses.length > 0}>
- <div class="mt-0.5 flex flex-wrap gap-1">
- <For each={iface.addresses}>
- {(ip) => <span class="text-slate-300 font-mono">{ip}</span>}
- </For>
- </div>
- </Show>
- <Show when={!iface.addresses || iface.addresses.length === 0}>
- <span class="text-slate-500 text-[9px]">
- {getDashboardGuestNetworkEmptyState()}
- </span>
- </Show>
- <Show when={(iface.rxBytes || 0) > 0 || (iface.txBytes || 0) > 0}>
- <div class="mt-0.5 text-[9px] text-slate-500">
- RX: {formatBytes(iface.rxBytes || 0)} / TX: {formatBytes(iface.txBytes || 0)}
- </div>
- </Show>
- </div>
- )}
- </For>
- </Show>
-
- <Show when={!hasInterfaces() && props.ipAddresses.length > 0}>
- <div class="py-1">
- <div class="flex items-center gap-2 text-blue-400 font-medium">
- <span>IP Addresses</span>
- <span class="text-[9px] text-slate-500 font-normal">No agent data</span>
- </div>
- <div class="mt-0.5 flex flex-wrap gap-1">
- <For each={props.ipAddresses}>
- {(ip) => <span class="text-slate-300 font-mono">{ip}</span>}
- </For>
- </div>
- </div>
- </Show>
- </div>
- </TooltipPortal>
- </>
- );
-}
-
-// OS detection helper - simplified to just Linux vs Windows
-type OSType = 'windows' | 'linux' | 'unknown';
-
-function detectOSType(osName: string): OSType {
- const lower = osName.toLowerCase();
- if (lower.includes('windows')) return 'windows';
- // All Linux distros, BSDs, and Unix-likes -> linux
- if (
- lower.includes('linux') ||
- lower.includes('debian') ||
- lower.includes('ubuntu') ||
- lower.includes('alpine') ||
- lower.includes('centos') ||
- lower.includes('fedora') ||
- lower.includes('arch') ||
- lower.includes('nixos') ||
- lower.includes('suse') ||
- lower.includes('gentoo') ||
- lower.includes('rhel') ||
- lower.includes('rocky') ||
- lower.includes('alma') ||
- lower.includes('devuan') ||
- lower.includes('gnu') ||
- lower.includes('freebsd') ||
- lower.includes('openbsd') ||
- lower.includes('netbsd')
- ) {
- return 'linux';
- }
- return 'unknown';
-}
-
-// OS info cell with icon and Portal tooltip
-function OSInfoCell(props: { osName: string; osVersion: string; agentVersion: string }) {
- const tip = useTooltip();
- const osType = createMemo(() => detectOSType(props.osName));
-
- // OS icons - Windows logo and terminal prompt for Linux
- const OSIcon = () => {
- const type = osType();
- const iconClass = 'w-3.5 h-3.5 text-muted';
-
- switch (type) {
- case 'windows':
- // Windows logo - four tilted panes
- return (
- <svg class={iconClass} viewBox="0 0 24 24" fill="currentColor">
- <path d="M3 5.5l7.038-1v6.5H3v-5.5zm0 13l7.038 1V13H3v5.5zm8.038 1.118L21 21V13h-9.962v6.618zM11.038 4.382L21 3v8h-9.962V4.382z" />
- </svg>
- );
- case 'linux':
- // Terminal prompt icon
- return (
- <svg
- class={iconClass}
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
- >
- <polyline points="4 17 10 11 4 5" />
- <line x1="12" y1="19" x2="20" y2="19" />
- </svg>
- );
- default:
- return <span class="text-slate-400">—</span>;
- }
- };
-
- return (
- <>
- <span
- class="inline-flex items-center gap-1"
- onMouseEnter={tip.onMouseEnter}
- onMouseLeave={tip.onMouseLeave}
- >
- <OSIcon />
- </span>
-
- <TooltipPortal when={tip.show()} x={tip.pos().x} y={tip.pos().y}>
- <div class="min-w-[120px] max-w-[220px]">
- <div class="font-medium mb-1 text-slate-300 border-b border-border pb-1">
- Operating System
- </div>
- <div class="py-0.5">
- <div class="text-base-content font-medium">{props.osName}</div>
- <Show when={props.osVersion}>
- <div class="text-slate-400">Version: {props.osVersion}</div>
- </Show>
- <Show when={props.agentVersion}>
- <div class="text-slate-500 text-[9px] mt-1 pt-1 border-t border-border">
- Agent: {props.agentVersion}
- </div>
- </Show>
- </div>
- </div>
- </TooltipPortal>
- </>
- );
-}
-
-// Backup status cell with Portal tooltip
-function BackupStatusCell(props: { lastBackup: string | number | null | undefined }) {
- const tip = useTooltip();
-
- const alertsActivation = useAlertsActivation();
- const info = createMemo(() =>
- getBackupInfo(props.lastBackup, alertsActivation.getBackupThresholds()),
- );
- const config = createMemo(() => getDashboardGuestBackupStatusPresentation(info().status));
-
- return (
- <>
- <span
- class={`flex-shrink-0 cursor-help ${config().color}`}
- onMouseEnter={tip.onMouseEnter}
- onMouseLeave={tip.onMouseLeave}
- aria-label={`Backup status: ${info().status}`}
- >
- <svg
- class="w-4 h-4"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
- >
- {/* Shield shape */}
- <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" />
-
- {/* Inner icon based on status */}
- <Show when={config().icon === 'check'}>
- <path d="m9 12 2 2 4-4" />
- </Show>
- <Show when={config().icon === 'warning'}>
- <path d="M12 8v4M12 16h.01" />
- </Show>
- <Show when={config().icon === 'x'}>
- <path d="M10 10l4 4M14 10l-4 4" />
- </Show>
- </svg>
- </span>
-
- <TooltipPortal when={tip.show()} x={tip.pos().x} y={tip.pos().y}>
- <div class="min-w-[140px]">
- <div class="font-medium mb-1 text-slate-300 border-b border-border pb-1">
- Backup Status
- </div>
- <Show when={info().status !== 'never'}>
- <div class="py-0.5">
- <div class="text-slate-400">Last backup</div>
- <div class="text-base-content font-medium">
- {new Date(props.lastBackup!).toLocaleDateString(undefined, {
- weekday: 'short',
- year: 'numeric',
- month: 'short',
- day: 'numeric',
- })}
- </div>
- <div class="text-slate-300">{new Date(props.lastBackup!).toLocaleTimeString()}</div>
- </div>
- <div class="pt-1 mt-1 border-t border-border">
- <span class={config().color}>{info().ageFormatted} ago</span>
- </div>
- </Show>
- <Show when={info().status === 'never'}>
- <div class="py-0.5 text-red-400">No backup has ever been recorded for this guest.</div>
- </Show>
- </div>
- </TooltipPortal>
- </>
- );
-}
-
-// Info cell (VMID / image / namespace) with Portal tooltip for truncated values
-function InfoTooltipCell(props: { value: string; tooltip: string; type: string }) {
- const tip = useTooltip();
-
- const label = createMemo(() => {
- if (props.type === 'app-container') return 'Image';
- if (props.type === 'pod') return 'Namespace';
- return 'ID';
- });
-
- return (
- <>
- <span
- class="truncate max-w-[100px] cursor-help"
- onMouseEnter={tip.onMouseEnter}
- onMouseLeave={tip.onMouseLeave}
- >
- {props.value}
- </span>
-
- <TooltipPortal when={tip.show()} x={tip.pos().x} y={tip.pos().y}>
- <div class="max-w-[280px]">
- <div class="font-medium mb-1 text-slate-300 border-b border-border pb-1">{label()}</div>
- <div class="py-0.5 text-base-content break-all">{props.tooltip}</div>
- </div>
- </TooltipPortal>
- </>
- );
-}
-
export { GUEST_COLUMNS, VIEW_MODE_COLUMNS } from './guestRowModel';
export type { GuestRowProps, WorkloadIOEmphasis } from './guestRowModel';
diff --git a/frontend-modern/src/components/Dashboard/GuestRowCells.tsx b/frontend-modern/src/components/Dashboard/GuestRowCells.tsx
new file mode 100644
index 0000000000..41b9d6d1e9
--- /dev/null
+++ b/frontend-modern/src/components/Dashboard/GuestRowCells.tsx
@@ -0,0 +1,371 @@
+import { createMemo, For, Show } from 'solid-js';
+
+import { TooltipPortal } from '@/components/shared/TooltipPortal';
+import { useTooltip } from '@/hooks/useTooltip';
+import { useAlertsActivation } from '@/stores/alertsActivation';
+import type { GuestNetworkInterface } from '@/types/api';
+import { formatBytes, getBackupInfo } from '@/utils/format';
+import {
+ getDashboardGuestBackupStatusPresentation,
+ getDashboardGuestBackupTooltip,
+ getDashboardGuestNetworkEmptyState,
+} from '@/utils/dashboardGuestPresentation';
+
+function BackupIndicator(props: {
+ lastBackup: string | number | null | undefined;
+ isTemplate: boolean;
+}) {
+ if (props.isTemplate) return null;
+
+ const alertsActivation = useAlertsActivation();
+ const backupInfo = createMemo(() =>
+ getBackupInfo(props.lastBackup, alertsActivation.getBackupThresholds()),
+ );
+ const config = createMemo(() => getDashboardGuestBackupStatusPresentation(backupInfo().status));
+
+ const shouldShow = createMemo(() => {
+ const status = backupInfo().status;
+ return status === 'stale' || status === 'critical' || status === 'never';
+ });
+
+ const tooltipText = createMemo(() => {
+ const info = backupInfo();
+ return getDashboardGuestBackupTooltip(info.status, info.ageFormatted);
+ });
+
+ return (
+ <Show when={shouldShow()}>
+ <span class={`flex-shrink-0 ${config().color}`} title={tooltipText()}>
+ <svg class="w-3.5 h-3.5" viewBox="0 0 24 24" fill="currentColor">
+ <path
+ d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"
+ fill="none"
+ stroke="currentColor"
+ stroke-width="2"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ />
+ <Show when={config().icon === 'warning'}>
+ <path
+ d="M12 8v4M12 16h.01"
+ fill="none"
+ stroke="currentColor"
+ stroke-width="2"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ />
+ </Show>
+ <Show when={config().icon === 'x'}>
+ <path
+ d="M10 10l4 4M14 10l-4 4"
+ fill="none"
+ stroke="currentColor"
+ stroke-width="2"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ />
+ </Show>
+ </svg>
+ </span>
+ </Show>
+ );
+}
+
+function NetworkInfoCell(props: {
+ ipAddresses: string[];
+ networkInterfaces: GuestNetworkInterface[];
+}) {
+ const tip = useTooltip();
+
+ const hasInterfaces = () => props.networkInterfaces.length > 0;
+ const primaryIp = () =>
+ props.ipAddresses[0] || props.networkInterfaces[0]?.addresses?.[0] || null;
+ const totalIps = () => {
+ if (props.ipAddresses.length > 0) return props.ipAddresses.length;
+ return props.networkInterfaces.reduce((sum, iface) => sum + (iface.addresses?.length || 0), 0);
+ };
+
+ return (
+ <>
+ <span
+ class="inline-flex items-center gap-1 text-xs text-muted"
+ onMouseEnter={tip.onMouseEnter}
+ onMouseLeave={tip.onMouseLeave}
+ >
+ <Show when={primaryIp()} fallback="-">
+ <svg
+ class="w-3.5 h-3.5"
+ fill="none"
+ viewBox="0 0 24 24"
+ stroke="currentColor"
+ stroke-width="1.5"
+ >
+ <path
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ d="M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418"
+ />
+ </svg>
+ <span class="text-[10px] font-medium">{totalIps()}</span>
+ </Show>
+ </span>
+
+ <TooltipPortal
+ when={tip.show() && (hasInterfaces() || props.ipAddresses.length > 0)}
+ x={tip.pos().x}
+ y={tip.pos().y}
+ >
+ <div class="min-w-[180px] max-w-[280px]">
+ <div class="font-medium mb-1 text-slate-300 border-b border-border pb-1">
+ Network Interfaces
+ </div>
+
+ <Show when={hasInterfaces()}>
+ <For each={props.networkInterfaces}>
+ {(iface, idx) => (
+ <div class="py-1" classList={{ 'border-t border-border': idx() > 0 }}>
+ <div class="flex items-center gap-2 text-blue-400 font-medium">
+ <span>{iface.name || 'eth' + idx()}</span>
+ <Show when={iface.mac}>
+ <span class="text-[9px] text-slate-500 font-normal">{iface.mac}</span>
+ </Show>
+ </div>
+ <Show when={iface.addresses && iface.addresses.length > 0}>
+ <div class="mt-0.5 flex flex-wrap gap-1">
+ <For each={iface.addresses}>
+ {(ip) => <span class="text-slate-300 font-mono">{ip}</span>}
+ </For>
+ </div>
+ </Show>
+ <Show when={!iface.addresses || iface.addresses.length === 0}>
+ <span class="text-slate-500 text-[9px]">
+ {getDashboardGuestNetworkEmptyState()}
+ </span>
+ </Show>
+ <Show when={(iface.rxBytes || 0) > 0 || (iface.txBytes || 0) > 0}>
+ <div class="mt-0.5 text-[9px] text-slate-500">
+ RX: {formatBytes(iface.rxBytes || 0)} / TX: {formatBytes(iface.txBytes || 0)}
+ </div>
+ </Show>
+ </div>
+ )}
+ </For>
+ </Show>
+
+ <Show when={!hasInterfaces() && props.ipAddresses.length > 0}>
+ <div class="py-1">
+ <div class="flex items-center gap-2 text-blue-400 font-medium">
+ <span>IP Addresses</span>
+ <span class="text-[9px] text-slate-500 font-normal">No agent data</span>
+ </div>
+ <div class="mt-0.5 flex flex-wrap gap-1">
+ <For each={props.ipAddresses}>
+ {(ip) => <span class="text-slate-300 font-mono">{ip}</span>}
+ </For>
+ </div>
+ </div>
+ </Show>
+ </div>
+ </TooltipPortal>
+ </>
+ );
+}
+
+type OSType = 'windows' | 'linux' | 'unknown';
+
+function detectOSType(osName: string): OSType {
+ const lower = osName.toLowerCase();
+ if (lower.includes('windows')) return 'windows';
+ if (
+ lower.includes('linux') ||
+ lower.includes('debian') ||
+ lower.includes('ubuntu') ||
+ lower.includes('alpine') ||
+ lower.includes('centos') ||
+ lower.includes('fedora') ||
+ lower.includes('arch') ||
+ lower.includes('nixos') ||
+ lower.includes('suse') ||
+ lower.includes('gentoo') ||
+ lower.includes('rhel') ||
+ lower.includes('rocky') ||
+ lower.includes('alma') ||
+ lower.includes('devuan') ||
+ lower.includes('gnu') ||
+ lower.includes('freebsd') ||
+ lower.includes('openbsd') ||
+ lower.includes('netbsd')
+ ) {
+ return 'linux';
+ }
+ return 'unknown';
+}
+
+function OSInfoCell(props: { osName: string; osVersion: string; agentVersion: string }) {
+ const tip = useTooltip();
+ const osType = createMemo(() => detectOSType(props.osName));
+
+ const OSIcon = () => {
+ const type = osType();
+ const iconClass = 'w-3.5 h-3.5 text-muted';
+
+ switch (type) {
+ case 'windows':
+ return (
+ <svg class={iconClass} viewBox="0 0 24 24" fill="currentColor">
+ <path d="M3 5.5l7.038-1v6.5H3v-5.5zm0 13l7.038 1V13H3v5.5zm8.038 1.118L21 21V13h-9.962v6.618zM11.038 4.382L21 3v8h-9.962V4.382z" />
+ </svg>
+ );
+ case 'linux':
+ return (
+ <svg
+ class={iconClass}
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ stroke-width="2"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ >
+ <polyline points="4 17 10 11 4 5" />
+ <line x1="12" y1="19" x2="20" y2="19" />
+ </svg>
+ );
+ default:
+ return <span class="text-slate-400">—</span>;
+ }
+ };
+
+ return (
+ <>
+ <span
+ class="inline-flex items-center gap-1"
+ onMouseEnter={tip.onMouseEnter}
+ onMouseLeave={tip.onMouseLeave}
+ >
+ <OSIcon />
+ </span>
+
+ <TooltipPortal when={tip.show()} x={tip.pos().x} y={tip.pos().y}>
+ <div class="min-w-[120px] max-w-[220px]">
+ <div class="font-medium mb-1 text-slate-300 border-b border-border pb-1">
+ Operating System
+ </div>
+ <div class="py-0.5">
+ <div class="text-base-content font-medium">{props.osName}</div>
+ <Show when={props.osVersion}>
+ <div class="text-slate-400">Version: {props.osVersion}</div>
+ </Show>
+ <Show when={props.agentVersion}>
+ <div class="text-slate-500 text-[9px] mt-1 pt-1 border-t border-border">
+ Agent: {props.agentVersion}
+ </div>
+ </Show>
+ </div>
+ </div>
+ </TooltipPortal>
+ </>
+ );
+}
+
+function BackupStatusCell(props: { lastBackup: string | number | null | undefined }) {
+ const tip = useTooltip();
+
+ const alertsActivation = useAlertsActivation();
+ const info = createMemo(() =>
+ getBackupInfo(props.lastBackup, alertsActivation.getBackupThresholds()),
+ );
+ const config = createMemo(() => getDashboardGuestBackupStatusPresentation(info().status));
+
+ return (
+ <>
+ <span
+ class={`flex-shrink-0 cursor-help ${config().color}`}
+ onMouseEnter={tip.onMouseEnter}
+ onMouseLeave={tip.onMouseLeave}
+ aria-label={`Backup status: ${info().status}`}
+ >
+ <svg
+ class="w-4 h-4"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ stroke-width="2"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ >
+ <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" />
+
+ <Show when={config().icon === 'check'}>
+ <path d="m9 12 2 2 4-4" />
+ </Show>
+ <Show when={config().icon === 'warning'}>
+ <path d="M12 8v4M12 16h.01" />
+ </Show>
+ <Show when={config().icon === 'x'}>
+ <path d="M10 10l4 4M14 10l-4 4" />
+ </Show>
+ </svg>
+ </span>
+
+ <TooltipPortal when={tip.show()} x={tip.pos().x} y={tip.pos().y}>
+ <div class="min-w-[140px]">
+ <div class="font-medium mb-1 text-slate-300 border-b border-border pb-1">
+ Backup Status
+ </div>
+ <Show when={info().status !== 'never'}>
+ <div class="py-0.5">
+ <div class="text-slate-400">Last backup</div>
+ <div class="text-base-content font-medium">
+ {new Date(props.lastBackup!).toLocaleDateString(undefined, {
+ weekday: 'short',
+ year: 'numeric',
+ month: 'short',
+ day: 'numeric',
+ })}
+ </div>
+ <div class="text-slate-300">{new Date(props.lastBackup!).toLocaleTimeString()}</div>
+ </div>
+ <div class="pt-1 mt-1 border-t border-border">
+ <span class={config().color}>{info().ageFormatted} ago</span>
+ </div>
+ </Show>
+ <Show when={info().status === 'never'}>
+ <div class="py-0.5 text-red-400">No backup has ever been recorded for this guest.</div>
+ </Show>
+ </div>
+ </TooltipPortal>
+ </>
+ );
+}
+
+function InfoTooltipCell(props: { value: string; tooltip: string; type: string }) {
+ const tip = useTooltip();
+
+ const label = createMemo(() => {
+ if (props.type === 'app-container') return 'Image';
+ if (props.type === 'pod') return 'Namespace';
+ return 'ID';
+ });
+
+ return (
+ <>
+ <span
+ class="truncate max-w-[100px] cursor-help"
+ onMouseEnter={tip.onMouseEnter}
+ onMouseLeave={tip.onMouseLeave}
+ >
+ {props.value}
+ </span>
+
+ <TooltipPortal when={tip.show()} x={tip.pos().x} y={tip.pos().y}>
+ <div class="max-w-[280px]">
+ <div class="font-medium mb-1 text-slate-300 border-b border-border pb-1">{label()}</div>
+ <div class="py-0.5 text-base-content break-all">{props.tooltip}</div>
+ </div>
+ </TooltipPortal>
+ </>
+ );
+}
+
+export { BackupIndicator, BackupStatusCell, InfoTooltipCell, NetworkInfoCell, OSInfoCell };
diff --git a/frontend-modern/src/components/Dashboard/__tests__/Dashboard.performance.contract.test.tsx b/frontend-modern/src/components/Dashboard/__tests__/Dashboard.performance.contract.test.tsx
index 118db7c8dd..e44b1bf535 100644
--- a/frontend-modern/src/components/Dashboard/__tests__/Dashboard.performance.contract.test.tsx
+++ b/frontend-modern/src/components/Dashboard/__tests__/Dashboard.performance.contract.test.tsx
@@ -29,6 +29,7 @@ import metricBarStateSource from '../useMetricBarState.ts?raw';
import guestDrawerSource from '../GuestDrawer.tsx?raw';
import guestDrawerModelSource from '../guestDrawerModel.ts?raw';
import guestRowSource from '../GuestRow.tsx?raw';
+import guestRowCellsSource from '../GuestRowCells.tsx?raw';
import guestDrawerStateSource from '../useGuestDrawerState.ts?raw';
import guestRowModelSource from '../guestRowModel.tsx?raw';
import guestRowStateSource from '../useGuestRowState.ts?raw';
@@ -574,13 +575,21 @@ describe('Dashboard performance contract', () => {
it('keeps guest row contract and hot-path state in canonical row owners', () => {
expect(guestRowSource).toContain('useGuestRowState');
+ expect(guestRowSource).toContain("from './GuestRowCells'");
expect(guestRowSource).not.toContain('export const GUEST_COLUMNS');
expect(guestRowSource).not.toContain('const guestId = createMemo(');
+ expect(guestRowSource).not.toContain('function NetworkInfoCell(');
+ expect(guestRowSource).not.toContain('function OSInfoCell(');
+ expect(guestRowSource).not.toContain('function BackupStatusCell(');
expect(guestRowModelSource).toContain('export const GUEST_COLUMNS');
expect(guestRowModelSource).toContain('export const VIEW_MODE_COLUMNS');
expect(guestRowStateSource).toContain('getCanonicalWorkloadId');
expect(guestRowStateSource).toContain('buildMetricKey');
expect(guestRowStateSource).toContain('getWorkloadTypeBadge');
+ expect(guestRowCellsSource).toContain('export { BackupIndicator');
+ expect(guestRowCellsSource).toContain('function NetworkInfoCell(');
+ expect(guestRowCellsSource).toContain('function OSInfoCell(');
+ expect(guestRowCellsSource).toContain('useTooltip');
});
it('keeps guest drawer runtime and derivations in canonical drawer owners', () => {
diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
index 11371fc62a..29435c43d0 100644
--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
@@ -110,6 +110,7 @@ import recentAlertsPanelSource from '@/pages/DashboardPanels/RecentAlertsPanel.t
import storagePanelSource from '@/pages/DashboardPanels/StoragePanel.tsx?raw';
import recoveryStatusPanelSource from '@/pages/DashboardPanels/RecoveryStatusPanel.tsx?raw';
import guestRowSource from '@/components/Dashboard/GuestRow.tsx?raw';
+import guestRowCellsSource from '@/components/Dashboard/GuestRowCells.tsx?raw';
import guestRowModelSource from '@/components/Dashboard/guestRowModel.tsx?raw';
import guestRowStateSource from '@/components/Dashboard/useGuestRowState.ts?raw';
import dashboardDiskListSource from '@/components/Dashboard/DiskList.tsx?raw';
@@ -582,9 +583,15 @@ describe('frontend resource type boundaries', () => {
expect(storageSummarySource).toContain('normalizeOrgScope(getOrgID())');
expect(storageSummarySource).not.toContain("getOrgID() || 'default'");
expect(guestRowSource).toContain('useGuestRowState');
+ expect(guestRowSource).toContain("from './GuestRowCells'");
expect(guestRowSource).not.toContain('const guestId = createMemo(');
+ expect(guestRowSource).not.toContain('function NetworkInfoCell(');
+ expect(guestRowSource).not.toContain('function OSInfoCell(');
expect(guestRowStateSource).toContain('getCanonicalWorkloadId');
expect(guestRowModelSource).toContain('export const GUEST_COLUMNS');
+ expect(guestRowCellsSource).toContain('function NetworkInfoCell(');
+ expect(guestRowCellsSource).toContain('function OSInfoCell(');
+ expect(guestRowCellsSource).toContain('useTooltip');
expect(guestRowSource).not.toContain('buildGuestId');
expect(guestDrawerSource).toContain('useGuestDrawerState');
expect(guestDrawerStateSource).toContain('getCanonicalWorkloadId');
@@ -3287,9 +3294,9 @@ describe('frontend resource type boundaries', () => {
});
it('keeps dashboard guest fallback copy in a shared presentation utility', () => {
- expect(guestRowSource).toContain('getDashboardGuestBackupStatusPresentation');
- expect(guestRowSource).toContain('getDashboardGuestBackupTooltip');
- expect(guestRowSource).toContain('getDashboardGuestNetworkEmptyState');
+ expect(guestRowCellsSource).toContain('getDashboardGuestBackupStatusPresentation');
+ expect(guestRowCellsSource).toContain('getDashboardGuestBackupTooltip');
+ expect(guestRowCellsSource).toContain('getDashboardGuestNetworkEmptyState');
expect(guestRowSource).toContain('getDashboardGuestDiskStatusMessage');
expect(guestRowSource).not.toContain('No backup found');
expect(guestRowSource).not.toContain('No IP assigned');
diff --git a/scripts/release_control/subsystem_lookup_test.py b/scripts/release_control/subsystem_lookup_test.py
index 18253fef77..a5964b1147 100644
--- a/scripts/release_control/subsystem_lookup_test.py
+++ b/scripts/release_control/subsystem_lookup_test.py
@@ -1775,6 +1775,7 @@ class SubsystemLookupTest(unittest.TestCase):
result = lookup_paths(
[
"frontend-modern/src/components/Dashboard/GuestRow.tsx",
+ "frontend-modern/src/components/Dashboard/GuestRowCells.tsx",
"frontend-modern/src/components/Dashboard/guestRowModel.tsx",
"frontend-modern/src/components/Dashboard/useGuestRowState.ts",
]