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.

refactor(recovery): surface secondary item identity

rcourtman259ad4b5785f
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 5054b8c4b7..431067fdea 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -271,6 +271,12 @@ have a VMID/CTID in the subject ref but still carry a richer backup comment or
notes label, the canonical recovery index and store backfill must promote that
human-readable label into the persisted subject/item label instead of leaving
protected inventory rows to lead with bare numeric IDs.
+That same operator-facing row-identity rule should still preserve the governed
+entity identifier as secondary context when it exists. Recovery inventory and
+event rows should lead with the canonical item name, then show a muted
+secondary `VMID`/`CTID`/`ID` line when `display.entityIdLabel` is available, so
+operators can disambiguate familiar names without turning the primary scan path
+back into raw numeric identifiers.
That same shared presentation layer also owns the distinction between
aggregate recovery-method language and single-record recovery-method language.
Timeline legends and daily breakdowns must use aggregate labels such as
diff --git a/frontend-modern/src/components/Recovery/RecoveryHistoryTable.tsx b/frontend-modern/src/components/Recovery/RecoveryHistoryTable.tsx
index e4d54b4338..9619593d10 100644
--- a/frontend-modern/src/components/Recovery/RecoveryHistoryTable.tsx
+++ b/frontend-modern/src/components/Recovery/RecoveryHistoryTable.tsx
@@ -28,6 +28,7 @@ import {
import {
getRecoveryPointDetailsSummary,
getRecoveryPointItemLabel,
+ getRecoveryPointItemSecondaryLabel,
getRecoveryPointModeLabel,
getRecoveryPointRepositoryLabel,
getRecoveryPointTimestampMs,
@@ -162,6 +163,7 @@ export const RecoveryHistoryTable: Component<RecoveryHistoryTableProps> = (props
{(point) => {
const resourceIndex = props.resourcesById();
const item = getRecoveryPointItemLabel(point, resourceIndex);
+ const itemSecondary = getRecoveryPointItemSecondaryLabel(point);
const tsMs = getRecoveryPointTimestampMs(point);
const timeOnly =
point.completedAt && Number.isFinite(tsMs)
@@ -241,17 +243,24 @@ export const RecoveryHistoryTable: Component<RecoveryHistoryTableProps> = (props
class="max-w-[420px] whitespace-nowrap px-3 py-1 text-base-content"
title={item}
>
- <div class="flex min-w-0 max-w-full items-center gap-2">
- <StatusDot
- variant={outcomeVariant}
- size="xs"
- pulse={outcome === 'running'}
- title={getRecoveryOutcomeLabel(outcome)}
- ariaLabel={getRecoveryOutcomeLabel(outcome)}
- />
- <span class="min-w-0 flex-1 truncate text-[12px] font-medium">
- {item}
- </span>
+ <div class="flex min-w-0 max-w-full flex-col gap-0.5">
+ <div class="flex min-w-0 max-w-full items-center gap-2">
+ <StatusDot
+ variant={outcomeVariant}
+ size="xs"
+ pulse={outcome === 'running'}
+ title={getRecoveryOutcomeLabel(outcome)}
+ ariaLabel={getRecoveryOutcomeLabel(outcome)}
+ />
+ <span class="min-w-0 flex-1 truncate text-[12px] font-medium">
+ {item}
+ </span>
+ </div>
+ <Show when={itemSecondary}>
+ <span class="pl-4 text-[10px] font-mono tabular-nums text-muted">
+ {itemSecondary}
+ </span>
+ </Show>
</div>
</TableCell>
);
diff --git a/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx b/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
index 77146d8fbc..dc1707bbe4 100644
--- a/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
+++ b/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
@@ -42,7 +42,10 @@ import {
normalizeRecoveryOutcome,
} from '@/utils/recoveryOutcomePresentation';
import { getRecoveryRollupPlatforms } from '@/utils/recoveryPlatformModel';
-import { getRecoveryRollupItemLabel } from '@/utils/recoveryRecordPresentation';
+import {
+ getRecoveryRollupItemLabel,
+ getRecoveryRollupItemSecondaryLabel,
+} from '@/utils/recoveryRecordPresentation';
import { getSourcePlatformLabel, normalizeSourcePlatformQueryValue } from '@/utils/sourcePlatforms';
import { titleCaseDelimitedLabel } from '@/utils/textPresentation';
@@ -397,6 +400,7 @@ export const RecoveryProtectedInventorySection: Component<
{(rollup) => {
const resourceIndex = props.resourcesById();
const label = getRecoveryRollupItemLabel(rollup, resourceIndex);
+ const secondaryLabel = getRecoveryRollupItemSecondaryLabel(rollup);
const attemptMs = rollup.lastAttemptAt ? Date.parse(rollup.lastAttemptAt) : 0;
const successMs = rollup.lastSuccessAt ? Date.parse(rollup.lastSuccessAt) : 0;
const outcome = normalizeRecoveryOutcome(rollup.lastOutcome);
@@ -457,6 +461,11 @@ export const RecoveryProtectedInventorySection: Component<
</span>
</Show>
</div>
+ <Show when={secondaryLabel}>
+ <div class="pl-4 text-[10px] font-mono tabular-nums text-muted">
+ {secondaryLabel}
+ </div>
+ </Show>
<div class="flex flex-wrap items-center gap-1.5 text-[10px] md:hidden">
<Show when={itemTypePresentation?.label}>
<span class={itemTypePresentation?.badgeClasses || 'inline-flex items-center rounded px-2 py-0.5 text-[10px] font-medium whitespace-nowrap bg-surface-alt text-base-content'}>
diff --git a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
index 867002e73d..177d7f5a3f 100644
--- a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
+++ b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
@@ -24,7 +24,7 @@ const rollupsPayload = [
{
rollupId: 'res:vm-123',
itemResourceId: 'vm-123',
- display: { subjectType: 'proxmox-vm', itemType: 'vm' },
+ display: { subjectType: 'proxmox-vm', itemType: 'vm', entityIdLabel: '123' },
lastAttemptAt: '2026-02-14T10:00:00.000Z',
lastSuccessAt: '2026-02-14T10:00:00.000Z',
lastOutcome: 'success',
@@ -64,6 +64,7 @@ const pointsByRollupId: Record<string, any[]> = {
clusterLabel: 'Lab Cluster',
nodeHostLabel: 'pve-01',
namespaceLabel: 'Finance',
+ entityIdLabel: '123',
},
},
],
@@ -263,6 +264,7 @@ describe('Recovery', () => {
expect(within(vmRow!).getByLabelText('Healthy')).toBeInTheDocument();
expect(within(vmRow!).getAllByText('PVE').length).toBeGreaterThan(0);
expect(within(vmRow!).getAllByText('VM').length).toBeGreaterThan(0);
+ expect(within(vmRow!).getByText('VMID 123')).toBeInTheDocument();
expect(screen.queryByText('Backups By Date')).not.toBeInTheDocument();
expect(screen.queryByText('Recovery Activity')).not.toBeInTheDocument();
@@ -336,6 +338,7 @@ describe('Recovery', () => {
const historyRow = within(historyTable).getByLabelText('Healthy').closest('tr');
expect(historyRow).not.toBeNull();
expect(within(historyRow!).getByLabelText('Healthy')).toBeInTheDocument();
+ expect(within(historyRow!).getByText('VMID 123')).toBeInTheDocument();
expect(activityHeading).toBeInTheDocument();
});
diff --git a/frontend-modern/src/utils/__tests__/recoveryRecordPresentation.test.ts b/frontend-modern/src/utils/__tests__/recoveryRecordPresentation.test.ts
index 04c4f3aa58..3f1026c656 100644
--- a/frontend-modern/src/utils/__tests__/recoveryRecordPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/recoveryRecordPresentation.test.ts
@@ -3,6 +3,7 @@ import type { ProtectionRollup, RecoveryPoint } from '@/types/recovery';
import type { Resource } from '@/types/resource';
import {
getRecoveryPointItemLabel,
+ getRecoveryPointItemSecondaryLabel,
getRecoveryPointDetailsSummary,
getRecoveryPointKindLabel,
getRecoveryPointModeLabel,
@@ -10,6 +11,7 @@ import {
getRecoveryPointRepositoryLabel,
getRecoveryPointTimestampMs,
getRecoveryRollupItemLabel,
+ getRecoveryRollupItemSecondaryLabel,
normalizeRecoveryModeQueryValue,
} from '@/utils/recoveryRecordPresentation';
@@ -82,6 +84,20 @@ describe('recoveryRecordPresentation', () => {
expect(getRecoveryPointItemLabel(linkedPoint, resources)).toBe('Payments API');
});
+ it('derives secondary entity-id labels without replacing the primary name', () => {
+ const rollup = {
+ rollupId: 'rollup-2',
+ display: { itemLabel: 'Archive VM', itemType: 'vm', entityIdLabel: '101' },
+ } as ProtectionRollup;
+ const point = {
+ id: 'point-4',
+ display: { itemLabel: 'debian-go', itemType: 'system-container', entityIdLabel: '112' },
+ } as RecoveryPoint;
+
+ expect(getRecoveryRollupItemSecondaryLabel(rollup)).toBe('VMID 101');
+ expect(getRecoveryPointItemSecondaryLabel(point)).toBe('CTID 112');
+ });
+
it('derives timestamps and normalizes mode query values', () => {
const point = {
completedAt: '2026-03-09T12:00:00.000Z',
diff --git a/frontend-modern/src/utils/recoveryRecordPresentation.ts b/frontend-modern/src/utils/recoveryRecordPresentation.ts
index 7b0766884f..1c33a4c041 100644
--- a/frontend-modern/src/utils/recoveryRecordPresentation.ts
+++ b/frontend-modern/src/utils/recoveryRecordPresentation.ts
@@ -37,6 +37,36 @@ export function getRecoveryRollupItemLabel(
return rollup.rollupId;
}
+const getRecoveryEntityIdPrefix = (value: string | null | undefined): string => {
+ const normalized = String(value || '').trim().toLowerCase();
+ if (!normalized) return 'ID';
+ if (normalized.includes('vm')) return 'VMID';
+ if (normalized.includes('lxc') || normalized.includes('container')) return 'CTID';
+ return 'ID';
+};
+
+const getRecoveryItemSecondaryLabel = (
+ itemLabel: string,
+ itemType: string | null | undefined,
+ entityIdLabel: string | null | undefined,
+): string => {
+ const raw = String(entityIdLabel || '').trim();
+ if (!raw) return '';
+ if (raw.toLowerCase() === itemLabel.trim().toLowerCase()) return '';
+ if (/^\d+$/.test(raw)) {
+ return `${getRecoveryEntityIdPrefix(itemType)} ${raw}`;
+ }
+ return raw;
+};
+
+export function getRecoveryRollupItemSecondaryLabel(rollup: ProtectionRollup): string {
+ return getRecoveryItemSecondaryLabel(
+ String(rollup.display?.itemLabel || '').trim(),
+ String(rollup.display?.itemType || rollup.itemRef?.type || rollup.subjectRef?.type || ''),
+ rollup.display?.entityIdLabel,
+ );
+}
+
export function getRecoveryPointTimestampMs(point: RecoveryPoint): number {
const raw = String(point.completedAt || point.startedAt || '');
const parsed = Date.parse(raw);
@@ -64,6 +94,14 @@ export function getRecoveryPointItemLabel(
return point.id;
}
+export function getRecoveryPointItemSecondaryLabel(point: RecoveryPoint): string {
+ return getRecoveryItemSecondaryLabel(
+ String(point.display?.itemLabel || '').trim(),
+ String(point.display?.itemType || point.itemRef?.type || point.subjectRef?.type || ''),
+ point.display?.entityIdLabel,
+ );
+}
+
export function getRecoveryRollupSubjectLabel(
rollup: ProtectionRollup,
resourcesById: Map<string, Resource>,