mirror of
https://github.com/nicotsx/zerobyte.git
synced 2025-12-23 21:47:47 -05:00
feat: enhance snapshot filtering by including backup schedule names and volumes
This commit is contained in:
@@ -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)
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user