refactor(frontend): 优化 Providers 功能模块

- 改进 ProviderFormDialog, KeyFormDialog, EndpointFormDialog 等组件
- 优化 ModelsTab 组件
This commit is contained in:
fawney19
2025-12-12 20:22:03 +08:00
parent 730209acc6
commit 737ab3b530
4 changed files with 28 additions and 30 deletions

View File

@@ -209,8 +209,8 @@ const props = defineProps<{
const emit = defineEmits<{
'update:modelValue': [value: boolean]
'provider-created': []
'provider-updated': []
'providerCreated': []
'providerUpdated': []
}>()
const { success, error: showError } = useToast()
@@ -319,12 +319,12 @@ const handleSubmit = async () => {
// 更新提供商
await updateProvider(props.provider.id, payload)
success('提供商更新成功')
emit('provider-updated')
emit('providerUpdated')
} else {
// 创建提供商
await createProvider(payload)
success('提供商已创建,请继续添加端点和密钥,或在优先级管理中调整顺序', '创建成功')
emit('provider-created')
emit('providerCreated')
}
emit('update:modelValue', false)