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.

Demote discovery within resource drawer

rcourtman0cecec086856
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index fa70da6d96..26e11478bc 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -249,6 +249,10 @@ The drawer header now stays focused on canonical identity and source/type
badges only, while workload/service drill-down links and Kubernetes platform
signals live with the runtime card, so the top strip does not compete with
the resource name, status, or primary identity line.
+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.
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 276412434b..2060d2ce4f 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
@@ -135,13 +135,13 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
| 'namespaces'
| 'deployments'
| 'swarm'
- | 'discovery'
| 'debug';
const [activeTab, setActiveTab] = createSignal<DrawerTab>('overview');
const [debugEnabled] = createLocalStorageBooleanSignal(STORAGE_KEYS.DEBUG_MODE, false);
const [copied, setCopied] = createSignal(false);
const [showReportModal, setShowReportModal] = createSignal(false);
const [showInvestigationContext, setShowInvestigationContext] = createSignal(false);
+ const [showDiscoveryContext, setShowDiscoveryContext] = createSignal(false);
const displayName = createMemo(() => getPreferredResourceDisplayName(props.resource));
const kubernetesClusterName = createMemo(() =>
@@ -622,7 +622,6 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
...(props.resource.type === 'docker-host' && dockerSwarmClusterKey()
? [{ id: 'swarm' as DrawerTab, label: 'Swarm' }]
: []),
- { id: 'discovery' as DrawerTab, label: 'Discovery' },
];
if (debugEnabled()) {
base.push({ id: 'debug' as DrawerTab, label: 'Debug' });
@@ -1474,12 +1473,55 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
<Show when={discoveryConfig()}>
{(config) => (
- <div class="mt-3">
+ <div class="mt-3 space-y-3">
<WebInterfaceUrlField
metadataKind={config().metadataKind}
metadataId={config().metadataId}
targetLabel={config().targetLabel}
/>
+
+ <div class="rounded border border-border bg-surface 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}.
+ </div>
+ </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"
+ >
+ {showDiscoveryContext() ? 'Hide details' : 'Show details'}
+ </button>
+ </div>
+
+ <Show when={showDiscoveryContext()}>
+ <div class="mt-3">
+ <Suspense
+ fallback={
+ <div class="flex items-center justify-center py-8">
+ <div class="animate-spin h-6 w-6 border-2 border-blue-500 border-t-transparent rounded-full" />
+ <span class="ml-2 text-sm text-muted">
+ {getDiscoveryLoadingState().text}
+ </span>
+ </div>
+ }
+ >
+ <DiscoveryTab
+ resourceType={config().resourceType}
+ agentId={config().agentId}
+ resourceId={config().resourceId}
+ hostname={config().hostname}
+ />
+ </Suspense>
+ </div>
+ </Show>
+ </div>
</div>
)}
</Show>
@@ -1719,39 +1761,6 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
</div>
</div>
- {/* Discovery Tab */}
- <div
- class={activeTab() === 'discovery' ? '' : 'hidden'}
- style={{ 'overflow-anchor': 'none' }}
- >
- <Show
- when={discoveryConfig()}
- fallback={
- <div class="rounded border border-dashed border-border bg-surface-hover p-4 text-sm">
- Discovery is not available for this resource type yet.
- </div>
- }
- >
- {(config) => (
- <Suspense
- fallback={
- <div class="flex items-center justify-center py-8">
- <div class="animate-spin h-6 w-6 border-2 border-blue-500 border-t-transparent rounded-full" />
- <span class="ml-2 text-sm text-muted">{getDiscoveryLoadingState().text}</span>
- </div>
- }
- >
- <DiscoveryTab
- resourceType={config().resourceType}
- agentId={config().agentId}
- resourceId={config().resourceId}
- hostname={config().hostname}
- />
- </Suspense>
- )}
- </Show>
- </div>
-
{/* PMG Mail Tab */}
<div class={activeTab() === 'mail' ? '' : 'hidden'} style={{ 'overflow-anchor': 'none' }}>
{/* Mount on-demand to avoid background fetching when the tab isn't open. */}
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 8683a38a9a..b932feb034 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
@@ -184,6 +184,7 @@ describe('ResourceDetailDrawer change history section', () => {
));
await screen.findByText('Changes loaded');
+ expect(screen.queryByRole('button', { name: 'Discovery' })).toBeNull();
expect(screen.getByText('Change history')).toBeInTheDocument();
expect(screen.getByText('Recent activity')).toBeInTheDocument();
expect(screen.getByText('Events')).toBeInTheDocument();
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 a5fbb17237..fd78f37a56 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
@@ -127,6 +127,22 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
);
});
+ it('keeps discovery as secondary overview context instead of a peer tab', async () => {
+ const { getByRole, getByText, queryByRole, queryByTestId } = render(() => (
+ <ResourceDetailDrawer resource={baseResource({})} />
+ ));
+
+ expect(queryByRole('button', { name: 'Discovery' })).toBeNull();
+ expect(getByText('Discovery context')).toBeInTheDocument();
+ expect(queryByTestId('discovery-tab')).toBeNull();
+
+ fireEvent.click(getByRole('button', { name: 'Show details' }));
+
+ await waitFor(() => {
+ expect(queryByTestId('discovery-tab')).toBeInTheDocument();
+ });
+ });
+
it('falls back to source list summary when per-source health is unavailable', () => {
const resource = baseResource({
sourceType: 'api',