store/cockpit: add package search
Add initial package search. Include the version, release & arch information in the summary, since some packages might have a release with the specific architecture and a `noarch` version.
This commit is contained in:
parent
bc1564eddb
commit
eac03ddc7d
4 changed files with 89 additions and 17 deletions
|
|
@ -228,21 +228,31 @@ const Packages = () => {
|
|||
return;
|
||||
}
|
||||
if (debouncedSearchTerm.length > 1 && isSuccessDistroRepositories) {
|
||||
searchDistroRpms({
|
||||
apiContentUnitSearchRequest: {
|
||||
search: debouncedSearchTerm,
|
||||
urls: distroRepositories
|
||||
?.filter((archItem) => {
|
||||
return archItem.arch === arch;
|
||||
})[0]
|
||||
.repositories.flatMap((repo) => {
|
||||
if (!repo.baseurl) {
|
||||
throw new Error(`Repository ${repo} missing baseurl`);
|
||||
}
|
||||
return repo.baseurl;
|
||||
}),
|
||||
},
|
||||
});
|
||||
if (process.env.IS_ON_PREMISE) {
|
||||
searchDistroRpms({
|
||||
apiContentUnitSearchRequest: {
|
||||
packages: [debouncedSearchTerm],
|
||||
architecture: arch,
|
||||
distribution,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
searchDistroRpms({
|
||||
apiContentUnitSearchRequest: {
|
||||
search: debouncedSearchTerm,
|
||||
urls: distroRepositories
|
||||
?.filter((archItem) => {
|
||||
return archItem.arch === arch;
|
||||
})[0]
|
||||
.repositories.flatMap((repo) => {
|
||||
if (!repo.baseurl) {
|
||||
throw new Error(`Repository ${repo} missing baseurl`);
|
||||
}
|
||||
return repo.baseurl;
|
||||
}),
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
if (debouncedSearchTerm.length > 2) {
|
||||
if (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue