feat: 非 custom 提供商新建密钥时默认开启自动获取上游模型

- 前端 KeyFormDialog 根据提供商类型自动设置 auto_fetch_models 默认值
- OAuth 创建密钥时传入 auto_fetch_models=True
- OAuth 完成、refresh token 导入、批量导入后自动触发模型获取
This commit is contained in:
fawney19
2026-02-09 13:50:27 +08:00
parent 0da34f729e
commit d0b9dc7a24
2 changed files with 46 additions and 1 deletions

View File

@@ -417,6 +417,11 @@ const apiKeyFieldName = computed(() => `api-key-field-${formNonce.value}`)
// 可用的能力列表
const availableCapabilities = ref<CapabilityDefinition[]>([])
// 非 custom 提供商默认开启自动获取上游模型
const defaultAutoFetchModels = computed(() =>
!!props.providerType && props.providerType !== 'custom'
)
const form = ref({
name: '',
api_key: '', // 标准 API Key
@@ -519,7 +524,7 @@ function resetForm() {
note: '',
is_active: true,
capabilities: {},
auto_fetch_models: false,
auto_fetch_models: defaultAutoFetchModels.value,
model_include_patterns_text: '',
model_exclude_patterns_text: ''
}