219
219
:provider =" provider"
220
220
:enabled-models =" enabledModels"
221
221
:total-models-count =" totalModelsCount"
222
- @show-model-list-dialog =" openModelCheckDialog "
222
+ @show-model-list-dialog =" showModelListDialog = true "
223
223
@disable-all-models =" handleDisableAllModels"
224
224
@model-enabled-change =" handleModelEnabledChange"
225
225
@config-changed =" handleConfigChanged"
288
288
</DialogContent >
289
289
</Dialog >
290
290
</div >
291
+ <ProviderDialogContainer
292
+ v-model:show-model-list-dialog =" showModelListDialog"
293
+ :provider =" provider"
294
+ :provider-models =" providerModels"
295
+ :custom-models =" customModels"
296
+ :model-to-disable =" null"
297
+ :check-result =" false"
298
+ @model-enabled-change =" handleModelEnabledChange"
299
+ />
291
300
</section >
292
301
</template >
293
302
@@ -317,6 +326,7 @@ import { useModelCheckStore } from '@/stores/modelCheck'
317
326
import { usePresenter } from ' @/composables/usePresenter'
318
327
import type { LLM_PROVIDER , RENDERER_MODEL_META } from ' @shared/presenter'
319
328
import ProviderModelManager from ' ./ProviderModelManager.vue'
329
+ import ProviderDialogContainer from ' ./ProviderDialogContainer.vue'
320
330
321
331
const { t } = useI18n ()
322
332
@@ -338,6 +348,7 @@ const authMethod = ref<'apikey' | 'oauth'>('apikey')
338
348
const apiHost = ref (props .provider .baseUrl || ' ' )
339
349
const apiKey = ref (props .provider .apiKey || ' ' )
340
350
const showCheckModelDialog = ref (false )
351
+ const showModelListDialog = ref (false )
341
352
const checkResult = ref <boolean >(false )
342
353
const isLoggingIn = ref (false )
343
354
const validationResult = ref <{ success: boolean ; message: string } | null >(null )
@@ -363,6 +374,18 @@ const totalModelsCount = computed(() => {
363
374
return providerModels ?.models .length || 0
364
375
})
365
376
377
+ const providerModels = computed ((): RENDERER_MODEL_META [] => {
378
+ const provider = settingsStore .allProviderModels .find ((p ) => p .providerId === props .provider .id )
379
+ return provider ?.models || []
380
+ })
381
+
382
+ const customModels = computed ((): RENDERER_MODEL_META [] => {
383
+ const providerCustomModels = settingsStore .customModels .find (
384
+ (p ) => p .providerId === props .provider .id
385
+ )
386
+ return providerCustomModels ?.models || []
387
+ })
388
+
366
389
// 初始化认证方法检测
367
390
const detectAuthMethod = async () => {
368
391
// 检查provider配置中的认证模式
0 commit comments