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.

Restore infrastructure resource identity labels

rcourtmanb44abc0dfca8
diff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
index f2ed432fa2..2a257177dc 100644
--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
@@ -218,6 +218,12 @@ org-scope switching, and metadata refresh, and
owns workload-route synchronization, deep-link normalization, and route-scoped
filter contracts. Future dashboard hot-path changes must extend through those
owners instead of accreting back into `frontend-modern/src/components/Dashboard/Dashboard.tsx`.
+The shared infrastructure table hot path now also treats operator-facing
+resource identity as a protected boundary: sorting, searching, summary-series
+matching, and row titles on the infrastructure page must use the canonical
+local instance identity rather than governed AI-summary text, so performance
+work cannot “optimize” the table into ambiguous labels that collapse multiple
+resources into the same visible name.
That derived workload owner now also routes grouped row windowing through
`frontend-modern/src/components/Dashboard/useGroupedTableWindowing.ts`, which
owns row-window thresholds, overscan behavior, reveal-index clamping, and
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 45b1d71bc1..78a6e95b4b 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -251,12 +251,12 @@ and it no longer repeats that same provenance as a separate `Mode` row because
the drawer header badges already own canonical source display,
and the drawer header no longer carries the technical primary identity line;
that canonical identifier now lives in the `Identity` card as `Primary ID`,
-and governed consumer identity labels now split from governed detail summaries:
-table rows, selectors, and other primary UI labels must collapse generated
-policy summaries such as `type; status; sources; redaction suffix` down to a
-concise non-sensitive identity label like `backup server (online)`, while the
-drawer governance summary and other explanation surfaces still show the full
-canonical `aiSafeSummary`,
+and local operator identity labels now split from governed detail summaries:
+infrastructure tables, selectors, links, and drawer headings must preserve the
+canonical local instance identity (`displayName`, canonical display name,
+hostname, then primary ID fallback) so service and host surfaces stay uniquely
+addressable for operators, while the drawer governance summary and other
+explanation surfaces still show the full canonical `aiSafeSummary`,
`resourceDetailDrawerServiceModel.ts` owns the pure Docker/PBS/PMG service
summary and breakdown derivations that feed the overview service-details
surface,
diff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx
index ebe564d6db..0769c03207 100644
--- a/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx
+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx
@@ -23,7 +23,7 @@ import {
getUnifiedSourceBadges,
} from '@/utils/resourceBadgePresentation';
import { getAgentStatusIndicator } from '@/utils/status';
-import { getPreferredResourceDisplayName } from '@/utils/resourceIdentity';
+import { getPreferredInfrastructureDisplayName } from '@/utils/resourceIdentity';
import {
getResourcePolicyTableBadges,
shouldShowResourceAlternateName,
@@ -184,7 +184,9 @@ export const UnifiedResourceHostTableCard: Component<UnifiedResourceHostTableCar
const isHighlighted = createMemo(
() => tableProps.highlightedResourceId === resource.id,
);
- const displayName = createMemo(() => getPreferredResourceDisplayName(resource));
+ const displayName = createMemo(() =>
+ getPreferredInfrastructureDisplayName(resource),
+ );
const statusIndicator = createMemo(() =>
getAgentStatusIndicator({ status: resource.status }),
);
diff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx
index d712c506ac..25a61bda43 100644
--- a/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx
+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx
@@ -17,7 +17,7 @@ import {
} from '@/utils/resourceBadgePresentation';
import { getAgentStatusIndicator } from '@/utils/status';
import { getServiceHealthSummaryPresentation } from '@/utils/serviceHealthPresentation';
-import { getPreferredResourceDisplayName } from '@/utils/resourceIdentity';
+import { getPreferredInfrastructureDisplayName } from '@/utils/resourceIdentity';
import { shouldShowResourceAlternateName } from '@/utils/resourcePolicyPresentation';
import { ResourceDetailDrawer } from './ResourceDetailDrawer';
import { ResourceFacetSummary } from './ResourceFacetSummary';
@@ -91,7 +91,9 @@ export const UnifiedResourcePBSTableSection: Component<UnifiedResourcePBSTableSe
const isHighlighted = createMemo(
() => tableProps.highlightedResourceId === resource.id,
);
- const displayName = createMemo(() => getPreferredResourceDisplayName(resource));
+ const displayName = createMemo(() =>
+ getPreferredInfrastructureDisplayName(resource),
+ );
const serviceLink = createMemo(
() => buildServiceDetailLinks(resource)[0] ?? null,
);
diff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx
index 4db8babc4c..9e5340a969 100644
--- a/frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx
+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx
@@ -17,7 +17,7 @@ import {
} from '@/utils/resourceBadgePresentation';
import { getAgentStatusIndicator } from '@/utils/status';
import { getServiceHealthSummaryPresentation } from '@/utils/serviceHealthPresentation';
-import { getPreferredResourceDisplayName } from '@/utils/resourceIdentity';
+import { getPreferredInfrastructureDisplayName } from '@/utils/resourceIdentity';
import { shouldShowResourceAlternateName } from '@/utils/resourcePolicyPresentation';
import { ResourceDetailDrawer } from './ResourceDetailDrawer';
import { ResourceFacetSummary } from './ResourceFacetSummary';
@@ -103,7 +103,9 @@ export const UnifiedResourcePMGTableSection: Component<UnifiedResourcePMGTableSe
const isHighlighted = createMemo(
() => tableProps.highlightedResourceId === resource.id,
);
- const displayName = createMemo(() => getPreferredResourceDisplayName(resource));
+ const displayName = createMemo(() =>
+ getPreferredInfrastructureDisplayName(resource),
+ );
const serviceLink = createMemo(
() => buildServiceDetailLinks(resource)[0] ?? null,
);
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx
index 6f5de0049e..f61afc5781 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx
@@ -4,7 +4,7 @@ import type { Resource } from '@/types/resource';
import { UnifiedResourceTable } from '@/components/Infrastructure/UnifiedResourceTable';
import { ResourceFacetSummary } from '@/components/Infrastructure/ResourceFacetSummary';
import { formatSensorName } from '@/components/Infrastructure/resourceDetailMappers';
-import { getPreferredResourceDisplayName } from '@/utils/resourceIdentity';
+import { getPreferredInfrastructureDisplayName } from '@/utils/resourceIdentity';
import unifiedResourceTableSource from '@/components/Infrastructure/UnifiedResourceTable.tsx?raw';
import unifiedResourceTableStateSource from '@/components/Infrastructure/useUnifiedResourceTableState.ts?raw';
import unifiedResourceTableViewportSyncSource from '@/components/Infrastructure/useUnifiedResourceTableViewportSync.ts?raw';
@@ -274,7 +274,7 @@ describe('UnifiedResourceTable performance contract', () => {
expect(filtered[0]?.platformData?.sources).toEqual(['proxmox']);
});
- it('keeps governed resource search aligned with the safe display label', () => {
+ it('keeps governed resource search aligned with the infrastructure display label', () => {
const governedResource = makeResource(9, {
name: 'secret-host-9',
displayName: 'secret-host-9',
@@ -285,8 +285,8 @@ describe('UnifiedResourceTable performance contract', () => {
aiSafeSummary: 'Production Host',
});
- expect(matchesSearch(governedResource, 'Production')).toBe(true);
- expect(matchesSearch(governedResource, 'secret-host-9')).toBe(false);
+ expect(matchesSearch(governedResource, 'Production')).toBe(false);
+ expect(matchesSearch(governedResource, 'secret-host-9')).toBe(true);
});
it('suppresses the default policy posture badges in host-table rows while preserving exceptional policy badges', async () => {
@@ -564,12 +564,9 @@ describe('UnifiedResourceTable performance contract', () => {
await waitFor(() => {
expect(getAllByText('Restricted').length).toBeGreaterThan(0);
});
- expect(getPreferredResourceDisplayName(resources[0]!)).toBe(
- 'restricted host summary safe for remote AI consumption',
- );
- expect(getByTitle('restricted host summary safe for remote AI consumption')).toBeInTheDocument();
- expect(queryByText('Sensitive Host')).toBeNull();
- expect(queryByText('sensitive-host')).toBeNull();
+ expect(getPreferredInfrastructureDisplayName(resources[0]!)).toBe('Sensitive Host');
+ expect(getByTitle('Sensitive Host')).toBeInTheDocument();
+ expect(queryByText('Sensitive Host')).toBeInTheDocument();
});
it('Profile M: caps mounted rows when windowing is active', async () => {
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.policy-governance.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.policy-governance.test.tsx
index 09424da869..e261621020 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.policy-governance.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.policy-governance.test.tsx
@@ -70,9 +70,9 @@ describe('UnifiedResourceTable governance presentation', () => {
expect(getByText('Restricted')).toBeInTheDocument();
expect(getByText('Local Only')).toBeInTheDocument();
- expect(getByText('restricted host summary safe for remote AI consumption')).toBeInTheDocument();
+ expect(getByText('Sensitive Host')).toBeInTheDocument();
+ expect(queryByText('restricted host summary safe for remote AI consumption')).toBeNull();
expect(queryByText('(sensitive-host)')).toBeNull();
- expect(queryByText('Sensitive Host')).toBeNull();
});
it('surfaces resource facet counts in the resource row', () => {
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/infrastructureSelectors.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/infrastructureSelectors.test.ts
index 3d4fde0f37..24341259dc 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/infrastructureSelectors.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/infrastructureSelectors.test.ts
@@ -58,7 +58,7 @@ describe('infrastructureSelectors', () => {
expect(matchesSearch(resource, 'NODE-123')).toBe(true);
});
- it('matches governed resources by their safe label instead of raw name', () => {
+ it('matches governed resources by their local infrastructure label', () => {
const governedResource = makeResource(2, {
name: 'secret-node-2',
displayName: 'secret-node-2',
@@ -69,8 +69,8 @@ describe('infrastructureSelectors', () => {
aiSafeSummary: 'Production Node',
});
- expect(matchesSearch(governedResource, 'Production')).toBe(true);
- expect(matchesSearch(governedResource, 'secret-node-2')).toBe(false);
+ expect(matchesSearch(governedResource, 'Production')).toBe(false);
+ expect(matchesSearch(governedResource, 'secret-node-2')).toBe(true);
});
it('matches by ip and tag and returns false when missing', () => {
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailMappers.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailMappers.test.ts
index 2763aae244..c9e98301a2 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailMappers.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailMappers.test.ts
@@ -110,5 +110,20 @@ describe('resourceDetailMappers', () => {
expect(agent?.id).toBe('agent-canonical');
expect(agent?.id).not.toBe('resource:host:hash-1');
});
+
+ it('preserves the local infrastructure display name for governed resources', () => {
+ const agent = toAgentFromResource({
+ ...createHybridHostResource(),
+ name: 'secret-host',
+ displayName: 'Tower',
+ policy: {
+ sensitivity: 'restricted',
+ routing: { scope: 'local-only', redact: ['hostname', 'alias'] },
+ },
+ aiSafeSummary: 'restricted host summary safe for remote AI consumption',
+ });
+
+ expect(agent?.displayName).toBe('Tower');
+ });
});
});
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/workloadsLink.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/workloadsLink.test.ts
index 66d83fb2e4..d465bcfea5 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/workloadsLink.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/workloadsLink.test.ts
@@ -66,7 +66,7 @@ describe('buildWorkloadsHref', () => {
expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod&context=Fallback+Display');
});
- it('uses the governed preferred display label for redacted k8s-cluster fallback', () => {
+ it('uses the local infrastructure label for redacted k8s-cluster fallback', () => {
const resource = makeResource({
type: 'k8s-cluster',
platformType: 'kubernetes',
@@ -79,7 +79,7 @@ describe('buildWorkloadsHref', () => {
aiSafeSummary: 'Governed Cluster',
});
- expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod&context=Governed+Cluster');
+ expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod&context=secret-cluster');
});
it('falls back to resource.name when displayName is empty for k8s-cluster', () => {
diff --git a/frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts b/frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts
index 58e3c37a20..4a9280e7f1 100644
--- a/frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts
+++ b/frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts
@@ -1,6 +1,6 @@
import type { Resource } from '@/types/resource';
import { getCpuPercent, getDiskPercent, getMemoryPercent } from '@/types/resource';
-import { getPreferredResourceDisplayName } from '@/utils/resourceIdentity';
+import { getPreferredInfrastructureDisplayName } from '@/utils/resourceIdentity';
import { normalizeSourcePlatformKey, type KnownSourcePlatform } from '@/utils/sourcePlatforms';
import { getCanonicalStatusLabel, STATUS_SORT_ORDER } from '@/utils/status';
@@ -69,7 +69,7 @@ const buildIODistribution = (values: number[]): IODistributionStats => {
const getSortValue = (resource: Resource, key: string): number | string | null => {
switch (key) {
case 'name':
- return getPreferredResourceDisplayName(resource);
+ return getPreferredInfrastructureDisplayName(resource);
case 'uptime':
return resource.uptime ?? 0;
case 'cpu':
@@ -95,7 +95,9 @@ const defaultComparison = (a: Resource, b: Resource) => {
const aOnline = isResourceOnline(a);
const bOnline = isResourceOnline(b);
if (aOnline !== bOnline) return aOnline ? -1 : 1;
- return getPreferredResourceDisplayName(a).localeCompare(getPreferredResourceDisplayName(b));
+ return getPreferredInfrastructureDisplayName(a).localeCompare(
+ getPreferredInfrastructureDisplayName(b),
+ );
};
const compareValues = (valueA: number | string | null, valueB: number | string | null) => {
@@ -131,7 +133,7 @@ export const matchesSearch = (resource: Resource, term: string): boolean => {
if (!term) return true;
const normalizedTerm = term.toLowerCase();
const candidates: string[] = [
- getPreferredResourceDisplayName(resource),
+ getPreferredInfrastructureDisplayName(resource),
resource.id,
resource.identity?.hostname ?? '',
...(resource.identity?.ips ?? []),
diff --git a/frontend-modern/src/components/Infrastructure/infrastructureSummaryModel.ts b/frontend-modern/src/components/Infrastructure/infrastructureSummaryModel.ts
index e6d6ec7e3e..768879c635 100644
--- a/frontend-modern/src/components/Infrastructure/infrastructureSummaryModel.ts
+++ b/frontend-modern/src/components/Infrastructure/infrastructureSummaryModel.ts
@@ -7,7 +7,7 @@ import {
hasAgentFacet,
} from '@/utils/agentResources';
import {
- getPreferredResourceDisplayName,
+ getPreferredInfrastructureDisplayName,
getPreferredResourceHostname,
getResourceIdentityAliases,
getNormalizedIdentityLookupVariants,
@@ -66,7 +66,7 @@ const getNormalizedResourceIdentifiers = (resource: Resource): Set<string> =>
new Set<string>([
...getNormalizedIdentityLookupVariants(resource.id),
...getNormalizedIdentityLookupVariants(resource.platformId),
- ...getNormalizedIdentityLookupVariants(getPreferredResourceDisplayName(resource)),
+ ...getNormalizedIdentityLookupVariants(getPreferredInfrastructureDisplayName(resource)),
...getNormalizedIdentityLookupVariants(getPreferredResourceHostname(resource)),
...getResourceIdentityAliases(resource).flatMap((value) =>
getNormalizedIdentityLookupVariants(value),
@@ -216,7 +216,7 @@ export function buildInfrastructureSummarySeries(
metricSeries('diskwrite'),
),
color: getChartSeriesColor(index),
- name: getPreferredResourceDisplayName(resource),
+ name: getPreferredInfrastructureDisplayName(resource),
};
});
}
diff --git a/frontend-modern/src/components/Infrastructure/resourceDetailDiscoveryModel.ts b/frontend-modern/src/components/Infrastructure/resourceDetailDiscoveryModel.ts
index f68b4df0cb..479980fe45 100644
--- a/frontend-modern/src/components/Infrastructure/resourceDetailDiscoveryModel.ts
+++ b/frontend-modern/src/components/Infrastructure/resourceDetailDiscoveryModel.ts
@@ -11,7 +11,7 @@ import {
} from '@/utils/agentResources';
import {
getPreferredResourceClusterName,
- getPreferredResourceDisplayName,
+ getPreferredInfrastructureDisplayName,
getPreferredResourceHostname,
} from '@/utils/resourceIdentity';
@@ -59,7 +59,7 @@ const asNumber = (value: unknown): number | undefined =>
const getPreferredHostLabel = (resource: Resource): string =>
getPreferredResourceHostname(resource) ||
- getPreferredResourceDisplayName(resource) ||
+ getPreferredInfrastructureDisplayName(resource) ||
resource.id;
export const toDiscoveryConfig = (resource: Resource): DiscoveryConfig | null => {
@@ -154,7 +154,7 @@ export const toDiscoveryConfig = (resource: Resource): DiscoveryConfig | null =>
platformData?.agent?.hostname ||
asString(dockerPlatformData?.hostname) ||
getPreferredResourceHostname(resource) ||
- getPreferredResourceDisplayName(resource) ||
+ getPreferredInfrastructureDisplayName(resource) ||
resource.platformId ||
resource.id;
const workloadAgentId =
diff --git a/frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts b/frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts
index b363acd246..58d33e4962 100644
--- a/frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts
+++ b/frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts
@@ -10,7 +10,10 @@ import type {
import type { Resource, ResourceMetric } from '@/types/resource';
import { formatTemperature } from '@/utils/temperature';
import { getActionableAgentIdFromResource } from '@/utils/agentResources';
-import { getPreferredResourceDisplayName, getPreferredResourceHostname } from '@/utils/resourceIdentity';
+import {
+ getPreferredInfrastructureDisplayName,
+ getPreferredResourceHostname,
+} from '@/utils/resourceIdentity';
import { titleCaseDelimitedLabel } from '@/utils/textPresentation';
export { getSourceTypeLabel as formatSourceType } from '@/utils/sourceTypePresentation';
@@ -166,7 +169,7 @@ const asString = (value: unknown): string | undefined =>
const getPreferredHostLabel = (resource: Resource): string =>
getPreferredResourceHostname(resource) ||
- getPreferredResourceDisplayName(resource) ||
+ getPreferredInfrastructureDisplayName(resource) ||
resource.id;
export const buildMemory = (metric?: ResourceMetric, fallback?: Partial<Memory>): Memory => {
@@ -234,7 +237,7 @@ export const toNodeFromProxmox = (resource: Resource): Node | null => {
return {
id: resource.id,
name: proxmox.nodeName ?? getPreferredHostLabel(resource),
- displayName: getPreferredResourceDisplayName(resource),
+ displayName: getPreferredInfrastructureDisplayName(resource),
instance: resource.platformId ?? resource.id,
host: proxmox.nodeName ?? getPreferredHostLabel(resource),
status: resource.status,
@@ -280,7 +283,7 @@ export const toAgentFromResource = (
return {
id: agentId,
hostname,
- displayName: getPreferredResourceDisplayName(resource),
+ displayName: getPreferredInfrastructureDisplayName(resource),
platform: agent.platform,
osName: agent.osName ?? 'Unknown',
osVersion: agent.osVersion ?? '',
diff --git a/frontend-modern/src/components/Infrastructure/serviceDetailLinks.ts b/frontend-modern/src/components/Infrastructure/serviceDetailLinks.ts
index 4c7bc7b66c..f64b36b1e7 100644
--- a/frontend-modern/src/components/Infrastructure/serviceDetailLinks.ts
+++ b/frontend-modern/src/components/Infrastructure/serviceDetailLinks.ts
@@ -1,6 +1,6 @@
import type { Resource } from '@/types/resource';
import { buildRecoveryPath, PMG_THRESHOLDS_PATH } from '@/routing/resourceLinks';
-import { getPreferredResourceDisplayName } from '@/utils/resourceIdentity';
+import { getPreferredInfrastructureDisplayName } from '@/utils/resourceIdentity';
export type ServiceDetailLink = {
href: string;
@@ -10,7 +10,7 @@ export type ServiceDetailLink = {
};
export const buildServiceDetailLinks = (resource: Resource): ServiceDetailLink[] => {
- const label = getPreferredResourceDisplayName(resource);
+ const label = getPreferredInfrastructureDisplayName(resource);
if (resource.type === 'pbs') {
return [
diff --git a/frontend-modern/src/components/Infrastructure/unifiedResourceTableStateModel.ts b/frontend-modern/src/components/Infrastructure/unifiedResourceTableStateModel.ts
index 6e96f98cb8..de369a7829 100644
--- a/frontend-modern/src/components/Infrastructure/unifiedResourceTableStateModel.ts
+++ b/frontend-modern/src/components/Infrastructure/unifiedResourceTableStateModel.ts
@@ -1,5 +1,5 @@
import type { Resource } from '@/types/resource';
-import { getPreferredResourceDisplayName } from '@/utils/resourceIdentity';
+import { getPreferredInfrastructureDisplayName } from '@/utils/resourceIdentity';
import {
sortResources,
type ResourceGroup,
@@ -38,7 +38,7 @@ export const HOST_TABLE_WINDOW_SIZE = 137;
export const buildResourceLabelById = (resources: Resource[]): Map<string, string> => {
const map = new Map<string, string>();
for (const resource of resources) {
- map.set(resource.id, getPreferredResourceDisplayName(resource));
+ map.set(resource.id, getPreferredInfrastructureDisplayName(resource));
}
return map;
};
diff --git a/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerDerivedState.ts b/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerDerivedState.ts
index 6732e74b90..4b38b68dba 100644
--- a/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerDerivedState.ts
+++ b/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerDerivedState.ts
@@ -12,7 +12,7 @@ import {
} from '@/utils/resourceBadgePresentation';
import {
getPreferredResourceClusterName,
- getPreferredResourceDisplayName,
+ getPreferredInfrastructureDisplayName,
} from '@/utils/resourceIdentity';
import { areSystemSettingsLoaded, shouldHideDockerUpdateActions } from '@/stores/systemSettings';
import {
@@ -73,7 +73,7 @@ export const useResourceDetailDrawerDerivedState = (
const { resource, resolveResourceLabel: resolveResourceLabelInput, debugEnabled, resourceIntelligence } =
options;
- const displayName = createMemo(() => getPreferredResourceDisplayName(resource));
+ const displayName = createMemo(() => getPreferredInfrastructureDisplayName(resource));
const kubernetesClusterName = createMemo(() => getPreferredResourceClusterName(resource) ?? '');
const resolveResourceLabel = (resourceId: string): string =>
resolveResourceLabelInput?.(resourceId)?.trim() || resourceId;
diff --git a/frontend-modern/src/components/Infrastructure/workloadsLink.ts b/frontend-modern/src/components/Infrastructure/workloadsLink.ts
index f6a218b4c6..f333a68270 100644
--- a/frontend-modern/src/components/Infrastructure/workloadsLink.ts
+++ b/frontend-modern/src/components/Infrastructure/workloadsLink.ts
@@ -5,7 +5,7 @@ import {
hasDockerWorkloadsScope,
} from '@/utils/agentResources';
import {
- getPreferredResourceDisplayName,
+ getPreferredInfrastructureDisplayName,
getPreferredWorkloadsAgentHint,
getPreferredResourceKubernetesContext,
} from '@/utils/resourceIdentity';
@@ -24,7 +24,7 @@ const resolveKubernetesContext = (resource: Resource): string | undefined => {
const kubernetesContext = getPreferredResourceKubernetesContext(resource);
if (resource.type === 'k8s-cluster') {
const displayLabel = requiresGovernedResourceDisplay(resource.policy)
- ? getPreferredResourceDisplayName(resource)
+ ? getPreferredInfrastructureDisplayName(resource)
: resource.displayName?.trim() || resource.name?.trim() || undefined;
return firstNonEmpty([
kubernetesContext,
diff --git a/frontend-modern/src/utils/__tests__/resourceIdentity.test.ts b/frontend-modern/src/utils/__tests__/resourceIdentity.test.ts
index df1271bc57..914a708e9f 100644
--- a/frontend-modern/src/utils/__tests__/resourceIdentity.test.ts
+++ b/frontend-modern/src/utils/__tests__/resourceIdentity.test.ts
@@ -13,6 +13,7 @@ import {
getPreferredResourceClusterName,
getPreferredResourceKubernetesContext,
getPreferredResourceDisplayName,
+ getPreferredInfrastructureDisplayName,
getPreferredResourceHostname,
getPreferredWorkloadsAgentHint,
getPrimaryResourceIdentity,
@@ -481,6 +482,25 @@ describe('resourceIdentity', () => {
),
).toBe('backup server (online)');
+ expect(
+ getPreferredInfrastructureDisplayName(
+ makeResource({
+ name: 'pbs-main',
+ displayName: 'PBS Main',
+ type: 'pbs',
+ policy: {
+ sensitivity: 'sensitive',
+ routing: {
+ scope: 'local-first',
+ redact: ['hostname', 'platform-id'],
+ },
+ },
+ aiSafeSummary:
+ 'backup server resource; status online; sources pbs; 1 child resources; redacted for cloud summary',
+ }),
+ ),
+ ).toBe('PBS Main');
+
expect(
getPreferredResourceDisplayName(
makeResource({
diff --git a/frontend-modern/src/utils/resourceIdentity.ts b/frontend-modern/src/utils/resourceIdentity.ts
index fa618df2b2..24978ebd80 100644
--- a/frontend-modern/src/utils/resourceIdentity.ts
+++ b/frontend-modern/src/utils/resourceIdentity.ts
@@ -356,6 +356,12 @@ export const getPreferredResourceDisplayName = (resource: Resource): string =>
getPreferredResourceHostname(resource) ||
getPrimaryResourceIdentity(resource);
+export const getPreferredInfrastructureDisplayName = (resource: Resource): string =>
+ asTrimmedString(resource.displayName) ||
+ asTrimmedString(getCanonicalIdentityRecord(resource)?.displayName) ||
+ getPreferredResourceHostname(resource) ||
+ getPrimaryResourceIdentity(resource);
+
export const getPreferredWorkloadsAgentHint = (resource: Resource): string | undefined => {
const platformData = getPlatformDataRecord(resource);
const proxmox = platformData?.proxmox as Record<string, unknown> | undefined;