feat: add built-in MCP service support
This commit is contained in:
@@ -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