feat: add built-in MCP service support
This commit is contained in:
@@ -24,6 +24,7 @@ export interface MCPService {
|
||||
args: string[] // Command arguments array
|
||||
}
|
||||
env_vars?: Record<string, string> // Environment variables for stdio transport
|
||||
is_builtin?: boolean // Whether this is a builtin MCP service
|
||||
created_at?: string
|
||||
updated_at?: string
|
||||
}
|
||||
|
||||
@@ -2241,7 +2241,8 @@ export default {
|
||||
deleteFailed: 'Failed to delete MCP service'
|
||||
},
|
||||
deleteConfirmBody: 'Delete MCP service "{name}"? This action cannot be undone.',
|
||||
unnamed: 'Unnamed'
|
||||
unnamed: 'Unnamed',
|
||||
builtin: 'Built-in'
|
||||
},
|
||||
// New: Model Settings
|
||||
modelSettings: {
|
||||
|
||||
@@ -2291,6 +2291,7 @@ export default {
|
||||
},
|
||||
deleteConfirmBody: 'MCP 서비스 "{name}"을(를) 삭제하시겠습니까? 이 작업은 취소할 수 없습니다.',
|
||||
unnamed: "이름 없음",
|
||||
builtin: "내장",
|
||||
},
|
||||
// 모델 설정
|
||||
modelSettings: {
|
||||
|
||||
@@ -1602,7 +1602,8 @@ export default {
|
||||
deleteFailed: 'Не удалось удалить сервис MCP'
|
||||
},
|
||||
deleteConfirmBody: 'Удалить сервис MCP «{name}»? Действие необратимо.',
|
||||
unnamed: 'Без названия'
|
||||
unnamed: 'Без названия',
|
||||
builtin: 'Встроенный'
|
||||
},
|
||||
modelSettings: {
|
||||
title: 'Настройки моделей',
|
||||
|
||||
@@ -2245,6 +2245,7 @@ export default {
|
||||
},
|
||||
deleteConfirmBody: '确定要删除 MCP 服务"{name}"吗?此操作无法撤销。',
|
||||
unnamed: "未命名",
|
||||
builtin: "内置",
|
||||
},
|
||||
|
||||
// 新增:模型设置
|
||||
|
||||
@@ -35,6 +35,14 @@
|
||||
<div class="service-header">
|
||||
<div class="service-name">
|
||||
{{ service.name }}
|
||||
<t-tag
|
||||
v-if="service.is_builtin"
|
||||
theme="warning"
|
||||
size="small"
|
||||
variant="light"
|
||||
>
|
||||
{{ $t('mcpSettings.builtin') }}
|
||||
</t-tag>
|
||||
<t-tag
|
||||
:theme="getTransportTypeTheme(service.transport_type)"
|
||||
size="small"
|
||||
@@ -48,8 +56,10 @@
|
||||
v-model="service.enabled"
|
||||
@change="() => handleToggleEnabled(service)"
|
||||
size="large"
|
||||
:disabled="service.is_builtin"
|
||||
/>
|
||||
<t-dropdown
|
||||
v-if="!service.is_builtin"
|
||||
:options="getServiceOptions(service)"
|
||||
@click="(data: any) => handleMenuAction(data, service)"
|
||||
placement="bottom-right"
|
||||
@@ -59,6 +69,17 @@
|
||||
<t-icon name="more" />
|
||||
</t-button>
|
||||
</t-dropdown>
|
||||
<t-dropdown
|
||||
v-else
|
||||
:options="getBuiltinServiceOptions(service)"
|
||||
@click="(data: any) => handleMenuAction(data, service)"
|
||||
placement="bottom-right"
|
||||
:disabled="testing"
|
||||
>
|
||||
<t-button variant="text" shape="square" size="small" class="more-btn" :disabled="testing">
|
||||
<t-icon name="more" />
|
||||
</t-button>
|
||||
</t-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="service.description" class="service-description">
|
||||
@@ -264,6 +285,16 @@ const getServiceOptions = (service: MCPService) => {
|
||||
]
|
||||
}
|
||||
|
||||
// Get service options for builtin services (test only)
|
||||
const getBuiltinServiceOptions = (service: MCPService) => {
|
||||
return [
|
||||
{
|
||||
content: t('mcpSettings.actions.test'),
|
||||
value: `test-${service.id}`
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
// Handle menu action
|
||||
const handleMenuAction = (data: { value: string }, service: MCPService) => {
|
||||
const value = data.value
|
||||
|
||||
Reference in New Issue
Block a user