mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-11-08 12:24:45 +00:00
fix(ui): show registry provider logos and capitalize registry labels (#12985)
This commit is contained in:
1 parent
f44ea4b6fa
commit
d8bdc8553f
20 files changed
+416
-50
No files matched your search
@@ -227,6 +227,22 @@ export async function getInstalledRegistryProviderOptions(): Promise<RegistryPro
|
||||
};
|
||||
}
|
||||
|
||||
/** Logo of each registry provider type; empty whenever Registry is out of reach. */
|
||||
export async function getRegistryProviderLogos(): Promise<
|
||||
Record<string, string>
|
||||
> {
|
||||
const access = (await auth())?.accessToken;
|
||||
const permission = await evaluateRegistryProviderAccess(access);
|
||||
if (!access || permission.status !== REGISTRY_ACCESS.ELIGIBLE) return {};
|
||||
const result = await readRegistryProviders(access, null);
|
||||
if (result.status !== "ready") return {};
|
||||
return Object.fromEntries(
|
||||
result.providers.flatMap(({ type, logoUrl }) =>
|
||||
logoUrl?.startsWith("https://") ? [[type, logoUrl]] : [],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
async function readCompleteRegistryCatalog(
|
||||
accessToken: string,
|
||||
credential: RegistryCredentialStatus | null,
|
||||
|
||||
Reference in new issue
Block a user