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.

Compress resource drawer discovery context

rcourtmanb3de6811ba2d
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 1fa23ce3ea..209bc15a79 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -260,6 +260,10 @@ Discovery support now also lives inside overview-only `Discovery context`
instead of a peer drawer tab, so supplemental discovery detail stays available
without claiming the same navigation weight as runtime, identity, or
service-specific operational views.
+That discovery surface is now a compact support row with a one-line summary and
+an on-demand metadata panel, so the actionable web-interface path stays primary
+while deeper discovery inspection remains available without reading like a
+second peer overview surface.
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 db6eadea51..c433491e75 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
@@ -539,6 +539,17 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
);
const hasMergedSources = createMemo(() => mergedSources().length > 1);
const discoveryConfig = createMemo(() => toDiscoveryConfig(props.resource));
+ const discoveryContextSummary = createMemo(() => {
+ const config = discoveryConfig();
+ if (!config) return null;
+
+ const discoveryMode =
+ config.resourceType === 'agent'
+ ? 'Host discovery'
+ : `${formatIdentifierLabel(config.resourceType)} discovery`;
+
+ return config.hostname ? `${discoveryMode} via ${config.hostname}` : discoveryMode;
+ });
const workloadsHref = createMemo(() => buildWorkloadsHref(props.resource));
const headerIdentity = createMemo(() => getPrimaryResourceIdentity(props.resource));
const relatedLinks = createMemo(() => {
@@ -1507,35 +1518,43 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
<Show when={discoveryConfig()}>
{(config) => (
- <div class="mt-3 space-y-3">
+ <div class="mt-3 space-y-2">
<WebInterfaceUrlField
metadataKind={config().metadataKind}
metadataId={config().metadataId}
targetLabel={config().targetLabel}
/>
- <div class="rounded border border-border bg-surface p-3">
+ <div class="rounded border border-dashed border-border bg-surface-hover p-3">
<div class="flex flex-wrap items-start justify-between gap-3">
<div>
<div class="text-[11px] font-medium uppercase tracking-wide text-base-content">
Discovery context
</div>
<div class="mt-1 text-[10px] text-muted">
- Supporting discovery details for this {config().targetLabel}.
+ Supporting metadata only. The web interface path above stays primary.
</div>
+ <Show when={discoveryContextSummary()}>
+ <div class="mt-1 text-[10px] text-base-content">
+ {discoveryContextSummary()}
+ </div>
+ </Show>
</div>
<button
type="button"
onClick={() => setShowDiscoveryContext((value) => !value)}
- class="inline-flex items-center rounded-md border border-border bg-surface-hover px-3 py-1.5 text-[11px] font-medium text-base-content transition-colors hover:bg-surface"
+ class="inline-flex items-center rounded-md border border-border bg-surface px-2.5 py-1 text-[10px] font-medium text-base-content transition-colors hover:bg-base"
>
- {showDiscoveryContext() ? 'Hide details' : 'Show details'}
+ {showDiscoveryContext() ? 'Hide metadata' : 'Show metadata'}
</button>
</div>
<Show when={showDiscoveryContext()}>
- <div class="mt-3">
+ <div class="mt-3 rounded border border-border bg-surface p-2.5">
+ <div class="mb-2 text-[10px] text-muted">
+ Detailed discovery metadata for this {config().targetLabel}.
+ </div>
<Suspense
fallback={
<div class="flex items-center justify-center py-8">
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 b992b30d39..1f00b360ad 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
@@ -187,6 +187,11 @@ describe('ResourceDetailDrawer change history section', () => {
const changeHistorySection = screen.getByTestId('resource-change-history-section');
expect(screen.queryByRole('button', { name: 'Discovery' })).toBeNull();
expect(screen.getByText('Change history')).toBeInTheDocument();
+ expect(screen.getByText('Discovery context')).toBeInTheDocument();
+ expect(
+ screen.getByText('Supporting metadata only. The web interface path above stays primary.'),
+ ).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: 'Show metadata' })).toBeInTheDocument();
expect(within(changeHistorySection).getByText('Recent activity')).toBeInTheDocument();
expect(screen.queryByText('Events')).toBeNull();
expect(screen.getAllByText('Timeline 3')).toHaveLength(1);
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 8853feaa8d..58c47b1caa 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
@@ -134,9 +134,13 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
expect(queryByRole('button', { name: 'Discovery' })).toBeNull();
expect(getByText('Discovery context')).toBeInTheDocument();
+ expect(
+ getByText('Supporting metadata only. The web interface path above stays primary.'),
+ ).toBeInTheDocument();
+ expect(getByText('Host discovery via host-1')).toBeInTheDocument();
expect(queryByTestId('discovery-tab')).toBeNull();
- fireEvent.click(getByRole('button', { name: 'Show details' }));
+ fireEvent.click(getByRole('button', { name: 'Show metadata' }));
await waitFor(() => {
expect(queryByTestId('discovery-tab')).toBeInTheDocument();