diff --git a/frontend/src/features/providers/components/KeyFormDialog.vue b/frontend/src/features/providers/components/KeyFormDialog.vue index 5054b3d..0cf7f88 100644 --- a/frontend/src/features/providers/components/KeyFormDialog.vue +++ b/frontend/src/features/providers/components/KeyFormDialog.vue @@ -232,7 +232,7 @@ :disabled="saving" @click="handleSave" > - {{ saving ? '保存中...' : '保存' }} + {{ saving ? (isEditMode ? '保存中...' : '添加中...') : (isEditMode ? '保存' : '添加') }} @@ -408,6 +408,14 @@ function resetForm() { } } +// 添加成功后清除部分字段以便继续添加 +function clearForNextAdd() { + formNonce.value = createFieldNonce() + apiKeyFocused.value = false + form.value.name = '' + form.value.api_key = '' +} + // 加载密钥数据(编辑模式) function loadKeyData() { if (!props.editingKey) return @@ -530,6 +538,10 @@ async function handleSave() { capabilities: capabilitiesData || undefined }) success('密钥已添加', '成功') + // 添加模式:不关闭对话框,只清除名称和密钥以便继续添加 + emit('saved') + clearForNextAdd() + return } emit('saved') diff --git a/frontend/src/views/shared/Dashboard.vue b/frontend/src/views/shared/Dashboard.vue index c0a2b57..bc4d38c 100644 --- a/frontend/src/views/shared/Dashboard.vue +++ b/frontend/src/views/shared/Dashboard.vue @@ -16,7 +16,8 @@
-