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.

fix(frontend): simplify vSphere host status on mobile

rcourtman23a1e7e191aa
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 8e32551976..bc72461890 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -4184,6 +4184,13 @@ identity candidates) and pass them into the shared metric bar primitives
(`ResponsiveMetricCell`, `StackedMemoryBar`, `StackedDiskBar`); the static
`METRIC_THRESHOLDS` display constants remain fallback-only presentation for
callers without alert configuration in scope.
+The vSphere ESXi host table keeps power state distinct from aggregate resource
+health without spending a phone column on the repeated normal case. At phone
+widths the Power column is hidden and a shared `MetadataBadge` appears beside
+host identity only for Off, Suspended, or Unknown; powered-on hosts retain only
+the canonical health dot there. Tablet and desktop widths keep the full Power
+column, and the mobile exception badge must not replace or recolor the health
+indicator.
Canonical Linux memory usage-unavailable is a first-class metric fallback,
not a numeric zero. Shared workload bars, platform tables, drawers, and live
history labels must render `N/A` (while retaining known capacity where useful)
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 3628d1d7c2..76b70f4637 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -2724,6 +2724,12 @@ top-level types. Phase-1 vSphere work must not invent `esxi-host`,
`vsphere-vm`, `vsphere-cluster`, `system-container`, `app-container`, or
`physical-disk` projections just because the upstream APIs expose additional
object classes.
+The ESXi consumer preserves provider-authored power state separately from
+aggregate resource health. Desktop tables may expose both as independent
+columns; phone presentation may suppress the ordinary powered-on value, but
+must surface Off, Suspended, or Unknown beside host identity and must not use
+that exception badge as a replacement for the canonical resource-health
+indicator.
That same VMware contract now also includes the shared source boundary. When
runtime work starts, VMware-backed records must flow through one canonical
VMware source key plus `platformType: vmware-vsphere`, not through separate
diff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.json
index 33d3d171ed..2d6501c2a4 100644
--- a/frontend-modern/browser-verification.json
+++ b/frontend-modern/browser-verification.json
@@ -1,23 +1,21 @@
{
"version": 1,
- "base_sha": "389ff2825e5228a9113921cd2e3ca6c1d2118962",
- "verified_at": "2026-08-25T16:54:23Z",
+ "base_sha": "07e85acc6d80b83afe95df6fef13617a1687b835",
+ "verified_at": "2026-08-25T17:04:15Z",
"result": "passed",
"changed_paths": [
- "frontend-modern/src/hooks/useTooltip.ts"
+ "frontend-modern/src/features/vmware/VsphereHostsTable.tsx"
],
"content_sha256": {
- "frontend-modern/src/hooks/useTooltip.ts": "5cd07282857599694979567df14cbfdb54f853b73f6d5d17b29ab1fffcc51c17"
+ "frontend-modern/src/features/vmware/VsphereHostsTable.tsx": "55d156b27c0b1e7808fb6ef2e135b5ace3c8a72d60591a0af0af2d2e639fcbf9"
},
"routes": [
- "/docker/overview",
- "/truenas/overview",
"/vmware/overview"
],
"viewports": [
{
- "width": 1280,
- "height": 800
+ "width": 1440,
+ "height": 900
},
{
"width": 390,
@@ -25,15 +23,17 @@
}
],
"states": [
- "Docker host table before expansion with metric hover targets",
- "Docker auth-service-01 host drawer open without a lingering metric tooltip",
- "TrueNAS truenas-main system drawer open at phone width",
- "vSphere etl-batch-01 workload drawer open at phone width"
+ "phone host table with powered-on rows omitting the redundant Power column",
+ "phone host table with degraded esxi-07 health remaining amber independently of power presentation",
+ "phone esxi-07 host detail expanded without clipping or horizontal overflow",
+ "desktop host table with the Power column and powered-on cells visible",
+ "desktop esxi-01 host detail expanded with the Power column retained"
],
"interactions": [
- "activated the auth-service-01 metric-heavy row at 390px and verified the memory and CPU tooltip portals dismissed before the drawer reflow",
- "repeated the auth-service-01 row activation at desktop width and verified the drawer remained unobscured with no lingering metric tooltip",
- "opened TrueNAS and vSphere specialized drawers at 390px and inspected placement, clipping, stacking, scrolling, and tab usability",
+ "inspected the 390px host table and verified Host, CPU, Mem, VM count, and uptime remain aligned while Power and repeated On values are absent",
+ "expanded and collapsed the degraded esxi-07 host row at 390px and verified the canonical health state and detail disclosure remain usable",
+ "resized to 1440px, verified the Power header and powered-on cells return, and expanded the esxi-01 host detail",
+ "verified Off, Suspended, and Unknown exception badges through the focused component regression test",
"restored the browser viewport after responsive verification"
]
}
diff --git a/frontend-modern/src/features/vmware/VsphereHostsTable.tsx b/frontend-modern/src/features/vmware/VsphereHostsTable.tsx
index e753da5593..c60b7617cf 100644
--- a/frontend-modern/src/features/vmware/VsphereHostsTable.tsx
+++ b/frontend-modern/src/features/vmware/VsphereHostsTable.tsx
@@ -1,4 +1,5 @@
import { Show, createMemo, type Component, type JSX } from 'solid-js';
+import { MetadataBadge, type MetadataBadgeTone } from '@/components/shared/MetadataBadge';
import { StatusDot } from '@/components/shared/StatusDot';
import { ResponsiveMetricCell } from '@/components/shared/responsive';
import { StackedMemoryBar } from '@/components/Workloads/StackedMemoryBar';
@@ -14,6 +15,7 @@ import {
formatVmwarePowerState,
getVmwareResourceDisplayStatus,
getVmwarePowerStateVariant,
+ normalizeVmwarePowerStateToken,
} from './vmwarePageModel';
import { buildMetricKeyForUnifiedResource } from '@/utils/metricsKeys';
import {
@@ -75,6 +77,24 @@ const VSPHERE_HOST_SORT_KEYS = [
type VsphereHostSortKey = (typeof VSPHERE_HOST_SORT_KEYS)[number];
+type MobilePowerException = {
+ label: 'Off' | 'Suspended' | 'Unknown';
+ tone: MetadataBadgeTone;
+ title: string;
+};
+
+const getMobilePowerException = (powerState: string | undefined): MobilePowerException | null => {
+ const normalized = normalizeVmwarePowerStateToken(powerState);
+ if (normalized === 'poweredon' || normalized === 'on') return null;
+ if (normalized === 'poweredoff' || normalized === 'off') {
+ return { label: 'Off', tone: 'danger', title: 'Power state: Off' };
+ }
+ if (normalized === 'suspended') {
+ return { label: 'Suspended', tone: 'warning', title: 'Power state: Suspended' };
+ }
+ return { label: 'Unknown', tone: 'muted', title: 'Power state: Unknown' };
+};
+
const getVsphereHostSortValue = (
host: Resource,
vmCountByHost: Map<string, number>,
@@ -209,8 +229,9 @@ export const VsphereHostsTable: Component<{
Desktop widths give the Host FQDN room, balance the CPU
and Memory bars, and trim the Datacenter / Cluster /
Power / vCenter text columns and the Datastores / VMs
- integer-count columns to what their content actually
- needs. Mobile widths are unchanged.
+ integer-count columns to what their content actually needs.
+ Phone rows omit the normally repetitive powered-on column;
+ exceptional power states remain visible beside the host.
*/}
<PlatformSortableTableHead
kind="name"
@@ -248,7 +269,7 @@ export const VsphereHostsTable: Component<{
kind="text"
sort={sort}
sortKey="power"
- class="platform-table-mobile-w-10 platform-table-narrow-hidden w-[12%] md:w-[7%]"
+ class="hidden md:table-cell md:w-[7%]"
>
Power
</PlatformSortableTableHead>
@@ -329,6 +350,7 @@ export const VsphereHostsTable: Component<{
meta()?.datastoreIds?.length ?? meta()?.datastoreNames?.length ?? 0;
const vmCount = () =>
vmCountByHost().get(asTrimmedString(meta()?.managedObjectId) || '') ?? 0;
+ const mobilePowerException = () => getMobilePowerException(meta()?.powerState);
const displayStatus = () => getVmwareResourceDisplayStatus(host);
const indicator = () => getSimpleStatusIndicator(displayStatus());
const metricsKey = () => buildMetricKeyForUnifiedResource(host);
@@ -384,9 +406,26 @@ export const VsphereHostsTable: Component<{
title={displayStatus() || 'unknown'}
ariaHidden
/>
- <span class="truncate font-semibold text-base-content" title={name()}>
+ <span
+ class="min-w-0 truncate font-semibold text-base-content"
+ title={name()}
+ >
{name()}
</span>
+ <Show when={mobilePowerException()}>
+ {(power) => (
+ <MetadataBadge
+ size="xs"
+ shape="rounded"
+ tone={power().tone}
+ class="shrink-0 md:hidden"
+ title={power().title}
+ data-vsphere-host-power-exception={power().label.toLowerCase()}
+ >
+ {power().label}
+ </MetadataBadge>
+ )}
+ </Show>
</div>
</TableCell>
<TableCell
@@ -407,7 +446,7 @@ export const VsphereHostsTable: Component<{
<span class="block truncate">{cluster()}</span>
</TableCell>
<TableCell
- class={`${getPlatformTableCellClassForKind('text')} platform-table-narrow-hidden text-base-content`}
+ class={`${getPlatformTableCellClassForKind('text')} hidden text-base-content md:table-cell`}
>
<div class="flex items-center gap-2">
<StatusDot
diff --git a/frontend-modern/src/features/vmware/__tests__/VsphereHostsTable.test.tsx b/frontend-modern/src/features/vmware/__tests__/VsphereHostsTable.test.tsx
index 60a08db6cd..aa2a781fbd 100644
--- a/frontend-modern/src/features/vmware/__tests__/VsphereHostsTable.test.tsx
+++ b/frontend-modern/src/features/vmware/__tests__/VsphereHostsTable.test.tsx
@@ -53,7 +53,7 @@ afterEach(() => {
});
describe('VsphereHostsTable', () => {
- it('keeps power, VM count, and uptime in the phone column set', () => {
+ it('hides the normal power column on phones while retaining VM count and uptime', () => {
const { container } = render(() => (
<VsphereHostsTable
hosts={[makeHost({ id: 'host-1' })]}
@@ -69,10 +69,61 @@ describe('VsphereHostsTable', () => {
expect(headers.find((header) => header.textContent?.includes('Host'))).toHaveClass(
'platform-table-mobile-w-30',
);
- expect(headers.find((header) => header.textContent?.includes('Power'))).toHaveClass('w-[12%]');
+ expect(headers.find((header) => header.textContent?.includes('Power'))).toHaveClass(
+ 'hidden',
+ 'md:table-cell',
+ );
expect(headers.find((header) => header.textContent?.includes('Up'))).toHaveClass('w-[16%]');
});
+ it('shows only exceptional power states beside the host name on phones', () => {
+ const poweredOn = makeHost({ id: 'host-on' });
+ const poweredOff = makeHost({
+ id: 'host-off',
+ vmware: { ...makeHost({ id: 'host-off' }).vmware!, powerState: 'poweredOff' },
+ });
+ const suspended = makeHost({
+ id: 'host-suspended',
+ vmware: { ...makeHost({ id: 'host-suspended' }).vmware!, powerState: 'suspended' },
+ });
+ const unknown = makeHost({
+ id: 'host-unknown',
+ vmware: { ...makeHost({ id: 'host-unknown' }).vmware!, powerState: undefined },
+ });
+
+ const { container } = render(() => (
+ <VsphereHostsTable
+ hosts={[poweredOn, poweredOff, suspended, unknown]}
+ scope={[poweredOn, poweredOff, suspended, unknown]}
+ emptyIcon={<span />}
+ emptyTitle="No hosts"
+ emptyDescription="No hosts"
+ showToolbar={false}
+ />
+ ));
+
+ expect(
+ container.querySelector(
+ '[data-vsphere-host-row="host-on"] [data-vsphere-host-power-exception]',
+ ),
+ ).toBeNull();
+ expect(
+ container.querySelector(
+ '[data-vsphere-host-row="host-off"] [data-vsphere-host-power-exception="off"]',
+ ),
+ ).toHaveTextContent('Off');
+ expect(
+ container.querySelector(
+ '[data-vsphere-host-row="host-suspended"] [data-vsphere-host-power-exception="suspended"]',
+ ),
+ ).toHaveTextContent('Suspended');
+ expect(
+ container.querySelector(
+ '[data-vsphere-host-row="host-unknown"] [data-vsphere-host-power-exception="unknown"]',
+ ),
+ ).toHaveTextContent('Unknown');
+ });
+
it('treats an impaired vSphere source as degraded for the row indicator and health filter', async () => {
const healthy = makeHost({ id: 'host-healthy', name: 'esxi-healthy.lab.local' });
const impaired = makeHost({