diff --git a/ui/CHANGELOG.md b/ui/CHANGELOG.md index d6fd178995..9807cfe2f4 100644 --- a/ui/CHANGELOG.md +++ b/ui/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the **Prowler UI** are documented in this file. -## [1.15.0] (Unreleased) +## [1.15.0] (Prowler Unreleased) ### 🚀 Added @@ -13,6 +13,16 @@ All notable changes to the **Prowler UI** are documented in this file. - Threat Map component to Overview Page [(#9324)](https://github.com/prowler-cloud/prowler/pull/9324) - MongoDB Atlas provider support [(#9253)](https://github.com/prowler-cloud/prowler/pull/9253) +--- + +## [1.14.2] (Prowler v5.14.2) + +### 🐞 Fixed + +- Models list in Lighthouse selector when default model is not set for provider [(9402)](https://github.com/prowler-cloud/prowler/pull/9402) + +--- + ## [1.14.0] (Prowler v5.14.0) ### 🚀 Added diff --git a/ui/actions/lighthouse/lighthouse.ts b/ui/actions/lighthouse/lighthouse.ts index 3ebfc0cceb..5365517bbd 100644 --- a/ui/actions/lighthouse/lighthouse.ts +++ b/ui/actions/lighthouse/lighthouse.ts @@ -518,8 +518,8 @@ export const deleteLighthouseProviderByType = async ( }; /** - * Get lighthouse providers configuration with default models - * Returns only the default model for each provider to avoid loading hundreds of models + * Get lighthouse providers configuration with all available models + * Fetches all models for each provider to populate the model selector */ export const getLighthouseProvidersConfig = async () => { try { @@ -544,47 +544,19 @@ export const getLighthouseProvidersConfig = async () => { (p: LighthouseProviderResource) => p.attributes?.is_active, ) || []; - // Build provider configuration with only default models const providersConfig = await Promise.all( activeProviders.map(async (provider: LighthouseProviderResource) => { const providerType = provider.attributes .provider_type as LighthouseProvider; - const defaultModelId = defaultModels[providerType]; - // Fetch only the default model for this provider if it exists - let defaultModel = null; - if (defaultModelId) { - const headers = await getAuthHeaders({ contentType: false }); - const url = new URL(`${apiBaseUrl}/lighthouse/models`); - url.searchParams.append("filter[provider_type]", providerType); - url.searchParams.append("filter[model_id]", defaultModelId); - - try { - const response = await fetch(url.toString(), { - method: "GET", - headers, - }); - const data = await response.json(); - if (data.data && data.data.length > 0) { - defaultModel = { - id: data.data[0].attributes.model_id, - name: - data.data[0].attributes.model_name || - data.data[0].attributes.model_id, - }; - } - } catch (error) { - console.error( - `[Server] Error fetching default model for ${providerType}:`, - error, - ); - } - } + // Fetch all models for this provider + const modelsResponse = await getLighthouseModelIds(providerType); + const models: ModelOption[] = modelsResponse.data || []; return { id: providerType, name: PROVIDER_DISPLAY_NAMES[providerType], - models: defaultModel ? [defaultModel] : [], + models: models, }; }), );