fix: use SolidJS Show component for proper conditional rendering

addresses #370 - switched from JSX conditional expressions to SolidJS Show component for table column conditional rendering to ensure proper DOM updates
This commit is contained in:
Pulse Monitor
2025-08-29 06:56:16 +00:00
parent c3721ad5d4
commit adf4168f02
2 changed files with 4 additions and 4 deletions
@@ -694,14 +694,14 @@ export function Dashboard(props: DashboardProps) {
>
VMID {sortKey() === 'vmid' && (sortDirection() === 'asc' ? '▲' : '▼')}
</th>
{groupingMode() === 'flat' && (
<Show when={groupingMode() === 'flat'}>
<th
class="px-2 py-1.5 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider w-[100px] cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-600"
onClick={() => handleSort('node')}
>
Node {sortKey() === 'node' && (sortDirection() === 'asc' ? '▲' : '▼')}
</th>
)}
</Show>
<th
class="px-2 py-1.5 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider w-[100px] cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-600"
onClick={() => handleSort('uptime')}
@@ -156,11 +156,11 @@ export function GuestRow(props: GuestRowProps) {
</td>
{/* Node (optional) */}
{props.showNode && (
<Show when={props.showNode}>
<td class="p-1 px-2 text-sm text-gray-600 dark:text-gray-400">
{props.guest.node}
</td>
)}
</Show>
{/* Uptime */}
<td class={`p-1 px-2 text-sm whitespace-nowrap ${