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.

Drop VMID from LXC Docker host badge label

rcourtman4ae690a086ad
diff --git a/frontend-modern/src/utils/__tests__/resourceBadgePresentation.test.ts b/frontend-modern/src/utils/__tests__/resourceBadgePresentation.test.ts
index 6e174194c4..24d30c4fc5 100644
--- a/frontend-modern/src/utils/__tests__/resourceBadgePresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/resourceBadgePresentation.test.ts
@@ -377,7 +377,7 @@ describe('resourceBadgePresentation', () => {
expect(getInfrastructureSystemIdentitySortLabel(resource)).toBe('PVE');
});
- it('renders Proxmox LXC Docker hosts with an LXC badge derived from the host source id', () => {
+ it('renders Proxmox LXC Docker hosts with a canonical LXC badge and surfaces the VMID in the tooltip', () => {
const lxcDockerHost = makeResource({
type: 'docker-host',
platformType: 'docker',
@@ -390,11 +390,11 @@ describe('resourceBadgePresentation', () => {
} as Partial<Resource>);
const badges = getInfrastructureSystemIdentityBadges(lxcDockerHost);
- expect(badges.map((b) => b.label)).toEqual(['LXC 141']);
+ expect(badges.map((b) => b.label)).toEqual(['LXC']);
expect(badges[0]?.title).toBe('Docker running inside Proxmox LXC 141');
});
- it('falls back to a bare LXC badge when the VMID cannot be parsed from the host source id', () => {
+ it('keeps the canonical LXC label even when the VMID cannot be parsed from the host source id', () => {
const lxcDockerHost = makeResource({
type: 'docker-host',
platformType: 'docker',
@@ -406,9 +406,9 @@ describe('resourceBadgePresentation', () => {
},
} as Partial<Resource>);
- expect(getInfrastructureSystemIdentityBadges(lxcDockerHost).map((b) => b.label)).toEqual([
- 'LXC',
- ]);
+ const badges = getInfrastructureSystemIdentityBadges(lxcDockerHost);
+ expect(badges.map((b) => b.label)).toEqual(['LXC']);
+ expect(badges[0]?.title).toBe('Docker running inside a Proxmox LXC');
});
it('uses probe protocol identity for agentless network endpoints', () => {
diff --git a/frontend-modern/src/utils/resourceBadgePresentation.ts b/frontend-modern/src/utils/resourceBadgePresentation.ts
index 7097f4ca5c..c726a1b041 100644
--- a/frontend-modern/src/utils/resourceBadgePresentation.ts
+++ b/frontend-modern/src/utils/resourceBadgePresentation.ts
@@ -578,9 +578,8 @@ const proxmoxLxcDockerBadge = (resource: Resource): ResourceBadge | null => {
if (typeof resource.docker?.hostSourceId !== 'string') return null;
if (!resource.docker.hostSourceId.startsWith(LXC_DOCKER_HOST_PREFIX)) return null;
const vmid = proxmoxLxcDockerVmid(resource);
- const label = vmid !== null ? `LXC ${vmid}` : 'LXC';
return {
- label,
+ label: 'LXC',
classes: `${baseBadge} ${getWorkloadTypePresentation('system-container').className}`,
title: vmid !== null
? `Docker running inside Proxmox LXC ${vmid}`