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
Converge platform datetime value cells
rcourtman4cd3c5e15fd3
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.mdindex 646184e84a..aded9f8481 100644--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md@@ -2616,6 +2616,14 @@ Podman native table helpers, Kubernetes node capacity cells, and TrueNASsystem, VM, storage-topology, and protection byte cells must compose thathelper instead of declaring local `formatBytes` wrappers, importing the genericformatter in table files, or reimplementing byte-unit precision there.+Compact platform table timestamps follow the same rule.+`PlatformTableDateTimeValue` and `formatPlatformTableDateTimeValue` own compact+date-time parsing, invalid/empty markers, optional minimum-year filtering, Intl+format options, and tabular-number styling for dense timestamp cells. TrueNAS+protection completed-time cells and vSphere activity "When" cells must compose+that primitive instead of declaring local compact `toLocaleString` helpers, and+timestamp columns use the canonical `numeric-value` alignment kind because they+are scannable scalar values.Platform table numeric fallback rendering is registry-backed too.`PlatformTableNumberValue` owns finite-number checking, tabular-number styling,custom empty-marker support, and caller-owned number formatting for densediff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.mdindex 92c0772948..6b4424b38f 100644--- a/docs/release-control/v6/internal/subsystems/unified-resources.md+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md@@ -250,6 +250,13 @@ right source-specific value, while dense platform table cells must use`formatPlatformTableBytesValue` for positive byte formatting and unknown /non-positive empty-cell markers instead of carrying table-local `formatBytes`wrappers or direct generic byte-formatter imports.+Compact timestamp table cells follow the same boundary: unified-resource+consumers own whether `completedAt`, `startedAt`, `occurredAt`, or `observedAt`+is the right source-specific value for the row, while dense platform table+rendering must use `PlatformTableDateTimeValue` /+`formatPlatformTableDateTimeValue` for parsing, empty markers, compact Intl+formatting, minimum-year filtering when platform adapters emit placeholder+dates, tabular styling, and canonical `numeric-value` alignment.Optional numeric table cells follow the same split: unified-resource consumersown which count or replica field is meaningful, whether the domain shouldzero-default an absent scheduler/service/inventory count, whether adiff --git a/frontend-modern/scripts/shared-template-registry.json b/frontend-modern/scripts/shared-template-registry.jsonindex 776844f357..820ed3659d 100644--- a/frontend-modern/scripts/shared-template-registry.json+++ b/frontend-modern/scripts/shared-template-registry.json@@ -1388,6 +1388,37 @@"scripts/shared-template-audit.mjs"]},+ {+ "id": "platform-table-date-time-value",+ "category": "platform-table-text-value",+ "summary": "Platform tables must use the shared compact date-time value primitive for timestamp cells, tabular styling, and canonical empty-cell markers instead of recreating local compact toLocaleString helpers.",+ "canonical": {+ "path": "src/features/platformPage/sharedPlatformPage.tsx",+ "export": "PlatformTableDateTimeValue"+ },+ "requiredConsumers": [+ { "path": "src/features/truenas/TrueNASProtectionTable.tsx" },+ { "path": "src/features/vmware/VsphereActivityTable.tsx" }+ ],+ "forbiddenPatterns": [+ {+ "path": "src/features/truenas/TrueNASProtectionTable.tsx",+ "patterns": ["const formatPointTime", "formatPointTime(point)"]+ },+ {+ "path": "src/features/vmware/VsphereActivityTable.tsx",+ "patterns": [+ "const formatActivityDate",+ "formatActivityDate(activity.occurredAt || activity.observedAt)"+ ]+ }+ ],+ "proof": [+ "src/components/shared/SharedPrimitives.guardrails.test.ts",+ "src/features/platformPage/__tests__/sharedPlatformPage.test.ts",+ "scripts/shared-template-audit.mjs"+ ]+ },{"id": "platform-table-number-value-fallback","category": "platform-table-text-value",@@ -2322,6 +2353,50 @@"scripts/shared-template-audit.mjs"]},+ {+ "id": "platform-table-local-truenas-date-time-helper",+ "category": "platform-table-text-value",+ "summary": "TrueNAS protection tables must not recreate compact completed-time helpers for timestamp cells.",+ "canonical": {+ "path": "src/features/platformPage/sharedPlatformPage.tsx",+ "export": "PlatformTableDateTimeValue"+ },+ "scopes": ["src/features/truenas/TrueNASProtectionTable.tsx"],+ "extensions": [".tsx"],+ "allPatterns": ["const formatPointTime", "toLocaleString(undefined, {", "minute: '2-digit'"],+ "legacyReason": "Retired migration debt. Compact platform timestamp cells must compose PlatformTableDateTimeValue so date parsing, empty markers, and tabular styling stay shared.",+ "allowedPaths": [],+ "ignoredPaths": [],+ "proof": [+ "src/components/shared/SharedPrimitives.guardrails.test.ts",+ "src/features/platformPage/__tests__/sharedPlatformPage.test.ts",+ "scripts/shared-template-audit.mjs"+ ]+ },+ {+ "id": "platform-table-local-vsphere-activity-date-helper",+ "category": "platform-table-text-value",+ "summary": "vSphere activity tables must not recreate compact activity-date helpers for timestamp cells.",+ "canonical": {+ "path": "src/features/platformPage/sharedPlatformPage.tsx",+ "export": "PlatformTableDateTimeValue"+ },+ "scopes": ["src/features/vmware/VsphereActivityTable.tsx"],+ "extensions": [".tsx"],+ "allPatterns": [+ "const formatActivityDate",+ "toLocaleString(undefined, {",+ "minute: '2-digit'"+ ],+ "legacyReason": "Retired migration debt. Compact platform timestamp cells must compose PlatformTableDateTimeValue so date parsing, empty markers, minimum-year handling, and tabular styling stay shared.",+ "allowedPaths": [],+ "ignoredPaths": [],+ "proof": [+ "src/components/shared/SharedPrimitives.guardrails.test.ts",+ "src/features/platformPage/__tests__/sharedPlatformPage.test.ts",+ "scripts/shared-template-audit.mjs"+ ]+ },{"id": "platform-table-local-truenas-count-cell-class","category": "platform-table-text-value",diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.tsindex fd0f27e0d9..20489519e7 100644--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts@@ -3783,6 +3783,102 @@ describe('shared primitive guardrails', () => {);});+ it('keeps platform table date-time values on the shared primitive', () => {+ const registry = JSON.parse(sharedTemplateRegistrySource) as {+ rules?: Array<{+ id: string;+ canonical?: { path?: string; export?: string };+ requiredConsumers?: Array<{ path?: string }>;+ forbiddenPatterns?: Array<{ path?: string; patterns?: string[] }>;+ }>;+ patternGuards?: Array<{+ id: string;+ canonical?: { path?: string; export?: string };+ allPatterns?: string[];+ scopes?: string[];+ allowedPaths?: string[];+ ignoredPaths?: string[];+ }>;+ };+ const registeredRule = registry.rules?.find(+ (rule) => rule.id === 'platform-table-date-time-value',+ );+ const truenasDateGuard = registry.patternGuards?.find(+ (guard) => guard.id === 'platform-table-local-truenas-date-time-helper',+ );+ const vsphereDateGuard = registry.patternGuards?.find(+ (guard) => guard.id === 'platform-table-local-vsphere-activity-date-helper',+ );+ const platformDateTimeConsumers: Array<[string, string]> = [+ ['src/features/truenas/TrueNASProtectionTable.tsx', truenasProtectionTableSource],+ ['src/features/vmware/VsphereActivityTable.tsx', vsphereActivityTableSource],+ ];+ const platformDateTimeConsumerPaths = platformDateTimeConsumers.map(([path]) => path);++ expect(registeredRule?.canonical?.path).toBe(+ 'src/features/platformPage/sharedPlatformPage.tsx',+ );+ expect(registeredRule?.canonical?.export).toBe('PlatformTableDateTimeValue');+ expect(registeredRule?.requiredConsumers?.map((consumer) => consumer.path)).toEqual(+ platformDateTimeConsumerPaths,+ );+ expect(registeredRule?.forbiddenPatterns).toEqual([+ {+ path: 'src/features/truenas/TrueNASProtectionTable.tsx',+ patterns: ['const formatPointTime', 'formatPointTime(point)'],+ },+ {+ path: 'src/features/vmware/VsphereActivityTable.tsx',+ patterns: [+ 'const formatActivityDate',+ 'formatActivityDate(activity.occurredAt || activity.observedAt)',+ ],+ },+ ]);+ expect(truenasDateGuard?.canonical?.path).toBe(+ 'src/features/platformPage/sharedPlatformPage.tsx',+ );+ expect(truenasDateGuard?.canonical?.export).toBe('PlatformTableDateTimeValue');+ expect(truenasDateGuard?.allPatterns).toEqual([+ 'const formatPointTime',+ 'toLocaleString(undefined, {',+ "minute: '2-digit'",+ ]);+ expect(truenasDateGuard?.scopes).toEqual(['src/features/truenas/TrueNASProtectionTable.tsx']);+ expect(truenasDateGuard?.allowedPaths ?? []).toHaveLength(0);+ expect(truenasDateGuard?.ignoredPaths ?? []).toHaveLength(0);+ expect(vsphereDateGuard?.canonical?.path).toBe(+ 'src/features/platformPage/sharedPlatformPage.tsx',+ );+ expect(vsphereDateGuard?.canonical?.export).toBe('PlatformTableDateTimeValue');+ expect(vsphereDateGuard?.allPatterns).toEqual([+ 'const formatActivityDate',+ 'toLocaleString(undefined, {',+ "minute: '2-digit'",+ ]);+ expect(vsphereDateGuard?.scopes).toEqual(['src/features/vmware/VsphereActivityTable.tsx']);+ expect(vsphereDateGuard?.allowedPaths ?? []).toHaveLength(0);+ expect(vsphereDateGuard?.ignoredPaths ?? []).toHaveLength(0);++ expect(sharedPlatformPageSource).toContain('export function PlatformTableDateTimeValue');+ expect(sharedPlatformPageSource).toContain('formatPlatformTableDateTimeValue');+ expect(sharedPlatformPageSource).toContain('PLATFORM_TABLE_COMPACT_DATE_TIME_FORMAT');++ for (const [path, source] of platformDateTimeConsumers) {+ expect(source).toContain('PlatformTableDateTimeValue');+ const forbiddenPatterns =+ registeredRule?.forbiddenPatterns?.find((entry) => entry.path === path)?.patterns ?? [];+ for (const pattern of forbiddenPatterns) {+ expect(source).not.toContain(pattern);+ }+ }++ expect(vsphereActivityTableSource).toContain(+ "getPlatformTableHeadClassForKind('numeric-value')",+ );+ expect(vsphereActivityTableSource).toContain('minYear={2000}');+ });+it('keeps platform table number-value fallbacks on the shared primitive', () => {const registry = JSON.parse(sharedTemplateRegistrySource) as {rules?: Array<{diff --git a/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts b/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.tsindex 64ebad0126..e1ee064c8c 100644--- a/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts+++ b/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts@@ -3,7 +3,9 @@ import { afterEach, describe, expect, it } from 'vitest';import { createRoot, createSignal } from 'solid-js';import type { Resource } from '@/types/resource';import {+ PLATFORM_TABLE_COMPACT_DATE_TIME_FORMAT,PlatformTableCountRatioValue,+ PlatformTableDateTimeValue,PlatformTableMetricFallback,PlatformTableNumberValue,PlatformTablePercentValue,@@ -11,6 +13,7 @@ import {createPlatformTableFilterState,formatPlatformTableBytesValue,formatPlatformTableCountRatioValue,+ formatPlatformTableDateTimeValue,formatPlatformTableTitleCaseValue,formatPlatformTableUptimeValue,filterPlatformResources,@@ -307,6 +310,58 @@ describe('formatPlatformTableBytesValue', () => {});});+describe('formatPlatformTableDateTimeValue', () => {+ it('formats compact table timestamps with canonical empty markers', () => {+ const value = '2026-05-20T10:15:00Z';+ const dateTimeFormat = {+ ...PLATFORM_TABLE_COMPACT_DATE_TIME_FORMAT,+ timeZone: 'UTC',+ hour12: false,+ } satisfies Intl.DateTimeFormatOptions;++ expect(formatPlatformTableDateTimeValue(value, { dateTimeFormat })).toBe(+ new Date(value).toLocaleString(undefined, dateTimeFormat),+ );+ expect(formatPlatformTableDateTimeValue(' ', { emptyText: '-' })).toBe('-');+ expect(formatPlatformTableDateTimeValue('not-a-date', { emptyText: '-' })).toBe('-');+ expect(formatPlatformTableDateTimeValue(undefined)).toBe('—');+ });++ it('supports caller-owned minimum year cutoffs for placeholder platform dates', () => {+ expect(+ formatPlatformTableDateTimeValue('1970-01-01T00:00:00Z', {+ emptyText: '-',+ minYear: 2000,+ }),+ ).toBe('-');+ });+});++describe('PlatformTableDateTimeValue', () => {+ it('renders compact timestamps with shared tabular styling', () => {+ const value = '2026-05-20T10:15:00Z';+ const dateTimeFormat = {+ timeZone: 'UTC',+ hour12: false,+ } satisfies Intl.DateTimeFormatOptions;+ const { container } = render(() =>+ PlatformTableDateTimeValue({+ value,+ dateTimeFormat,+ }),+ );+ const marker = container.querySelector('span');++ expect(marker?.classList.contains('tabular-nums')).toBe(true);+ expect(marker?.textContent).toBe(+ new Date(value).toLocaleString(undefined, {+ ...PLATFORM_TABLE_COMPACT_DATE_TIME_FORMAT,+ ...dateTimeFormat,+ }),+ );+ });+});+describe('PlatformTableNumberValue', () => {it('renders finite numbers with shared tabular styling and empty markers', () => {const { container } = render(() => PlatformTableNumberValue({ value: 42 }));diff --git a/frontend-modern/src/features/platformPage/columnAlignment.ts b/frontend-modern/src/features/platformPage/columnAlignment.tsindex 248f4ac000..e4a05f93da 100644--- a/frontend-modern/src/features/platformPage/columnAlignment.ts+++ b/frontend-modern/src/features/platformPage/columnAlignment.ts@@ -30,7 +30,7 @@ import type { PlatformTableCellAlign } from './sharedPlatformPage';* Uptime, Temp, integer counts (VMs, CTs,* Containers, Pods, Pools, Datasets, Datastores,* Disks, Apps, Desired, Updated, Ready, Available),- * Net I/O, Disk I/O.+ * compact timestamps, Net I/O, Disk I/O.** - 'badge' A pill or icon-only cell with no scannable value.* Backup, Tags, Update.@@ -71,9 +71,10 @@ import type { PlatformTableCellAlign } from './sharedPlatformPage';* not interleave bars with other column kinds.* 4. Diagnostic ('numeric-value') — Temperature.* 5. Time ('numeric-value') — Uptime always sits between the bar- * block (plus Temp) and the inventory counts. It is monitoring- * state, not identity, so it does not belong near the front of- * the row.+ * block (plus Temp) and the inventory counts. Compact timestamps+ * such as Completed / When also use this kind when present. Time+ * is monitoring state, not identity, so it does not belong near+ * the front of the row.* 6. Inventory counts ('numeric-value') — Containers, VMs, CTs, Pods,* Pools, Datasets, Datastores, Disks, Apps, Desired / Updated /* Ready / Available, Capacity.diff --git a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsxindex 133299a0ed..6eb5971b04 100644--- a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx+++ b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx@@ -205,6 +205,67 @@ export const formatPlatformTableBytesValue = (return formatBytes(bytes);};+export const PLATFORM_TABLE_COMPACT_DATE_TIME_FORMAT: Intl.DateTimeFormatOptions = {+ month: 'short',+ day: 'numeric',+ hour: '2-digit',+ minute: '2-digit',+};++export type PlatformTableDateTimeValueInput = string | number | Date | null | undefined;++export type PlatformTableDateTimeValueOptions = {+ emptyText?: string;+ dateTimeFormat?: Intl.DateTimeFormatOptions;+ minYear?: number;+};++const resolvePlatformTableDateTime = (value: PlatformTableDateTimeValueInput): Date | undefined => {+ if (value == null) return undefined;+ if (value instanceof Date) return Number.isNaN(value.getTime()) ? undefined : value;++ const raw = typeof value === 'string' ? value.trim() : value;+ if (raw === '') return undefined;++ const parsed = new Date(raw);+ return Number.isNaN(parsed.getTime()) ? undefined : parsed;+};++export const formatPlatformTableDateTimeValue = (+ value: PlatformTableDateTimeValueInput,+ options: PlatformTableDateTimeValueOptions = {},+): string => {+ const emptyText = options.emptyText ?? '—';+ const parsed = resolvePlatformTableDateTime(value);+ if (!parsed) return emptyText;+ if (options.minYear !== undefined && parsed.getUTCFullYear() < options.minYear) {+ return emptyText;+ }+ return parsed.toLocaleString(undefined, {+ ...PLATFORM_TABLE_COMPACT_DATE_TIME_FORMAT,+ ...options.dateTimeFormat,+ });+};++export function PlatformTableDateTimeValue(props: {+ value: PlatformTableDateTimeValueInput;+ emptyText?: string;+ dateTimeFormat?: Intl.DateTimeFormatOptions;+ minYear?: number;+}) {+ const options = (): PlatformTableDateTimeValueOptions => {+ const resolved: PlatformTableDateTimeValueOptions = {};+ if (props.emptyText !== undefined) resolved.emptyText = props.emptyText;+ if (props.dateTimeFormat !== undefined) resolved.dateTimeFormat = props.dateTimeFormat;+ if (props.minYear !== undefined) resolved.minYear = props.minYear;+ return resolved;+ };++ return (+ <span class="tabular-nums">{formatPlatformTableDateTimeValue(props.value, options())}</span>+ );+}+export function PlatformTableNumberValue(props: {value: number | undefined;emptyText?: string;diff --git a/frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx b/frontend-modern/src/features/truenas/TrueNASProtectionTable.tsxindex 0a22da5694..fe7e865d71 100644--- a/frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx+++ b/frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx@@ -11,6 +11,7 @@ import { asTrimmedString } from '@/utils/stringUtils';import type { StatusIndicatorVariant } from '@/utils/status';import {PlatformErrorState,+ PlatformTableDateTimeValue,PlatformTableEmptyState,PlatformTableLoadingState,PlatformTableToolbar,@@ -160,19 +161,6 @@ const targetSecondaryLabel = (point: RecoveryPoint): string => {return [direction, state].filter(Boolean).join(' / ');};-const formatPointTime = (point: RecoveryPoint): string => {- const raw = asTrimmedString(point.completedAt) || asTrimmedString(point.startedAt);- if (!raw) return '-';- const parsed = new Date(raw);- if (Number.isNaN(parsed.getTime())) return '-';- return parsed.toLocaleString(undefined, {- month: 'short',- day: 'numeric',- hour: '2-digit',- minute: '2-digit',- });-};-const sizeLabel = (point: RecoveryPoint): string =>formatPlatformTableBytesValue(point.sizeBytes ?? undefined, '-');@@ -478,9 +466,15 @@ export const TrueNASProtectionTable: Component<{</Show></TableCell><TableCell- class={`${getPlatformTableCellClassForKind('numeric-value')} text-base-content tabular-nums`}+ class={`${getPlatformTableCellClassForKind('numeric-value')} text-base-content`}>- {formatPointTime(point)}+ <PlatformTableDateTimeValue+ value={+ asTrimmedString(point.completedAt) ||+ asTrimmedString(point.startedAt)+ }+ emptyText="-"+ /></TableCell><TableCellclass={`${getPlatformTableCellClassForKind('numeric-value')} hidden text-base-content lg:table-cell`}diff --git a/frontend-modern/src/features/vmware/VsphereActivityTable.tsx b/frontend-modern/src/features/vmware/VsphereActivityTable.tsxindex dd9730a584..40ec817b00 100644--- a/frontend-modern/src/features/vmware/VsphereActivityTable.tsx+++ b/frontend-modern/src/features/vmware/VsphereActivityTable.tsx@@ -12,6 +12,7 @@ import { StatusDot } from '@/components/shared/StatusDot';import { TableCell, TableHead, TableRow } from '@/components/shared/Table';import { filterChipStatusDot } from '@/components/shared/FilterBar';import {+ PlatformTableDateTimeValue,PlatformTableEmptyState,PlatformTableToolbar,createPlatformTableFilterState,@@ -113,19 +114,6 @@ const formatIdentifierLabel = (value: string): string =>const formatActivityState = (row: VmwareActivityRow): string =>row.state.trim() ? formatIdentifierLabel(row.state) : '-';-const formatActivityDate = (value: string | undefined): string => {- if (!value) return '-';- const parsed = new Date(value);- if (Number.isNaN(parsed.getTime())) return '-';- if (parsed.getUTCFullYear() < 2000) return '-';- return parsed.toLocaleString(undefined, {- month: 'short',- day: 'numeric',- hour: '2-digit',- minute: '2-digit',- });-};-const detailDateTime = (value?: string): string => {if (!value) return '-';const parsed = new Date(value);@@ -283,7 +271,7 @@ export const VsphereActivityTable: Component<{vCenter</TableHead><TableHead- class={`${getPlatformTableHeadClassForKind('text')} hidden xl:table-cell md:w-[8%]`}+ class={`${getPlatformTableHeadClassForKind('numeric-value')} hidden xl:table-cell md:w-[8%]`}>When</TableHead>@@ -375,9 +363,13 @@ export const VsphereActivityTable: Component<{</span></TableCell><TableCell- class={`${getPlatformTableCellClassForKind('text')} hidden text-base-content xl:table-cell`}+ class={`${getPlatformTableCellClassForKind('numeric-value')} hidden text-base-content xl:table-cell`}>- {formatActivityDate(activity.occurredAt || activity.observedAt)}+ <PlatformTableDateTimeValue+ value={activity.occurredAt || activity.observedAt}+ emptyText="-"+ minYear={2000}+ /></TableCell></TableRow><Show when={isExpanded()}>