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.

Show platform versions in system badges

rcourtmanaa21e624aa3d
diff --git a/docs/release-control/v6/internal/PLATFORM_SUPPORT_MANIFEST.json b/docs/release-control/v6/internal/PLATFORM_SUPPORT_MANIFEST.json
index 94675a742d..95337f59ae 100644
--- a/docs/release-control/v6/internal/PLATFORM_SUPPORT_MANIFEST.json
+++ b/docs/release-control/v6/internal/PLATFORM_SUPPORT_MANIFEST.json
@@ -330,7 +330,7 @@
"assistant_control": "n/a"
},
"ui_label": "Unraid",
- "ui_tone": "bg-orange-100 text-orange-700 dark:bg-orange-900 dark:text-orange-300",
+ "ui_tone": "bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",
"aliases": [],
"display_tokens": [
"Unraid"
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 8978839be6..da07a71a41 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -660,7 +660,12 @@ prompt explain the same operator-facing priority.
unified-resource `platformData.agent.hostProfile` rather than prettifying
presentation-only ids as platform values. Raw appliance identity aliases
such as `unraid-os` belong only in the generated host-profile token list so
- shared helpers resolve them to `unraid` before presentation.
+ shared helpers resolve them to `unraid` before presentation. Infrastructure
+ `System` badges must append the platform runtime version when the payload
+ proves that version belongs to the displayed platform identity, such as PVE
+ `pveVersion` or a Pulse Agent report whose OS identity resolves to Unraid or
+ Proxmox VE. They must omit the version rather than showing unrelated
+ collector OS versions, such as Debian 12, beside an API-backed PVE badge.
9. Keep top-of-page summary interaction on shared primitives. Infrastructure, workloads, and storage summary cards must route sticky-shell behavior through `frontend-modern/src/components/shared/StickySummarySection.tsx` and route row-hover or focused-series rendering through shared chart primitives such as `frontend-modern/src/components/shared/InteractiveSparkline.tsx` and `frontend-modern/src/components/shared/DensityMap.tsx`, rather than page-local sticky wrappers or metric-card-specific hover logic. When a page keeps summary charts visible below the desktop breakpoint, it must use the shared `stickyDesktopOnly` mode instead of adding page-local media queries, so wrapped two-column summaries scroll as normal content and only become sticky once the large-screen layout is active. The shared summary-card contract must also own stable summary-card geometry for chart-backed cards so row hover, focus, synchronized readouts, or idle header metadata cannot ratchet the sticky summary taller across rerenders.
10. Keep summary chart interaction identity on one shared helper. Summary surfaces that expose row-hover, group-hover, chart-hover, or route-focus-driven chart emphasis must derive page/group/entity scope through `frontend-modern/src/components/shared/summaryCardInteraction.ts` and pass that same resolved scope into card-state, sparkline, and density-map primitives, rather than letting cards read `hovered || focused` while charts listen to a different page-local ID source. Hovering one summary chart must promote that series into the shared active entity so sibling cards highlight the same object instead of keeping chart-local hover islands, and hovering or pinning a workload group header, infrastructure cluster header, or storage pool-group header must scope the matching summary cards through that same shared contract instead of forking a page-local summary filter path. Sibling cards should surface that synchronized hover as one compact header readout through the shared summary-card contract, while the chart under the pointer keeps the only floating tooltip. `frontend-modern/src/components/Recovery/RecoverySummary.tsx` is explicitly outside this interaction dialect: recovery posture cards may share summary framing, but they must not silently grow row/group/chart hover behavior without a separate governed product decision.
11. Keep page summaries page-scoped when table rows enter contextual focus. Route-backed row selection may add a focused label and shared series emphasis, but infrastructure, workloads, and storage summary cards must continue to render the page-level series set instead of collapsing the summary down to the selected row or replacing the global trend view with row-local empty states.
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 3f699ca601..b0b29d3af7 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -644,6 +644,11 @@ presentation and host/appliance support-floor copy. Raw appliance identity
aliases such as `unraid-os` may be accepted only through the generated
host-profile token projection and must resolve to a governed profile id before
they reach platform filters, source IDs, or top-level resource identity.
+Frontend resource identity presenters may append a runtime version to a
+displayed system badge only when that version is sourced from the same canonical
+platform or host-profile identity, such as PVE `pveVersion`, PBS `version`, or
+an agent OS report that resolves to Unraid or Proxmox VE. They must not attach
+a collector OS version to a different API-backed platform identity.
Agent-backed storage resources follow the same distinction: `StorageMeta.platform`
may carry appliance presentation context such as `unraid` so the operator can see
what system owns the array, but realtime `platformType` and source filters must
diff --git a/frontend-modern/src/utils/__tests__/resourceBadgePresentation.test.ts b/frontend-modern/src/utils/__tests__/resourceBadgePresentation.test.ts
index 7c1819ad50..2f0589d532 100644
--- a/frontend-modern/src/utils/__tests__/resourceBadgePresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/resourceBadgePresentation.test.ts
@@ -78,7 +78,7 @@ describe('resourceBadgePresentation', () => {
},
}),
).map((badge) => badge.label),
- ).toEqual(['Unraid']);
+ ).toEqual(['Unraid 7.1.0']);
expect(
getInfrastructureSystemIdentityBadges(
@@ -113,7 +113,7 @@ describe('resourceBadgePresentation', () => {
},
}),
).map((badge) => badge.label),
- ).toEqual(['Unraid']);
+ ).toEqual(['Unraid 7.2.2']);
});
it('shows storage-owned platform identity without using presentation profiles as PlatformType', () => {
@@ -137,9 +137,9 @@ describe('resourceBadgePresentation', () => {
} as Resource['storage'],
});
- expect(getInfrastructureSystemIdentityBadges(unraidStorage).map((badge) => badge.label)).toEqual([
- 'Unraid',
- ]);
+ expect(getInfrastructureSystemIdentityBadges(unraidStorage).map((badge) => badge.label)).toEqual(
+ ['Unraid'],
+ );
expect(getInfrastructureSystemIdentitySortLabel(unraidStorage)).toBe('Unraid');
const pbsDatastore = makeResource({
@@ -180,7 +180,7 @@ describe('resourceBadgePresentation', () => {
},
}),
).map((badge) => badge.label),
- ).toEqual(['Unraid']);
+ ).toEqual(['Unraid 7.2.2']);
});
it('uses governed host identity tokens for legacy agent profile reports', () => {
@@ -200,7 +200,7 @@ describe('resourceBadgePresentation', () => {
},
}),
).map((badge) => badge.label),
- ).toEqual(['Unraid']);
+ ).toEqual(['Unraid 7.1.0']);
});
it('uses authoritative top-level sources before stale platformData source hints', () => {
@@ -221,7 +221,7 @@ describe('resourceBadgePresentation', () => {
},
}),
).map((badge) => badge.label),
- ).toEqual(['Unraid']);
+ ).toEqual(['Unraid 7.2.2']);
});
it('matches governed platform display tokens inside reported host identity text', () => {
@@ -263,6 +263,44 @@ describe('resourceBadgePresentation', () => {
expect(getInfrastructureSystemIdentitySortLabel(resource)).toBe('PVE');
});
+ it('shows platform versions when the reported version belongs to the platform identity', () => {
+ const agentDiscoveredPve = makeResource({
+ type: 'agent',
+ platformType: 'agent',
+ sourceType: 'agent',
+ sources: ['agent'],
+ platformData: {
+ sources: ['agent'],
+ agent: {
+ platform: 'debian',
+ osName: 'Proxmox VE',
+ osVersion: '9.1.9',
+ },
+ },
+ });
+
+ expect(
+ getInfrastructureSystemIdentityBadges(agentDiscoveredPve).map((badge) => badge.label),
+ ).toEqual(['PVE 9.1.9']);
+
+ const apiBackedPve = makeResource({
+ type: 'agent',
+ platformType: 'proxmox-pve',
+ sourceType: 'api',
+ sources: ['proxmox'],
+ platformData: {
+ sources: ['proxmox'],
+ proxmox: {
+ pveVersion: '8.3.2',
+ },
+ },
+ });
+
+ expect(getInfrastructureSystemIdentityBadges(apiBackedPve).map((badge) => badge.label)).toEqual(
+ ['PVE 8.3.2'],
+ );
+ });
+
it('keeps top-level platform facets ahead of collection method identity', () => {
const resource = makeResource({
platformType: 'agent',
diff --git a/frontend-modern/src/utils/__tests__/sourcePlatforms.test.ts b/frontend-modern/src/utils/__tests__/sourcePlatforms.test.ts
index 020d1857aa..1914855613 100644
--- a/frontend-modern/src/utils/__tests__/sourcePlatforms.test.ts
+++ b/frontend-modern/src/utils/__tests__/sourcePlatforms.test.ts
@@ -43,6 +43,8 @@ describe('sourcePlatforms', () => {
it('matches governed display tokens from the platform manifest', () => {
expect(getSourcePlatformPresentation('Unraid')).toMatchObject({ label: 'Unraid' });
expect(getSourcePlatformPresentation('Proxmox VE')).toMatchObject({ label: 'PVE' });
+ expect(getSourcePlatformPresentation('unraid')?.tone).toContain('yellow');
+ expect(getSourcePlatformPresentation('proxmox-pve')?.tone).toContain('orange');
});
it('returns null for unknown platforms', () => {
diff --git a/frontend-modern/src/utils/platformSupportManifest.generated.ts b/frontend-modern/src/utils/platformSupportManifest.generated.ts
index b5bc9691eb..bcdd9f0490 100644
--- a/frontend-modern/src/utils/platformSupportManifest.generated.ts
+++ b/frontend-modern/src/utils/platformSupportManifest.generated.ts
@@ -1,11 +1,11 @@
// This file is generated by scripts/release_control/generate_platform_support_frontend_module.py.
// Do not edit by hand.
// Source: docs/release-control/v6/internal/PLATFORM_SUPPORT_MANIFEST.json
-// Source SHA256: d9f0b92b967180e558b838714f7bd45e0ba982306ff8bd94866aa4ab60db5320
+// Source SHA256: 7126ef35ec2c2cda7e04b4a5496337d9d194926f7586af89fb3ae082fc7d6a2e
export const PLATFORM_SUPPORT_MANIFEST_SOURCE = {
path: 'docs/release-control/v6/internal/PLATFORM_SUPPORT_MANIFEST.json',
- sha256: 'd9f0b92b967180e558b838714f7bd45e0ba982306ff8bd94866aa4ab60db5320',
+ sha256: '7126ef35ec2c2cda7e04b4a5496337d9d194926f7586af89fb3ae082fc7d6a2e',
} as const;
export const PLATFORM_SUPPORT_MANIFEST = {
schemaVersion: 1,
@@ -251,7 +251,7 @@ export const PLATFORM_SUPPORT_MANIFEST = {
assistantControl: 'n/a',
},
uiLabel: 'Unraid',
- uiTone: 'bg-orange-100 text-orange-700 dark:bg-orange-900 dark:text-orange-300',
+ uiTone: 'bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200',
aliases: [],
displayTokens: ['Unraid'],
storageFamily: 'onprem',
@@ -784,7 +784,7 @@ export const SOURCE_PLATFORM_PRESENTATION = {
},
unraid: {
label: 'Unraid',
- tone: 'bg-orange-100 text-orange-700 dark:bg-orange-900 dark:text-orange-300',
+ tone: 'bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200',
},
'synology-dsm': {
label: 'Synology',
diff --git a/frontend-modern/src/utils/resourceBadgePresentation.ts b/frontend-modern/src/utils/resourceBadgePresentation.ts
index 6b6b245868..51efbb5810 100644
--- a/frontend-modern/src/utils/resourceBadgePresentation.ts
+++ b/frontend-modern/src/utils/resourceBadgePresentation.ts
@@ -107,6 +107,43 @@ const titleFromParts = (...parts: Array<string | undefined>): string | undefined
return title || undefined;
};
+const UNKNOWN_VERSION_VALUES = new Set(['unknown', 'n/a', 'na', 'none', '-']);
+
+const normalizeVersion = (value: unknown): string => {
+ if (typeof value !== 'string' && typeof value !== 'number') return '';
+ const version = `${value}`.trim();
+ if (!version || UNKNOWN_VERSION_VALUES.has(version.toLowerCase())) return '';
+ return version;
+};
+
+const getRecordVersion = (
+ record: Record<string, unknown> | undefined,
+ ...fields: string[]
+): string => {
+ if (!record) return '';
+ for (const field of fields) {
+ const version = normalizeVersion(record[field]);
+ if (version) return version;
+ }
+ return '';
+};
+
+const withBadgeVersion = (badge: ResourceBadge, version: string): ResourceBadge => {
+ const normalizedVersion = normalizeVersion(version);
+ if (!normalizedVersion || badge.label.toLowerCase().includes(normalizedVersion.toLowerCase())) {
+ return badge;
+ }
+ const title = badge.title ?? badge.label;
+ const titleWithVersion = title.toLowerCase().includes(normalizedVersion.toLowerCase())
+ ? title
+ : titleFromParts(title, normalizedVersion);
+ return {
+ ...badge,
+ label: `${badge.label} ${normalizedVersion}`,
+ title: titleWithVersion ?? badge.title,
+ };
+};
+
const normalizeUnifiedSourceKeys = (sources?: string[] | null): KnownSourcePlatform[] => {
if (!sources || sources.length === 0) return [];
const normalized = sources
@@ -258,6 +295,30 @@ const getKnownHostIdentitySource = (...values: string[]): KnownSourcePlatform |
const getAgentRecord = (resource: Resource): Record<string, unknown> | undefined =>
getPlatformAgentRecord(resource) ?? asRecord(getResourceRecord(resource).agent);
+const getAgentIdentitySource = (
+ agent: Record<string, unknown> | undefined,
+): KnownSourcePlatform | null => {
+ const hostProfile = trimString(agent?.hostProfile);
+ if (hostProfile) {
+ const profile = getAgentHostProfileManifestEntry(hostProfile);
+ if (profile && getSourcePlatformManifestEntry(profile.id)) {
+ return profile.id as KnownSourcePlatform;
+ }
+ }
+ return getKnownHostIdentitySource(trimString(agent?.platform), trimString(agent?.osName));
+};
+
+const getAgentPlatformVersion = (
+ resource: Resource,
+ source?: KnownSourcePlatform | null,
+): string => {
+ const agent = getAgentRecord(resource);
+ if (!agent) return '';
+ const agentIdentitySource = getAgentIdentitySource(agent);
+ if (source && agentIdentitySource !== source) return '';
+ return getRecordVersion(agent, 'osVersion', 'version');
+};
+
const hasExplicitAgentHostProfile = (resource: Resource): boolean => {
const agent = getAgentRecord(resource);
const hostProfile = trimString(agent?.hostProfile);
@@ -294,11 +355,15 @@ const getAgentSystemIdentityBadge = (resource: Resource): ResourceBadge | null =
const profileFamily = getAgentHostProfileFamily(hostProfile);
const label = badge?.label ?? profileFamily;
if (label) {
- return {
- label,
- classes: badge?.classes ?? `${baseBadge} ${typeClasses}`,
- title: titleFromParts(osName || badge?.title || profileFamily || label, osVersion) ?? label,
- };
+ return withBadgeVersion(
+ {
+ label,
+ classes: badge?.classes ?? `${baseBadge} ${typeClasses}`,
+ title:
+ titleFromParts(osName || badge?.title || profileFamily || label, osVersion) ?? label,
+ },
+ osVersion,
+ );
}
}
@@ -306,21 +371,27 @@ const getAgentSystemIdentityBadge = (resource: Resource): ResourceBadge | null =
if (knownSource) {
const badge = getSourcePlatformBadge(knownSource);
if (badge) {
- return {
- label: badge.label,
- classes: badge.classes,
- title: titleFromParts(osName || badge.title, osVersion) ?? badge.title,
- };
+ return withBadgeVersion(
+ {
+ label: badge.label,
+ classes: badge.classes,
+ title: titleFromParts(osName || badge.title, osVersion) ?? badge.title,
+ },
+ osVersion,
+ );
}
}
const osLabel = getHostOsLabel(osName, platform);
if (osLabel) {
- return {
- label: osLabel,
- classes: `${baseBadge} ${typeClasses}`,
- title: titleFromParts(osName || osLabel, osVersion),
- };
+ return withBadgeVersion(
+ {
+ label: osLabel,
+ classes: `${baseBadge} ${typeClasses}`,
+ title: titleFromParts(osName || osLabel, osVersion),
+ },
+ osVersion,
+ );
}
return null;
@@ -378,6 +449,77 @@ const getStoragePlatformSource = (
return normalizeSourcePlatformKey(platform);
};
+const getSystemSourceVersion = (
+ resource: Resource,
+ platformData: Record<string, unknown> | undefined,
+ source: KnownSourcePlatform,
+): string => {
+ const platformRecord = getFacetRecord(resource, platformData, 'platform');
+ const sourceRecord = getFacetRecord(resource, platformData, source);
+ switch (source) {
+ case 'proxmox-pve': {
+ const proxmox = getFacetRecord(resource, platformData, 'proxmox');
+ return (
+ getRecordVersion(proxmox, 'pveVersion', 'version') ||
+ getRecordVersion(platformData, 'pveVersion') ||
+ getAgentPlatformVersion(resource, source)
+ );
+ }
+ case 'proxmox-pbs': {
+ const pbs = getFacetRecord(resource, platformData, 'pbs');
+ return getRecordVersion(pbs, 'version') || getRecordVersion(platformData, 'version');
+ }
+ case 'proxmox-pmg': {
+ const pmg = getFacetRecord(resource, platformData, 'pmg');
+ return getRecordVersion(pmg, 'version') || getRecordVersion(platformData, 'version');
+ }
+ case 'truenas': {
+ const truenas = getFacetRecord(resource, platformData, 'truenas');
+ return (
+ getRecordVersion(truenas, 'version', 'osVersion') ||
+ getRecordVersion(platformData, 'version') ||
+ getAgentPlatformVersion(resource, source)
+ );
+ }
+ case 'vmware-vsphere': {
+ const vmware = getFacetRecord(resource, platformData, 'vmware');
+ return getRecordVersion(
+ vmware,
+ 'version',
+ 'productVersion',
+ 'apiVersion',
+ 'vcenterVersion',
+ );
+ }
+ case 'kubernetes': {
+ const kubernetes = getFacetRecord(resource, platformData, 'kubernetes');
+ return getRecordVersion(kubernetes, 'version', 'serverVersion', 'gitVersion');
+ }
+ case 'docker': {
+ const docker = getFacetRecord(resource, platformData, 'docker');
+ return getRecordVersion(docker, 'runtimeVersion', 'dockerVersion', 'version');
+ }
+ case 'unraid':
+ return getAgentPlatformVersion(resource, source) || getRecordVersion(platformData, 'osVersion');
+ default:
+ return (
+ getRecordVersion(sourceRecord, 'version', 'osVersion', 'productVersion') ||
+ getRecordVersion(platformRecord, 'version', 'osVersion', 'productVersion')
+ );
+ }
+};
+
+const getVersionedSourceBadge = (
+ resource: Resource,
+ platformData: Record<string, unknown> | undefined,
+ source: KnownSourcePlatform,
+): ResourceBadge | null => {
+ const badge = getUnifiedSourceBadges([source])[0];
+ return badge
+ ? withBadgeVersion(badge, getSystemSourceVersion(resource, platformData, source))
+ : null;
+};
+
const getStorageSystemIdentityBadge = (
resource: Resource,
platformData: Record<string, unknown> | undefined,
@@ -391,11 +533,14 @@ const getStorageSystemIdentityBadge = (
const storage = getFacetRecord(resource, platformData, 'storage');
const topology = trimString(storage?.topology) || trimString(platformData?.topology);
const storageType = trimString(storage?.type) || trimString(platformData?.type);
- return {
- label: badge.label,
- classes: badge.classes,
- title: titleFromParts(badge.title, topology || storageType),
- };
+ return withBadgeVersion(
+ {
+ label: badge.label,
+ classes: badge.classes,
+ title: titleFromParts(badge.title, topology || storageType),
+ },
+ getSystemSourceVersion(resource, platformData, storagePlatform),
+ );
};
export function getInfrastructureSystemIdentityBadges(resource: Resource): ResourceBadge[] {
@@ -436,7 +581,8 @@ export function getInfrastructureSystemIdentityBadges(resource: Resource): Resou
const systemSource = firstSystemSource(sources, resource.platformType);
if (systemSource) {
- return buildUnifiedSourceBadges([systemSource]);
+ const badge = getVersionedSourceBadge(resource, platformData, systemSource);
+ return badge ? [badge] : [];
}
if (agentIdentityBadge) {
diff --git a/internal/platformsupport/manifest_generated.go b/internal/platformsupport/manifest_generated.go
index 6a2091683a..db95bb416a 100644
--- a/internal/platformsupport/manifest_generated.go
+++ b/internal/platformsupport/manifest_generated.go
@@ -1,7 +1,7 @@
// Code generated by scripts/release_control/generate_platform_support_backend_module.py.
// DO NOT EDIT.
// Source: docs/release-control/v6/internal/PLATFORM_SUPPORT_MANIFEST.json
-// Source SHA256: d9f0b92b967180e558b838714f7bd45e0ba982306ff8bd94866aa4ab60db5320
+// Source SHA256: 7126ef35ec2c2cda7e04b4a5496337d9d194926f7586af89fb3ae082fc7d6a2e
package platformsupport
@@ -13,7 +13,7 @@ const ManifestSourcePath = "docs/release-control/v6/internal/PLATFORM_SUPPORT_MA
// ManifestSourceSHA256 is the sha256 of the manifest bytes used to produce
// this projection.
-const ManifestSourceSHA256 = "d9f0b92b967180e558b838714f7bd45e0ba982306ff8bd94866aa4ab60db5320"
+const ManifestSourceSHA256 = "7126ef35ec2c2cda7e04b4a5496337d9d194926f7586af89fb3ae082fc7d6a2e"
// ManifestSchemaVersion is the schema_version field of the manifest.
const ManifestSchemaVersion = 1