diff --git a/frontend-modern/src/components/Backups/UnifiedBackups.tsx b/frontend-modern/src/components/Backups/UnifiedBackups.tsx index 3d0d048b8..0049ff974 100644 --- a/frontend-modern/src/components/Backups/UnifiedBackups.tsx +++ b/frontend-modern/src/components/Backups/UnifiedBackups.tsx @@ -44,7 +44,28 @@ const UnifiedBackups: Component = () => { const [selectedDateRange, setSelectedDateRange] = createSignal<{ start: number; end: number } | null>(null); const [chartTimeRange, setChartTimeRange] = createSignal(30); const [tooltip, setTooltip] = createSignal<{ text: string; x: number; y: number } | null>(null); - const [selectedPBSInstance, setSelectedPBSInstance] = createSignal(null); + const [isSearchLocked, setIsSearchLocked] = createSignal(false); + + // Extract PBS instance from search term + const selectedPBSInstance = createMemo(() => { + const search = searchTerm(); + const match = search.match(/node:(\S+)/); + if (match && state.pbs?.some(pbs => pbs.name === match[1])) { + return match[1]; + } + return null; + }); + + // Auto-set backup type filter when PBS instance is selected + createEffect(() => { + const pbsInstance = selectedPBSInstance(); + if (pbsInstance) { + setBackupTypeFilter('remote'); + } else if (!isSearchLocked()) { + setBackupTypeFilter('all'); + } + }); + const [showFilters, setShowFilters] = createLocalStorageBooleanSignal( STORAGE_KEYS.BACKUPS_SHOW_FILTERS, false // Default to collapsed @@ -54,18 +75,6 @@ const UnifiedBackups: Component = () => { false // Default to absolute time ); - // Auto-set backup type filter to 'remote' when a PBS instance is selected - createEffect(() => { - const pbsInstance = selectedPBSInstance(); - if (pbsInstance) { - // When a PBS instance is selected, only show remote backups - setBackupTypeFilter('remote'); - } else { - // When deselected, reset to show all - setBackupTypeFilter('all'); - } - }); - // Helper functions const getDaySuffix = (day: number) => { if (day >= 11 && day <= 13) return 'th'; @@ -489,6 +498,7 @@ const UnifiedBackups: Component = () => { // Reset filters const resetFilters = () => { setSearchTerm(''); + setIsSearchLocked(false); setTypeFilter('all'); setBackupTypeFilter('all'); setSortKey('backupTime'); @@ -690,7 +700,10 @@ const UnifiedBackups: Component = () => {
Showing only backups from PBS server: {selectedPBSInstance()}