feat: enhance snapshot filtering by including backup schedule names and volumes
This commit is contained in:
parent
299469728e
commit
542842d012
1 changed files with 8 additions and 1 deletions
|
|
@ -28,9 +28,16 @@ export const RepositorySnapshotsTabContent = ({ repository }: Props) => {
|
|||
const filteredSnapshots = data.filter((snapshot: Snapshot) => {
|
||||
if (!searchQuery) return true;
|
||||
const searchLower = searchQuery.toLowerCase();
|
||||
|
||||
// Find the backup schedule for this snapshot
|
||||
const backupIds = snapshot.tags.map(Number).filter((tag) => !Number.isNaN(tag));
|
||||
const backup = schedules.data?.find((b) => backupIds.includes(b.id));
|
||||
|
||||
return (
|
||||
snapshot.short_id.toLowerCase().includes(searchLower) ||
|
||||
snapshot.paths.some((path) => path.toLowerCase().includes(searchLower))
|
||||
snapshot.paths.some((path) => path.toLowerCase().includes(searchLower)) ||
|
||||
backup?.name.toLowerCase().includes(searchLower) ||
|
||||
backup?.volume.name.toLowerCase().includes(searchLower)
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue