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.

Reduce resource drawer tab fallback copy

rcourtmand8ee69de1b0e
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index fe23d558f9..36338fd354 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -294,6 +294,10 @@ When `Service details` is expanded, each service card remains summary-first and
pushes heavier breakdowns or update controls behind one more service-local
reveal, so the opened state still scans as current state before deeper
operations.
+Unsupported secondary tabs now also use the same terse availability notices
+(`PMG resources only.`, `Kubernetes clusters only.`, `Docker runtimes with
+Swarm only.`) instead of explanatory sentences, so mismatch fallback state
+stays readable without turning support surfaces into inline documentation.
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 cadaf3e0e0..794e6f9569 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
@@ -152,6 +152,26 @@ const SupportDisclosure: Component<SupportDisclosureProps> = (props) => {
);
};
+const TabAvailabilityNotice: Component<{ message: string }> = (props) => (
+ <div class="rounded border border-dashed border-border bg-surface-hover p-4 text-sm text-muted">
+ {props.message}
+ </div>
+);
+
+type SpecializedDrawerTab = 'mail' | 'namespaces' | 'deployments' | 'swarm';
+
+export const getSpecializedTabAvailabilityMessage = (tab: SpecializedDrawerTab): string => {
+ switch (tab) {
+ case 'mail':
+ return 'PMG resources only.';
+ case 'namespaces':
+ case 'deployments':
+ return 'Kubernetes clusters only.';
+ case 'swarm':
+ return 'Docker runtimes with Swarm only.';
+ }
+};
+
const timelineKindOptions: Array<{ label: string; value: ResourceChangeKind | '' }> = [
{ label: 'All kinds', value: '' },
...RESOURCE_CHANGE_KIND_ORDER.map((kind) => ({
@@ -2019,11 +2039,7 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
<Show when={activeTab() === 'mail'}>
<Show
when={props.resource.type === 'pmg'}
- fallback={
- <div class="rounded border border-dashed border-border bg-surface-hover p-4 text-sm text-muted">
- Mail details are only available for PMG resources.
- </div>
- }
+ fallback={<TabAvailabilityNotice message={getSpecializedTabAvailabilityMessage('mail')} />}
>
<PMGInstanceDrawer
resourceId={props.resource.id}
@@ -2043,9 +2059,9 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
<Show
when={props.resource.type === 'k8s-cluster'}
fallback={
- <div class="rounded border border-dashed border-border bg-surface-hover p-4 text-sm text-muted">
- Namespaces are only available for Kubernetes cluster resources.
- </div>
+ <TabAvailabilityNotice
+ message={getSpecializedTabAvailabilityMessage('namespaces')}
+ />
}
>
<K8sNamespacesDrawer
@@ -2069,9 +2085,9 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
<Show
when={props.resource.type === 'k8s-cluster'}
fallback={
- <div class="rounded border border-dashed border-border bg-surface-hover p-4 text-sm text-muted">
- Deployments are only available for Kubernetes cluster resources.
- </div>
+ <TabAvailabilityNotice
+ message={getSpecializedTabAvailabilityMessage('deployments')}
+ />
}
>
<K8sDeploymentsDrawer
@@ -2089,9 +2105,7 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
<Show
when={props.resource.type === 'docker-host' && dockerSwarmClusterKey()}
fallback={
- <div class="rounded border border-dashed border-border bg-surface-hover p-4 text-sm text-muted">
- Swarm details are only available for Docker runtimes reporting Swarm metadata.
- </div>
+ <TabAvailabilityNotice message={getSpecializedTabAvailabilityMessage('swarm')} />
}
>
<SwarmServicesDrawer cluster={dockerSwarmClusterKey()} swarm={dockerSwarmInfo()} />
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 44669e3244..c61b8f132b 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
@@ -190,7 +190,18 @@ describe('ResourceDetailDrawer change history section', () => {
expect(screen.queryByText('Host details')).toBeNull();
expect(screen.queryByText('Service details')).toBeNull();
expect(screen.queryByText('Supporting context')).toBeNull();
- expect(screen.queryByText('No identity metadata yet.')).toBeNull();
+ expect(screen.queryByText('Mail details are only available for PMG resources.')).toBeNull();
+ expect(
+ screen.queryByText('Namespaces are only available for Kubernetes cluster resources.'),
+ ).toBeNull();
+ expect(
+ screen.queryByText('Deployments are only available for Kubernetes cluster resources.'),
+ ).toBeNull();
+ expect(
+ screen.queryByText(
+ 'Swarm details are only available for Docker runtimes reporting Swarm metadata.',
+ ),
+ ).toBeNull();
expect(screen.getByText('Discovery context')).toBeInTheDocument();
expect(
screen.queryByText('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 d65f05cf86..59c7ee3b6c 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
@@ -2,7 +2,10 @@ import { describe, expect, it, vi } from 'vitest';
import { fireEvent, render, waitFor } from '@solidjs/testing-library';
import type { Resource } from '@/types/resource';
-import { ResourceDetailDrawer } from '@/components/Infrastructure/ResourceDetailDrawer';
+import {
+ ResourceDetailDrawer,
+ getSpecializedTabAvailabilityMessage,
+} from '@/components/Infrastructure/ResourceDetailDrawer';
const wsState = vi.hoisted(() => ({ pmg: [] as any[] }));
const reconnectSpy = vi.hoisted(() => vi.fn());
@@ -148,6 +151,17 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
});
});
+ it('uses terse availability notices for specialized tabs', () => {
+ expect(getSpecializedTabAvailabilityMessage('mail')).toBe('PMG resources only.');
+ expect(getSpecializedTabAvailabilityMessage('namespaces')).toBe('Kubernetes clusters only.');
+ expect(getSpecializedTabAvailabilityMessage('deployments')).toBe(
+ 'Kubernetes clusters only.',
+ );
+ expect(getSpecializedTabAvailabilityMessage('swarm')).toBe(
+ 'Docker runtimes with Swarm only.',
+ );
+ });
+
it('keeps host detail cards behind a secondary overview disclosure', async () => {
const resource = baseResource({
platformData: {