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.

Converge platform relative timestamps

rcourtman12b896bd7a4a
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 32947afe29..c9a267fc3b 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -2625,6 +2625,14 @@ 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.
+Relative timestamp-age cells follow the same rule.
+`PlatformTableRelativeTimeValue` and `formatPlatformTableRelativeTimeValue` own
+the repeated `formatRelativeTime` composition, compact-label default,
+invalid/empty markers, and tabular-number styling for dense platform table
+cells. Docker / Podman volume created-at cells, Kubernetes deployment age
+cells, Kubernetes event observed-time cells, and Proxmox replication last-sync
+cells must compose that primitive instead of importing `formatRelativeTime`
+directly in table files.
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 dense
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 53a5bf9724..bf3d172ea5 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -258,6 +258,12 @@ 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.
+Relative timestamp-age cells keep the same split: unified-resource consumers
+own whether created, observed, or sync time is the meaningful source-specific
+field, while dense platform table rendering must use
+`PlatformTableRelativeTimeValue` / `formatPlatformTableRelativeTimeValue` for
+relative labels, compact defaults, invalid/empty markers, and tabular styling
+instead of importing `formatRelativeTime` in table files.
Optional numeric table cells follow the same split: unified-resource consumers
own which count or replica field is meaningful, whether the domain should
zero-default an absent scheduler/service/inventory count, whether a
diff --git a/frontend-modern/scripts/shared-template-registry.json b/frontend-modern/scripts/shared-template-registry.json
index 365a41ec88..6ee48bb652 100644
--- a/frontend-modern/scripts/shared-template-registry.json
+++ b/frontend-modern/scripts/shared-template-registry.json
@@ -1433,6 +1433,49 @@
"scripts/shared-template-audit.mjs"
]
},
+ {
+ "id": "platform-table-relative-time-value",
+ "category": "platform-table-text-value",
+ "summary": "Platform tables must use the shared relative-time value primitive for dense timestamp-age cells, tabular styling, compact labels, and canonical empty-cell markers instead of calling formatRelativeTime directly.",
+ "canonical": {
+ "path": "src/features/platformPage/sharedPlatformPage.tsx",
+ "export": "PlatformTableRelativeTimeValue"
+ },
+ "requiredConsumers": [
+ { "path": "src/features/docker/DockerVolumesTable.tsx" },
+ { "path": "src/features/kubernetes/KubernetesDeploymentsTable.tsx" },
+ { "path": "src/features/kubernetes/KubernetesEventsTable.tsx" },
+ { "path": "src/features/proxmox/ProxmoxReplicationTable.tsx" }
+ ],
+ "forbiddenPatterns": [
+ {
+ "path": "src/features/docker/DockerVolumesTable.tsx",
+ "patterns": ["formatRelativeTime(parsed)"]
+ },
+ {
+ "path": "src/features/kubernetes/KubernetesDeploymentsTable.tsx",
+ "patterns": ["formatRelativeTime(createdAt, { compact: true, emptyText: '—' })"]
+ },
+ {
+ "path": "src/features/kubernetes/KubernetesEventsTable.tsx",
+ "patterns": [
+ "formatRelativeTime(observedTimestamp(resource), { compact: true, emptyText: '—' })"
+ ]
+ },
+ {
+ "path": "src/features/proxmox/ProxmoxReplicationTable.tsx",
+ "patterns": [
+ "formatRelativeTime(job.lastSyncUnix * 1000, { compact: true })",
+ "formatRelativeTime(job.lastSyncTime, { compact: true })"
+ ]
+ }
+ ],
+ "proof": [
+ "src/components/shared/SharedPrimitives.guardrails.test.ts",
+ "src/features/platformPage/__tests__/sharedPlatformPage.test.ts",
+ "scripts/shared-template-audit.mjs"
+ ]
+ },
{
"id": "platform-table-integer-value-format",
"category": "platform-table-text-value",
@@ -2555,6 +2598,31 @@
"scripts/shared-template-audit.mjs"
]
},
+ {
+ "id": "platform-table-local-relative-time-helper",
+ "category": "platform-table-text-value",
+ "summary": "Platform tables must not call formatRelativeTime directly for dense timestamp-age cells.",
+ "canonical": {
+ "path": "src/features/platformPage/sharedPlatformPage.tsx",
+ "export": "PlatformTableRelativeTimeValue"
+ },
+ "scopes": [
+ "src/features/docker/DockerVolumesTable.tsx",
+ "src/features/kubernetes/KubernetesDeploymentsTable.tsx",
+ "src/features/kubernetes/KubernetesEventsTable.tsx",
+ "src/features/proxmox/ProxmoxReplicationTable.tsx"
+ ],
+ "extensions": [".tsx"],
+ "allPatterns": ["formatRelativeTime("],
+ "legacyReason": "Retired migration debt. Platform table relative timestamp cells must compose PlatformTableRelativeTimeValue so compact labels, 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-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.ts
index 22ab4c4515..c7267c98d2 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -152,6 +152,7 @@ import workloadSelectionStateSource from '@/components/Workloads/useWorkloadSele
import dockerContainersTableSource from '@/features/docker/DockerContainersTable.tsx?raw';
import dockerHostsTableSource from '@/features/docker/DockerHostsTable.tsx?raw';
import dockerNativeTableSharedSource from '@/features/docker/DockerNativeTableShared.tsx?raw';
+import dockerVolumesTableSource from '@/features/docker/DockerVolumesTable.tsx?raw';
import kubernetesAutoscalingTableSource from '@/features/kubernetes/KubernetesAutoscalingTable.tsx?raw';
import kubernetesClustersTableSource from '@/features/kubernetes/KubernetesClustersTable.tsx?raw';
import kubernetesConfigTableSource from '@/features/kubernetes/KubernetesConfigTable.tsx?raw';
@@ -3924,6 +3925,91 @@ describe('shared primitive guardrails', () => {
expect(vsphereActivityTableSource).toContain('minYear={2000}');
});
+ it('keeps platform table relative timestamps 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-relative-time-value',
+ );
+ const localHelperGuard = registry.patternGuards?.find(
+ (guard) => guard.id === 'platform-table-local-relative-time-helper',
+ );
+ const platformRelativeTimeConsumers: Array<[string, string]> = [
+ ['src/features/docker/DockerVolumesTable.tsx', dockerVolumesTableSource],
+ ['src/features/kubernetes/KubernetesDeploymentsTable.tsx', kubernetesDeploymentsTableSource],
+ ['src/features/kubernetes/KubernetesEventsTable.tsx', kubernetesEventsTableSource],
+ ['src/features/proxmox/ProxmoxReplicationTable.tsx', proxmoxReplicationTableSource],
+ ];
+ const platformRelativeTimeConsumerPaths = platformRelativeTimeConsumers.map(([path]) => path);
+
+ expect(registeredRule?.canonical?.path).toBe(
+ 'src/features/platformPage/sharedPlatformPage.tsx',
+ );
+ expect(registeredRule?.canonical?.export).toBe('PlatformTableRelativeTimeValue');
+ expect(registeredRule?.requiredConsumers?.map((consumer) => consumer.path)).toEqual(
+ platformRelativeTimeConsumerPaths,
+ );
+ expect(registeredRule?.forbiddenPatterns).toEqual([
+ {
+ path: 'src/features/docker/DockerVolumesTable.tsx',
+ patterns: ['formatRelativeTime(parsed)'],
+ },
+ {
+ path: 'src/features/kubernetes/KubernetesDeploymentsTable.tsx',
+ patterns: ["formatRelativeTime(createdAt, { compact: true, emptyText: '—' })"],
+ },
+ {
+ path: 'src/features/kubernetes/KubernetesEventsTable.tsx',
+ patterns: [
+ "formatRelativeTime(observedTimestamp(resource), { compact: true, emptyText: '—' })",
+ ],
+ },
+ {
+ path: 'src/features/proxmox/ProxmoxReplicationTable.tsx',
+ patterns: [
+ 'formatRelativeTime(job.lastSyncUnix * 1000, { compact: true })',
+ 'formatRelativeTime(job.lastSyncTime, { compact: true })',
+ ],
+ },
+ ]);
+ expect(localHelperGuard?.canonical?.path).toBe(
+ 'src/features/platformPage/sharedPlatformPage.tsx',
+ );
+ expect(localHelperGuard?.canonical?.export).toBe('PlatformTableRelativeTimeValue');
+ expect(localHelperGuard?.allPatterns).toEqual(['formatRelativeTime(']);
+ expect(localHelperGuard?.scopes).toEqual(platformRelativeTimeConsumerPaths);
+ expect(localHelperGuard?.allowedPaths ?? []).toHaveLength(0);
+ expect(localHelperGuard?.ignoredPaths ?? []).toHaveLength(0);
+
+ expect(sharedPlatformPageSource).toContain('export function PlatformTableRelativeTimeValue');
+ expect(sharedPlatformPageSource).toContain('formatPlatformTableRelativeTimeValue');
+ expect(sharedPlatformPageSource).toContain('formatRelativeTime(value');
+
+ for (const [path, source] of platformRelativeTimeConsumers) {
+ expect(source).toContain('PlatformTableRelativeTimeValue');
+ expect(source).not.toContain('formatRelativeTime(');
+ const forbiddenPatterns =
+ registeredRule?.forbiddenPatterns?.find((entry) => entry.path === path)?.patterns ?? [];
+ for (const pattern of forbiddenPatterns) {
+ expect(source).not.toContain(pattern);
+ }
+ }
+ });
+
it('keeps platform table integer count formatting on the shared helper', () => {
const registry = JSON.parse(sharedTemplateRegistrySource) as {
rules?: Array<{
diff --git a/frontend-modern/src/features/docker/DockerVolumesTable.tsx b/frontend-modern/src/features/docker/DockerVolumesTable.tsx
index bffb0b1016..c4e7b68f39 100644
--- a/frontend-modern/src/features/docker/DockerVolumesTable.tsx
+++ b/frontend-modern/src/features/docker/DockerVolumesTable.tsx
@@ -3,8 +3,10 @@ import { TableCell, TableHead, TableRow } from '@/components/shared/Table';
import {
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformTableEmptyState,
+ PlatformTableRelativeTimeValue,
PlatformTableToolbar,
createPlatformTableFilterState,
+ formatPlatformTableDateTimeValue,
getPlatformTableCellClassForKind,
getPlatformTableHeadClassForKind,
PlatformTableShell,
@@ -25,23 +27,6 @@ import {
type DockerNativeTableProps,
} from './DockerNativeTableShared';
import { filterDockerResources, type DockerResourceStatusFilter } from './dockerPageModel';
-import { formatRelativeTime } from '@/utils/format';
-
-const parseCreatedAt = (value: string | undefined): number | null => {
- if (!value) return null;
- const parsed = Date.parse(value);
- return Number.isFinite(parsed) ? parsed : null;
-};
-
-const createdRelative = (value: string | undefined): string => {
- const parsed = parseCreatedAt(value);
- return parsed === null ? dockerTextValue(value) : formatRelativeTime(parsed);
-};
-
-const createdAbsolute = (value: string | undefined): string => {
- const parsed = parseCreatedAt(value);
- return parsed === null ? dockerTextValue(value) : new Date(parsed).toLocaleString();
-};
export const DockerVolumesTable: Component<DockerNativeTableProps> = (props) => {
const tableState = createPlatformTableFilterState({
@@ -183,9 +168,12 @@ export const DockerVolumesTable: Component<DockerNativeTableProps> = (props) =>
>
<span
class="inline-block max-w-[12rem] truncate"
- title={createdAbsolute(resource.docker?.createdAt)}
+ title={formatPlatformTableDateTimeValue(resource.docker?.createdAt)}
>
- {createdRelative(resource.docker?.createdAt)}
+ <PlatformTableRelativeTimeValue
+ value={resource.docker?.createdAt}
+ compact={false}
+ />
</span>
</TableCell>
<TableCell
diff --git a/frontend-modern/src/features/kubernetes/KubernetesDeploymentsTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesDeploymentsTable.tsx
index 16199172ae..e733c97a49 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesDeploymentsTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesDeploymentsTable.tsx
@@ -2,10 +2,10 @@ import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { TableCell, TableHead, TableRow } from '@/components/shared/Table';
import { asTrimmedString } from '@/utils/stringUtils';
-import { formatRelativeTime } from '@/utils/format';
import {
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformTableNumberValue,
+ PlatformTableRelativeTimeValue,
PlatformTableToolbar,
PlatformTableEmptyState,
createPlatformTableFilterState,
@@ -40,9 +40,6 @@ import {
// observedGeneration is deliberately not a column: without the spec
// generation beside it the raw number is unactionable.
-const formatAge = (createdAt: string | undefined): string =>
- formatRelativeTime(createdAt, { compact: true, emptyText: '—' }) || '—';
-
export const KubernetesDeploymentsTable: Component<{
resources: Resource[];
emptyIcon: JSX.Element;
@@ -153,11 +150,9 @@ export const KubernetesDeploymentsTable: Component<{
<For each={sortedRows()}>
{(deployment) => {
const name = () => asTrimmedString(deployment.name) || deployment.id;
- const ns = () =>
- formatPlatformTableTextValue(deployment.kubernetes?.namespace);
+ const ns = () => formatPlatformTableTextValue(deployment.kubernetes?.namespace);
const cluster = () => kubernetesClusterLabel(deployment) || '—';
const indicator = () => mapKubernetesDeploymentStatus(deployment);
- const age = () => formatAge(deployment.kubernetes?.createdAt);
const detailRowId = () => drawer.detailRowId(deployment);
const isExpanded = () => drawer.isExpanded(deployment);
return (
@@ -231,11 +226,10 @@ export const KubernetesDeploymentsTable: Component<{
<TableCell
class={`${getPlatformTableCellClassForKind('numeric-value')} text-base-content`}
>
- <span
- class="tabular-nums"
- title={deployment.kubernetes?.createdAt || ''}
- >
- {age()}
+ <span title={deployment.kubernetes?.createdAt || ''}>
+ <PlatformTableRelativeTimeValue
+ value={deployment.kubernetes?.createdAt}
+ />
</span>
</TableCell>
</TableRow>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesEventsTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesEventsTable.tsx
index 33701dbcba..ae4dd0e43b 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesEventsTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesEventsTable.tsx
@@ -2,11 +2,11 @@ import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { TableCell, TableHead, TableRow } from '@/components/shared/Table';
import { asTrimmedString } from '@/utils/stringUtils';
-import { formatRelativeTime } from '@/utils/format';
import {
PLATFORM_HEALTH_FILTER_OPTIONS,
PlatformTableEmptyState,
PlatformTableNumberValue,
+ PlatformTableRelativeTimeValue,
PlatformTableToolbar,
createPlatformTableFilterState,
formatPlatformTableTextValue,
@@ -47,10 +47,6 @@ const observedTimestamp = (resource: Resource): string =>
resource.kubernetes?.createdAt,
) || '';
-// Humanized for the cell ("2h ago"); the raw timestamp stays on the title.
-const observedTime = (resource: Resource): string =>
- formatRelativeTime(observedTimestamp(resource), { compact: true, emptyText: '—' }) || '—';
-
export const KubernetesEventsTable: Component<{
resources: Resource[];
emptyIcon: JSX.Element;
@@ -147,7 +143,7 @@ export const KubernetesEventsTable: Component<{
mapKubernetesEventSeverity(resource.kubernetes?.eventType);
const name = () => eventName(resource);
const scope = () => kubernetesScopeLabel(resource);
- const observed = () => observedTime(resource);
+ const observed = () => observedTimestamp(resource);
const message = () =>
formatPlatformTableTextValue(resource.kubernetes?.message);
const detailRowId = () => drawer.detailRowId(resource);
@@ -225,9 +221,9 @@ export const KubernetesEventsTable: Component<{
>
<span
class="inline-block max-w-[12rem] truncate"
- title={observedTimestamp(resource) || observed()}
+ title={observed() || '—'}
>
- {observed()}
+ <PlatformTableRelativeTimeValue value={observed()} />
</span>
</TableCell>
<TableCell
diff --git a/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts b/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts
index 33b4e09458..44ee1d85c2 100644
--- a/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts
+++ b/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts
@@ -9,6 +9,7 @@ import {
PlatformTableMetricFallback,
PlatformTableNumberValue,
PlatformTablePercentValue,
+ PlatformTableRelativeTimeValue,
PlatformTableTemperatureValue,
createPlatformTableFilterState,
formatPlatformTableBytesValue,
@@ -16,6 +17,7 @@ import {
formatPlatformTableDateTimeValue,
formatPlatformTableIntegerValue,
formatPlatformTablePercentValue,
+ formatPlatformTableRelativeTimeValue,
formatPlatformTableTitleCaseValue,
formatPlatformTableUptimeValue,
filterPlatformResources,
@@ -364,6 +366,31 @@ describe('PlatformTableDateTimeValue', () => {
});
});
+describe('formatPlatformTableRelativeTimeValue', () => {
+ it('formats relative timestamps with canonical table empty markers', () => {
+ const fiveMinutesAgo = Date.now() - 5 * 60 * 1000;
+
+ expect(formatPlatformTableRelativeTimeValue(fiveMinutesAgo)).toBe('5m ago');
+ expect(formatPlatformTableRelativeTimeValue(fiveMinutesAgo, { compact: false })).toBe(
+ '5 mins ago',
+ );
+ expect(formatPlatformTableRelativeTimeValue(undefined)).toBe('—');
+ expect(formatPlatformTableRelativeTimeValue('', { emptyText: '-' })).toBe('-');
+ expect(formatPlatformTableRelativeTimeValue('not-a-date', { emptyText: '-' })).toBe('-');
+ });
+});
+
+describe('PlatformTableRelativeTimeValue', () => {
+ it('renders relative timestamps with shared tabular styling', () => {
+ const fiveMinutesAgo = Date.now() - 5 * 60 * 1000;
+ const { container } = render(() => PlatformTableRelativeTimeValue({ value: fiveMinutesAgo }));
+ const marker = container.querySelector('span');
+
+ expect(marker?.classList.contains('tabular-nums')).toBe(true);
+ expect(marker?.textContent).toBe('5m ago');
+ });
+});
+
describe('formatPlatformTableIntegerValue', () => {
it('formats rounded integer labels with canonical empty markers', () => {
const expected = new Intl.NumberFormat(undefined, { maximumFractionDigits: 0 }).format(1235);
diff --git a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
index 191b205ac0..3d5a748574 100644
--- a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
+++ b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
@@ -12,7 +12,7 @@ import { TableCardHeader } from '@/components/shared/TableCardHeader';
import { useBreakpoint } from '@/hooks/useBreakpoint';
import { UnifiedResourceTable } from '@/components/Infrastructure/UnifiedResourceTable';
import type { Resource } from '@/types/resource';
-import { formatBytes, formatUptime } from '@/utils/format';
+import { formatBytes, formatRelativeTime, formatUptime } from '@/utils/format';
import { asTrimmedString } from '@/utils/stringUtils';
import { formatVmwareClusterServices } from '@/utils/vmwareDisplay';
import { getPlatformColumnAlign, type PlatformTableColumnKind } from './columnAlignment';
@@ -266,6 +266,44 @@ export function PlatformTableDateTimeValue(props: {
);
}
+export type PlatformTableRelativeTimeValueInput = number | string | Date | null | undefined;
+
+export type PlatformTableRelativeTimeValueOptions = {
+ compact?: boolean;
+ emptyText?: string;
+};
+
+export const formatPlatformTableRelativeTimeValue = (
+ value: PlatformTableRelativeTimeValueInput,
+ options: PlatformTableRelativeTimeValueOptions = {},
+): string => {
+ const emptyText = options.emptyText ?? '—';
+ if (value == null || value === '') return emptyText;
+ return (
+ formatRelativeTime(value, {
+ compact: options.compact ?? true,
+ emptyText,
+ }) || emptyText
+ );
+};
+
+export function PlatformTableRelativeTimeValue(props: {
+ value: PlatformTableRelativeTimeValueInput;
+ compact?: boolean;
+ emptyText?: string;
+}) {
+ const options = (): PlatformTableRelativeTimeValueOptions => {
+ const resolved: PlatformTableRelativeTimeValueOptions = {};
+ if (props.compact !== undefined) resolved.compact = props.compact;
+ if (props.emptyText !== undefined) resolved.emptyText = props.emptyText;
+ return resolved;
+ };
+
+ return (
+ <span class="tabular-nums">{formatPlatformTableRelativeTimeValue(props.value, options())}</span>
+ );
+}
+
const platformTableIntegerFormatter = new Intl.NumberFormat(undefined, {
maximumFractionDigits: 0,
});
diff --git a/frontend-modern/src/features/proxmox/ProxmoxReplicationTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxReplicationTable.tsx
index bd3420e659..d2b5a3063f 100644
--- a/frontend-modern/src/features/proxmox/ProxmoxReplicationTable.tsx
+++ b/frontend-modern/src/features/proxmox/ProxmoxReplicationTable.tsx
@@ -5,10 +5,10 @@ import { StatusDot } from '@/components/shared/StatusDot';
import type { StatusIndicatorVariant } from '@/utils/status';
import { TableCell, TableHead, TableRow } from '@/components/shared/Table';
import { apiFetch } from '@/utils/apiClient';
-import { formatRelativeTime } from '@/utils/format';
import {
PlatformTableToolbar,
PlatformErrorState,
+ PlatformTableRelativeTimeValue,
getPlatformTableCellClassForKind,
getPlatformTableHeadClassForKind,
type PlatformTableFilterOption,
@@ -94,12 +94,11 @@ function formatGuestLabel(job: ReplicationJob): string {
return '—';
}
-function formatSyncTime(job: ReplicationJob): string {
+function syncTimeValue(job: ReplicationJob): number | string | undefined {
if (job.lastSyncUnix && job.lastSyncUnix > 0) {
- return formatRelativeTime(job.lastSyncUnix * 1000, { compact: true });
+ return job.lastSyncUnix * 1000;
}
- if (job.lastSyncTime) return formatRelativeTime(job.lastSyncTime, { compact: true });
- return '—';
+ return job.lastSyncTime;
}
type NextSyncTone = 'overdue' | 'imminent' | 'normal' | 'muted';
@@ -325,7 +324,7 @@ export const ProxmoxReplicationTable: Component<{
<TableCell
class={`${getPlatformTableCellClassForKind('numeric-value')} text-base-content`}
>
- {formatSyncTime(job)}
+ <PlatformTableRelativeTimeValue value={syncTimeValue(job)} />
</TableCell>
<TableCell
class={`${getPlatformTableCellClassForKind('numeric-value')} text-base-content`}