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.

Separate primary identity from supporting context

rcourtman1adbdbac4ad5
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index be32bd65ca..ab1fb80135 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -272,6 +272,10 @@ Within the runtime card, current-state facts now stay in the primary summary
while platform IDs, quick links, and platform-signal badges live in a smaller
`Operational context` block, so first read remains status-first instead of
mixing state and supporting action surfaces together.
+The identity card now follows the same rule: canonical identity rows stay in
+the primary summary, while aliases, IPs, and tags live in a smaller
+`Supporting context` block so the drawer answers "what is this resource" before
+showing every attached label.
The same facet bundle now also returns grouped recent-change counts by
canonical change kind, so the detail drawer can surface the distribution of
state transitions, restarts, config updates, and anomalies without
diff --git a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
index 1b2396305e..029d9157f4 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
@@ -538,6 +538,24 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
const hasAliasOverflow = createMemo(
() => identityAliasValues().length > ALIAS_COLLAPSE_THRESHOLD,
);
+ const hasIdentitySupportContext = createMemo(
+ () =>
+ (props.resource.identity?.ips?.length ?? 0) > 0 ||
+ (props.resource.tags?.length ?? 0) > 0 ||
+ identityAliasValues().length > 0,
+ );
+ const identitySupportSummary = createMemo(() => {
+ const parts: string[] = [];
+ const ipCount = props.resource.identity?.ips?.length ?? 0;
+ const tagCount = props.resource.tags?.length ?? 0;
+ const aliasCount = identityAliasValues().length;
+
+ if (ipCount > 0) parts.push(`${ipCount} IP${ipCount === 1 ? '' : 's'}`);
+ if (tagCount > 0) parts.push(`${tagCount} tag${tagCount === 1 ? '' : 's'}`);
+ if (aliasCount > 0) parts.push(`${aliasCount} alias${aliasCount === 1 ? '' : 'es'}`);
+
+ return parts.join(' · ');
+ });
const hasMergedSources = createMemo(() => mergedSources().length > 1);
const discoveryConfig = createMemo(() => toDiscoveryConfig(props.resource));
const discoveryContextSummary = createMemo(() => {
@@ -939,69 +957,81 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
</div>
)}
</For>
- <Show when={props.resource.identity?.ips && props.resource.identity.ips.length > 0}>
- <div class="flex flex-col gap-1">
- <span class="text-muted">IP Addresses</span>
- <div class="flex flex-wrap gap-1">
- <For each={props.resource.identity?.ips ?? []}>
- {(ip) => (
- <span
- class="inline-flex items-center rounded bg-blue-100 px-1.5 py-0.5 text-[10px] text-blue-700 dark:bg-blue-900 dark:text-blue-200"
- title={ip}
- >
- {ip}
- </span>
- )}
- </For>
+ <Show when={hasIdentitySupportContext()}>
+ <div class="mt-2 rounded border border-border bg-surface-hover px-2 py-2">
+ <div class="text-[10px] font-medium uppercase tracking-wide text-base-content">
+ Supporting context
</div>
- </div>
- </Show>
- <Show when={props.resource.tags && props.resource.tags.length > 0}>
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">Tags</span>
- <TagBadges tags={props.resource.tags} maxVisible={6} />
- </div>
- </Show>
- <Show when={identityAliasValues().length > 0}>
- <Show
- when={hasAliasOverflow()}
- fallback={
- <div class="flex flex-col gap-1">
- <span class="text-muted">Aliases</span>
- <div class="flex flex-wrap gap-1">
- <For each={aliasPreviewValues()}>
- {(value) => (
- <span
- class="inline-flex items-center rounded bg-surface-alt px-1.5 py-0.5 text-[10px]"
- title={value}
- >
- {value}
- </span>
- )}
- </For>
+ <Show when={identitySupportSummary()}>
+ <div class="mt-1 text-[10px] text-muted">{identitySupportSummary()}</div>
+ </Show>
+ <div class="mt-2 space-y-1.5">
+ <Show when={props.resource.identity?.ips && props.resource.identity.ips.length > 0}>
+ <div class="flex flex-col gap-1">
+ <span class="text-muted">IP Addresses</span>
+ <div class="flex flex-wrap gap-1">
+ <For each={props.resource.identity?.ips ?? []}>
+ {(ip) => (
+ <span
+ class="inline-flex items-center rounded bg-blue-100 px-1.5 py-0.5 text-[10px] text-blue-700 dark:bg-blue-900 dark:text-blue-200"
+ title={ip}
+ >
+ {ip}
+ </span>
+ )}
+ </For>
+ </div>
</div>
- </div>
- }
- >
- <details class="rounded border border-border bg-surface px-2 py-1.5">
- <summary class="flex cursor-pointer list-none items-center justify-between text-[10px] font-medium text-muted">
- <span>Aliases</span>
- <span class="text-muted">{identityAliasValues().length}</span>
- </summary>
- <div class="mt-2 flex flex-wrap gap-1 border-t border-border pt-2">
- <For each={identityAliasValues()}>
- {(value) => (
- <span
- class="inline-flex items-center rounded bg-surface-alt px-1.5 py-0.5 text-[10px]"
- title={value}
- >
- {value}
- </span>
- )}
- </For>
- </div>
- </details>
- </Show>
+ </Show>
+ <Show when={props.resource.tags && props.resource.tags.length > 0}>
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted">Tags</span>
+ <TagBadges tags={props.resource.tags} maxVisible={6} />
+ </div>
+ </Show>
+ <Show when={identityAliasValues().length > 0}>
+ <Show
+ when={hasAliasOverflow()}
+ fallback={
+ <div class="flex flex-col gap-1">
+ <span class="text-muted">Aliases</span>
+ <div class="flex flex-wrap gap-1">
+ <For each={aliasPreviewValues()}>
+ {(value) => (
+ <span
+ class="inline-flex items-center rounded bg-surface-alt px-1.5 py-0.5 text-[10px]"
+ title={value}
+ >
+ {value}
+ </span>
+ )}
+ </For>
+ </div>
+ </div>
+ }
+ >
+ <details class="rounded border border-border bg-surface px-2 py-1.5">
+ <summary class="flex cursor-pointer list-none items-center justify-between text-[10px] font-medium text-muted">
+ <span>Aliases</span>
+ <span class="text-muted">{identityAliasValues().length}</span>
+ </summary>
+ <div class="mt-2 flex flex-wrap gap-1 border-t border-border pt-2">
+ <For each={identityAliasValues()}>
+ {(value) => (
+ <span
+ class="inline-flex items-center rounded bg-surface-alt px-1.5 py-0.5 text-[10px]"
+ title={value}
+ >
+ {value}
+ </span>
+ )}
+ </For>
+ </div>
+ </details>
+ </Show>
+ </Show>
+ </div>
+ </div>
</Show>
<Show when={!identityCardHasRichData()}>
<div class="rounded border border-dashed bg-surface-hover px-2 py-1.5 text-[10px] ">
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
index 272c7cbf9b..23e66cd707 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
@@ -188,6 +188,7 @@ describe('ResourceDetailDrawer change history section', () => {
expect(screen.queryByRole('button', { name: 'Discovery' })).toBeNull();
expect(screen.getByText('Change history')).toBeInTheDocument();
expect(screen.queryByText('Host details')).toBeNull();
+ expect(screen.queryByText('Supporting context')).toBeNull();
expect(screen.getByText('Discovery context')).toBeInTheDocument();
expect(
screen.getByText('Supporting metadata only. The web interface path above stays primary.'),
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx
index bac0c020b3..a83c6e9157 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx
@@ -247,6 +247,7 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
));
expect(getByText('Identity')).toBeInTheDocument();
+ expect(getByText('Supporting context')).toBeInTheDocument();
expect(getByText('Aliases')).toBeInTheDocument();
expect(getAllByText('pmg-main').length).toBeGreaterThan(0);
expect(queryByText('No enriched identity metadata yet.')).toBeNull();
@@ -325,6 +326,7 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
});
const inlineRender = render(() => <ResourceDetailDrawer resource={inlineResource} />);
+ expect(inlineRender.getByText('Supporting context')).toBeInTheDocument();
expect(inlineRender.getByText('Aliases')).toBeInTheDocument();
expect(inlineRender.container.querySelector('details')).toBeNull();
expect(inlineRender.getByText('agent-inline-1')).toBeInTheDocument();
@@ -354,6 +356,7 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
});
const overflowRender = render(() => <ResourceDetailDrawer resource={overflowResource} />);
+ expect(overflowRender.getByText('Supporting context')).toBeInTheDocument();
expect(overflowRender.getByText('Aliases')).toBeInTheDocument();
expect(overflowRender.container.querySelector('details')).toBeTruthy();
});