mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-25 12:52:25 +00:00
a57217b194
VsphereHostsTable was missing the Version (ESXi build) and Uptime columns that Proxmox / Docker / Kubernetes / TrueNAS host equivalents carry. The data was already piped through the canonical projection — ESXi version on resource.agent.osVersion (e.g. "8.0.3"), host uptime on resource.uptime (lifted from InventoryMetrics.UptimeSeconds via the sys.uptime.latest PerformanceManager counter wired in23ea4e487this morning) — the table just didn't render columns for them. VsphereHostsTable now renders Version and Uptime cells, ordered Version-adjacent-to-Host and Uptime before vCenter to mirror the Proxmox Nodes layout. Column widths trimmed to fit. Uptime uses the shared formatUptime util in condensed form (e.g. "163d") with the full label as the cell title attribute. Detail row colspan bumps 9 to 11 to keep the drawer spanning the full row. Plumbing the canonical Resource.Uptime through to the frontend required two fallback extensions surfaced by the column audit: - useUnifiedResources.ts toResource: the uptime fallback chain ended on platform-specific carve-outs (agent.uptimeSeconds, proxmox.uptime, pbs/pmg/kubernetes); vSphere populates only the canonical Resource.Uptime, so the chain has to land on v2.uptime. Same shape as the workloads-hook fix ine5b31f484. - internal/monitoring/monitor.go monitorUptime: the websocket broadcast converter walked the same platform-specific chain and silently dropped vSphere host/VM uptime, then merge- clobbered the REST-loaded value once WS reconnect replayed the broadcast. Add the canonical resource.Uptime fallback so the broadcast payload carries uptime for VMware-backed rows consistently with the REST contract. Carve-outs still take precedence so existing platforms keep prior behavior. Verified: vSphere overview Hosts table now renders esxi-01..07 with Version 8.0.3 and Uptime 147d-167d cells. No regression in Proxmox / Docker / Kubernetes / TrueNAS uptime paths. Contracts: - monitoring.md documents the canonical Resource.Uptime fallback in monitorUptime and the carve-out precedence. - unified-resources.md adds the same canonical-uptime fallback rule to the toResource consumer-side contract. - storage-recovery.md amends rule 29 to call out that the canonical Resource.Uptime fallback is descriptive host/VM uptime only and must not be reinterpreted as backup recency or recovery cadence. Proofs: - internal/monitoring/canonical_guardrails_test.go locks the monitorUptime fallback contract: canonical Resource.Uptime is surfaced when no carve-out is set, carve-outs take precedence, nil when nothing populates. - frontend-modern/src/hooks/__tests__/useUnifiedResources.test.ts asserts the toResource v2.uptime fallback for a vSphere-shaped payload with no platform-specific uptime carve-out.