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.

Use workloads-style flex-wrap drawer cards

rcourtman72daa5089312
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 749a713172..34910b3b8f 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -325,13 +325,13 @@ Type-specific Docker, PBS, and PMG operational panels now also live inside a
collapsed `Service details` support block, so lane-specific controls and
breakdowns stay available without displacing the common runtime and identity
hierarchy on first read.
-The drawer’s secondary support sections now share a responsive two-column
-card grid, so change history, service details, host details, investigation
-context, and discovery context read side by side on wider screens instead of
-as a single full-width stack.
-Host details uses that same grid pattern inside the disclosure for the system,
-hardware, storage, and network cards, so the drawer matches the shared
-workload-card density instead of stretching those cards one per row.
+The drawer’s secondary support sections now share the same responsive
+flex-wrap card-group pattern used by the workloads drawer, so change history,
+service details, host details, investigation context, and discovery context
+read side by side on wider screens instead of as a single full-width stack.
+Host details uses that same flex-wrap pattern inside the disclosure for the
+system, hardware, storage, and network cards, so the drawer matches the
+shared workload-card density instead of stretching those cards one per row.
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
diff --git a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
index 325e6cd459..1d1ab4bee0 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
@@ -1141,7 +1141,10 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
</div>
</div>
- <div data-testid="resource-secondary-sections" class="grid gap-3 sm:grid-cols-2">
+ <div
+ data-testid="resource-secondary-sections"
+ class="flex flex-wrap gap-3 [&>*]:flex-1 [&>*]:basis-[calc(50%-0.375rem)] [&>*]:min-w-[260px] [&>*]:max-w-full [&>*]:overflow-hidden"
+ >
<div
data-testid="resource-change-history-section"
class="h-full rounded border border-border bg-surface p-3 shadow-sm"
@@ -1373,18 +1376,18 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
</div>
</div>
- <Show when={hasServiceDetails()}>
- <SupportDisclosure
- title="Service details"
- summary={serviceDetailsSummary()}
- expanded={showServiceDetails()}
- onToggle={() => setShowServiceDetails((value) => !value)}
- showLabel="Show service details"
- hideLabel="Hide service details"
- class="h-full"
- contentClass="mt-3 space-y-3"
- dataTestId="resource-service-details-section"
- >
+ <Show when={hasServiceDetails()}>
+ <SupportDisclosure
+ title="Service details"
+ summary={serviceDetailsSummary()}
+ expanded={showServiceDetails()}
+ onToggle={() => setShowServiceDetails((value) => !value)}
+ showLabel="Show service details"
+ hideLabel="Hide service details"
+ class="h-full"
+ contentClass="mt-3 space-y-3"
+ dataTestId="resource-service-details-section"
+ >
<Show when={props.resource.type === 'docker-host'}>
<div class="rounded border border-sky-200 bg-sky-50 p-3 dark:border-sky-700 dark:bg-sky-900">
<div class="mb-2 flex items-center justify-between gap-2">
@@ -1792,22 +1795,21 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
);
}}
</Show>
- </SupportDisclosure>
- </Show>
- </div>
+ </SupportDisclosure>
+ </Show>
- <Show when={hasHostDetails()}>
- <SupportDisclosure
- title="Host details"
- summary={hostDetailSummary()}
- expanded={showHostDetails()}
- onToggle={() => setShowHostDetails((value) => !value)}
- showLabel="Show host details"
- hideLabel="Hide host details"
- class="h-full"
- contentClass="mt-3 grid gap-3 sm:grid-cols-2"
- dataTestId="resource-host-details-section"
- >
+ <Show when={hasHostDetails()}>
+ <SupportDisclosure
+ title="Host details"
+ summary={hostDetailSummary()}
+ expanded={showHostDetails()}
+ onToggle={() => setShowHostDetails((value) => !value)}
+ showLabel="Show host details"
+ hideLabel="Hide host details"
+ class="h-full"
+ contentClass="mt-3 flex flex-wrap gap-3 [&>*]:flex-1 [&>*]:basis-[calc(50%-0.375rem)] [&>*]:min-w-[220px] [&>*]:max-w-full [&>*]:overflow-hidden"
+ dataTestId="resource-host-details-section"
+ >
<Show when={proxmoxNode()}>
{(node) => (
<>
@@ -1829,21 +1831,21 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
</>
)}
</Show>
- </SupportDisclosure>
- </Show>
+ </SupportDisclosure>
+ </Show>
- <Show when={hasInvestigationContext()}>
- <SupportDisclosure
- title="Investigation context"
- summary={investigationContextSummary()}
- expanded={showInvestigationContext()}
- onToggle={() => setShowInvestigationContext((value) => !value)}
- showLabel="Show context"
- hideLabel="Hide context"
- class="h-full"
- contentClass="mt-3 space-y-3"
- dataTestId="resource-investigation-context"
- >
+ <Show when={hasInvestigationContext()}>
+ <SupportDisclosure
+ title="Investigation context"
+ summary={investigationContextSummary()}
+ expanded={showInvestigationContext()}
+ onToggle={() => setShowInvestigationContext((value) => !value)}
+ showLabel="Show context"
+ hideLabel="Hide context"
+ class="h-full"
+ contentClass="mt-3 space-y-3"
+ dataTestId="resource-investigation-context"
+ >
<Show when={resourceIntelligence()}>
{(intel) => (
<div class="space-y-1.5 text-[11px]">
@@ -1961,10 +1963,11 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
</Show>
</div>
</Show>
- </SupportDisclosure>
- </Show>
+ </SupportDisclosure>
+ </Show>
+ </div>
- <Show when={discoveryConfig()}>
+ <Show when={discoveryConfig()}>
{(config) => (
<div class="space-y-2">
<WebInterfaceUrlField
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 6da808d3f7..4f178b09c5 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
@@ -191,9 +191,9 @@ describe('ResourceDetailDrawer change history section', () => {
expect(screen.getByText('Current state')).toBeInTheDocument();
expect(screen.queryByText('Runtime')).toBeNull();
expect(screen.getByText('Change history')).toBeInTheDocument();
- expect(screen.getByTestId('resource-secondary-sections').classList.contains('grid')).toBe(true);
+ expect(screen.getByTestId('resource-secondary-sections').classList.contains('flex')).toBe(true);
expect(
- screen.getByTestId('resource-secondary-sections').classList.contains('sm:grid-cols-2'),
+ screen.getByTestId('resource-secondary-sections').classList.contains('flex-wrap'),
).toBe(true);
expect(
screen.getByTestId('resource-summary-section').querySelectorAll('.bg-surface-hover.px-2.py-2')
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 97ae7c52c9..7eb10743a8 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
@@ -224,15 +224,14 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
await waitFor(() => {
expect(getByText('Hardware')).toBeInTheDocument();
});
- expect(getByTestId('resource-secondary-sections').classList.contains('grid')).toBe(true);
+ expect(getByTestId('resource-secondary-sections').classList.contains('flex')).toBe(true);
expect(
- getByTestId('resource-secondary-sections').classList.contains('sm:grid-cols-2'),
+ getByTestId('resource-secondary-sections').classList.contains('flex-wrap'),
).toBe(true);
- expect(getByTestId('resource-host-details-section').querySelector('.mt-3.grid.gap-3')).toBeTruthy();
+ expect(getByTestId('resource-host-details-section').querySelector('.mt-3.flex.flex-wrap')).toBeTruthy();
expect(
- getByTestId('resource-host-details-section').querySelector('.mt-3.grid.gap-3')?.classList.contains('sm:grid-cols-2'),
+ getByTestId('resource-host-details-section').querySelector('.mt-3.flex.flex-wrap')?.classList.contains('[&>*]:min-w-[220px]'),
).toBe(true);
- expect(getByTestId('resource-host-details-section').querySelector('.mt-3.flex.flex-wrap')).toBeNull();
expect(getByText('Network')).toBeInTheDocument();
expect(getByText('Disks')).toBeInTheDocument();
expect(getByText('eth0')).toBeInTheDocument();