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.

Hide generic drawer workloads links

rcourtmanab8416f25e82
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index dd4e0289f2..3e9cda206e 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -412,6 +412,10 @@ the resource name, status, or primary identity line.
That header badge row now also deduplicates identical visible labels, so
agent-backed nodes do not repeat `Agent` when both the canonical resource type
and a merged source resolve to the same badge text.
+The summary shell's `Quick links` row now only promotes runtime-scoped
+workloads drill-down routes, so ordinary host drawers do not surface a generic
+host-wide `Workloads` jump that reads like default navigation chrome instead of
+resource-specific operational context.
Inside that summary, the operational and supporting context rows stay inline
instead of sitting in a collapsed `Details` disclosure or nested bordered
cards, so the first read stays like one linear sheet rather than a stack of
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 c92e715cb5..2758396914 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
@@ -117,7 +117,7 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
},
});
- const { getByRole, getByTestId, getByText, queryByRole } = render(() => (
+ const { getByTestId, getByText, queryByRole } = render(() => (
<ResourceDetailDrawer resource={resource} />
));
@@ -128,13 +128,11 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
expect(getByText('Mode')).toBeInTheDocument();
expect(getByText('Hybrid')).toBeInTheDocument();
expect(() => getByText('Platform ID')).toThrow();
- expect(getByText('Quick links')).toBeInTheDocument();
+ expect(() => getByText('Quick links')).toThrow();
expect(getByTestId('resource-current-state-section').querySelector('.border-dashed')).toBeNull();
expect(queryByRole('button', { name: 'Show details' })).toBeNull();
expect(() => getByText('Runtime')).toThrow();
- expect(getByRole('link', { name: 'Open related workloads for host-1' })).toHaveTextContent(
- 'Workloads',
- );
+ expect(queryByRole('link', { name: 'Open related workloads for host-1' })).toBeNull();
const headerBadges = getByTestId('resource-header-badges');
expect(within(headerBadges).getAllByText('Agent')).toHaveLength(1);
expect(within(headerBadges).getByText('PVE')).toBeInTheDocument();
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.test.ts
index f0dc4308d2..91791e0c76 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.test.ts
@@ -138,4 +138,17 @@ describe('resourceDetailDrawerOperationalModel', () => {
},
]);
});
+
+ it('omits generic host-wide workloads links from drawer quick links', () => {
+ expect(
+ buildRelatedLinks(
+ baseResource({
+ type: 'agent',
+ platformType: 'agent',
+ platformData: { sources: ['agent'], agent: { hostname: 'host-1' } },
+ }),
+ 'Host 1',
+ ),
+ ).toEqual([]);
+ });
});
diff --git a/frontend-modern/src/components/Infrastructure/resourceDetailDrawerOperationalModel.ts b/frontend-modern/src/components/Infrastructure/resourceDetailDrawerOperationalModel.ts
index decbdaf58b..fe5e0b6139 100644
--- a/frontend-modern/src/components/Infrastructure/resourceDetailDrawerOperationalModel.ts
+++ b/frontend-modern/src/components/Infrastructure/resourceDetailDrawerOperationalModel.ts
@@ -182,7 +182,9 @@ export const buildRelatedLinks = (
): ResourceDetailDrawerOperationalLink[] => {
const links: ResourceDetailDrawerOperationalLink[] = [];
const workloads = buildWorkloadsHref(resource);
- if (workloads) {
+ const workloadSearch = workloads ? new URLSearchParams(workloads.split('?')[1] ?? '') : null;
+ const scopedWorkloadType = workloadSearch?.get('type')?.trim() ?? '';
+ if (workloads && scopedWorkloadType) {
links.push({
href: workloads,
label: 'Open in Workloads',