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.

Add Machines row expansion affordance

rcourtman6bd5890b3b3d
diff --git a/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx b/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx
index 40c543a062..b69c91bee2 100644
--- a/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx
+++ b/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx
@@ -1,3 +1,4 @@
+import ChevronRightIcon from 'lucide-solid/icons/chevron-right';
import { For, Show, createMemo, createSignal, type Component, type JSX } from 'solid-js';
import { EnhancedCPUBar } from '@/components/Workloads/EnhancedCPUBar';
import { StackedDiskBar } from '@/components/Workloads/StackedDiskBar';
@@ -1063,6 +1064,12 @@ export const AgentsMachinesTable: Component<{
class={`${getPlatformTableCellClassForKind('name')} ${machineColumnWidthClass('machine')}`}
>
<div class="flex min-w-0 items-center gap-2">
+ <ChevronRightIcon
+ data-agent-machine-expand-icon
+ class="h-3.5 w-3.5 shrink-0 text-muted transition-transform duration-150"
+ classList={{ 'rotate-90': isExpanded() }}
+ aria-hidden="true"
+ />
<StatusDot
size="sm"
variant={indicator().variant}
@@ -1077,7 +1084,7 @@ export const AgentsMachinesTable: Component<{
when={machineSubtitle()}
fallback={
<span
- class="mt-0.5 block truncate pl-5 text-[9px] text-muted sm:text-[10px] md:hidden"
+ class="mt-0.5 block truncate pl-10 text-[9px] text-muted sm:text-[10px] md:hidden"
title={systemLabel()}
>
{systemLabel()}
@@ -1086,7 +1093,7 @@ export const AgentsMachinesTable: Component<{
>
{(subtitle) => (
<span
- class="mt-0.5 block truncate pl-5 text-[9px] text-muted sm:text-[10px]"
+ class="mt-0.5 block truncate pl-10 text-[9px] text-muted sm:text-[10px]"
title={subtitle()}
>
{subtitle()}
diff --git a/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsx b/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsx
index 4422ea66c9..23533a8595 100644
--- a/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsx
+++ b/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsx
@@ -171,6 +171,31 @@ describe('AgentsMachinesTable', () => {
expect(screen.getByText('richard-mac-mini.local | 192.168.0.98')).toBeInTheDocument();
});
+ it('shows a row expansion affordance for machine details', async () => {
+ const { container } = render(() => (
+ <AgentsMachinesTable
+ resources={[resource({ id: 'expandable-machine', name: 'Expandable Machine' })]}
+ emptyIcon={emptyIcon}
+ emptyTitle="No machines"
+ emptyDescription="Install Pulse Agent."
+ />
+ ));
+
+ const icon = container.querySelector('[data-agent-machine-expand-icon]');
+ expect(icon).not.toBeNull();
+ expect(icon).not.toHaveClass('rotate-90');
+ expect(screen.queryByTestId('resource-detail-drawer')).not.toBeInTheDocument();
+
+ const row = container.querySelector('[data-agents-machine-row="expandable-machine"]');
+ expect(row).not.toBeNull();
+ if (!row || !icon) return;
+
+ await fireEvent.click(row);
+
+ expect(icon).toHaveClass('rotate-90');
+ expect(screen.getByTestId('resource-detail-drawer')).toBeInTheDocument();
+ });
+
it('shows structured agent network interface details from the Net I/O value', async () => {
const { container } = render(() => (
<AgentsMachinesTable