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.

Keep memory dialog dismissal separate from the resource row

pulse-triage[bot]d53b9dd2686f
diff --git a/frontend-modern/src/components/Workloads/StackedMemoryBar.tsx b/frontend-modern/src/components/Workloads/StackedMemoryBar.tsx
index 86cd886b3f..f4104ea859 100644
--- a/frontend-modern/src/components/Workloads/StackedMemoryBar.tsx
+++ b/frontend-modern/src/components/Workloads/StackedMemoryBar.tsx
@@ -21,6 +21,10 @@ export function StackedMemoryBar(props: StackedMemoryBarProps) {
class={`metric-text relative w-full flex items-center justify-center ${props.detailsLabel ? 'h-11 sm:h-6' : 'h-4'}`}
onMouseEnter={state.handleMouseEnter}
onMouseLeave={state.handleMouseLeave}
+ onClick={(event) => {
+ // Portal dismissal must not reach a table row's separate action.
+ if (props.detailsLabel) event.stopPropagation();
+ }}
>
<div class="relative w-full h-4 overflow-hidden bg-surface-hover rounded-sm">
<svg
diff --git a/frontend-modern/src/features/truenas/__tests__/TrueNASSystemMemory.test.tsx b/frontend-modern/src/features/truenas/__tests__/TrueNASSystemMemory.test.tsx
index d95e0b4bce..381657ad03 100644
--- a/frontend-modern/src/features/truenas/__tests__/TrueNASSystemMemory.test.tsx
+++ b/frontend-modern/src/features/truenas/__tests__/TrueNASSystemMemory.test.tsx
@@ -143,17 +143,25 @@ describe('TrueNAS system memory inspection through the actual table', () => {
setSystems(0, 'agent', 'memory', 'cache', undefined);
expect(within(dialog).queryByText('Reclaimable cache')).toBeNull();
expect(rowValue(dialog, 'Free')).toHaveTextContent('20.0 GB');
- setSystems(0, 'status', 'offline');
+ setSystems(0, 'status', 'unknown');
expect(screen.queryByRole('dialog')).toBeNull();
expect(screen.queryByRole('button', { name: 'Memory composition for nas-core' })).toBeNull();
expect(document.body.style.overflow).not.toBe('hidden');
});
- it('offers no composition from an unreported metric or disconnected system', () => {
- mount([system({ memory: undefined }), system({ id: 'offline', status: 'offline' })]);
+ it('offers no composition from an unreported metric or unknown system', () => {
+ mount([system({ memory: undefined }), system({ id: 'unknown', status: 'unknown' })]);
expect(screen.queryByRole('button', { name: /Memory composition for/ })).toBeNull();
});
+ it('dismisses by backdrop without forwarding the click to the enclosing resource row', () => {
+ const { container } = mount();
+ fireEvent.click(screen.getByRole('button', { name: 'Memory composition for nas-core' }));
+ fireEvent.click(document.querySelector('[data-dialog-backdrop]')!);
+ expect(screen.queryByRole('dialog')).toBeNull();
+ expect(container.querySelector('[data-inline-platform-resource-detail-for]')).toBeNull();
+ });
+
it('leaves non-opted-in shared bars without new controls', () => {
render(() => <StackedMemoryBar used={10 * GB} total={32 * GB} cache={20 * GB} />);
expect(screen.queryByRole('button')).toBeNull();