mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-21 02:33:32 +00:00
fix: only show matched count in node table when there's an actual search term
This commit is contained in:
@@ -345,6 +345,7 @@ export function Dashboard(props: DashboardProps) {
|
||||
onNodeSelect={handleNodeSelect}
|
||||
filteredVms={filteredGuests().filter(g => g.type === 'qemu')}
|
||||
filteredContainers={filteredGuests().filter(g => g.type === 'lxc')}
|
||||
searchTerm={search()}
|
||||
/>
|
||||
|
||||
{/* Removed old node table - keeping the rest unchanged */}
|
||||
|
||||
@@ -12,6 +12,7 @@ interface PVENodeTableProps {
|
||||
currentTab: 'dashboard' | 'storage' | 'backups';
|
||||
selectedNode: string | null;
|
||||
onNodeClick: (nodeId: string) => void;
|
||||
searchTerm?: string;
|
||||
}
|
||||
|
||||
export const PVENodeTable: Component<PVENodeTableProps> = (props) => {
|
||||
@@ -181,7 +182,7 @@ export const PVENodeTable: Component<PVENodeTableProps> = (props) => {
|
||||
<div class="flex items-center gap-2">
|
||||
<span class={`h-2 w-2 rounded-full ${isOnline() ? 'bg-green-500' : 'bg-red-500'}`}></span>
|
||||
<span class="text-sm font-medium text-gray-900 dark:text-gray-100">{node.name}</span>
|
||||
<Show when={filteredGuestCount() !== null}>
|
||||
<Show when={filteredGuestCount() !== null && props.searchTerm && props.searchTerm.trim()}>
|
||||
<span class="text-xs text-gray-500 dark:text-gray-400">
|
||||
({filteredGuestCount()} matched)
|
||||
</span>
|
||||
|
||||
@@ -8,6 +8,7 @@ interface UnifiedNodeSelectorProps {
|
||||
onNodeSelect?: (nodeId: string | null, nodeType: 'pve' | 'pbs' | null) => void;
|
||||
filteredVms?: any[];
|
||||
filteredContainers?: any[];
|
||||
searchTerm?: string;
|
||||
}
|
||||
|
||||
export const UnifiedNodeSelector: Component<UnifiedNodeSelectorProps> = (props) => {
|
||||
@@ -90,6 +91,7 @@ export const UnifiedNodeSelector: Component<UnifiedNodeSelectorProps> = (props)
|
||||
currentTab={props.currentTab}
|
||||
selectedNode={selectedNode()}
|
||||
onNodeClick={handlePVENodeClick}
|
||||
searchTerm={props.searchTerm}
|
||||
/>
|
||||
</Show>
|
||||
<Show when={props.currentTab === 'backups' && state.pbs && state.pbs.length > 0}>
|
||||
|
||||
Reference in New Issue
Block a user