删除图片和视频的测试连接功能

This commit is contained in:
Connor
2026-01-12 23:34:10 +08:00
parent 1c682a8512
commit 2ad5b3b485
2 changed files with 6 additions and 4 deletions

View File

@@ -14,6 +14,7 @@
<ConfigList
:configs="configs"
:loading="loading"
:show-test-button="true"
@edit="handleEdit"
@delete="handleDelete"
@toggle-active="handleToggleActive"
@@ -25,10 +26,10 @@
<ConfigList
:configs="configs"
:loading="loading"
:show-test-button="false"
@edit="handleEdit"
@delete="handleDelete"
@toggle-active="handleToggleActive"
@test="handleTest"
/>
</el-tab-pane>
@@ -36,10 +37,10 @@
<ConfigList
:configs="configs"
:loading="loading"
:show-test-button="false"
@edit="handleEdit"
@delete="handleDelete"
@toggle-active="handleToggleActive"
@test="handleTest"
/>
</el-tab-pane>
</el-tabs>
@@ -143,7 +144,7 @@
<template #footer>
<el-button @click="dialogVisible = false">取消</el-button>
<el-button @click="testConnection" :loading="testing">测试连接</el-button>
<el-button v-if="form.service_type === 'text'" @click="testConnection" :loading="testing">测试连接</el-button>
<el-button type="primary" @click="handleSubmit" :loading="submitting">
{{ isEdit ? '保存' : '创建' }}
</el-button>

View File

@@ -15,7 +15,7 @@
<el-tag v-else type="info" size="small">已禁用</el-tag>
</div>
<div class="config-actions">
<el-button text @click="$emit('test', config)" :icon="Connection">
<el-button v-if="showTestButton" text @click="$emit('test', config)" :icon="Connection">
测试
</el-button>
<el-button text @click="$emit('edit', config)" :icon="Edit">
@@ -101,6 +101,7 @@ import type { AIServiceConfig } from '@/types/ai'
defineProps<{
configs: AIServiceConfig[]
loading: boolean
showTestButton?: boolean
}>()
defineEmits<{