Add filter Buttons

This commit is contained in:
Michel Roegl-Brunner
2025-11-13 15:26:49 +01:00
parent 955d0e72d7
commit 5cb7bc95fa
419 changed files with 1548 additions and 2115 deletions

View File

@@ -29,6 +29,7 @@ export function DownloadedScriptsTab({ onInstallScript }: DownloadedScriptsTabPr
searchQuery: '',
showUpdatable: null,
selectedTypes: [],
selectedRepositories: [],
sortBy: 'name',
sortOrder: 'asc',
});
@@ -283,6 +284,22 @@ export function DownloadedScriptsTab({ onInstallScript }: DownloadedScriptsTabPr
});
}
// Filter by repositories
if (filters.selectedRepositories.length > 0) {
scripts = scripts.filter(script => {
if (!script) return false;
const repoUrl = script.repository_url;
// If script has no repository_url, exclude it when filtering by repositories
if (!repoUrl) {
return false;
}
// Only include scripts from selected repositories
return filters.selectedRepositories.includes(repoUrl);
});
}
// Apply sorting
scripts.sort((a, b) => {
if (!a || !b) return 0;