This commit is contained in:
吴红兵
2026-03-07 12:35:45 +08:00
parent 271710e870
commit b997b3ba48
423 changed files with 79612 additions and 91574 deletions

View File

@@ -132,7 +132,7 @@
>
<el-icon><ChatDotRound /></el-icon>
</el-button>
<div class="flex-grow ml-4"></div>
<div class="flex items-center text-xs text-gray-500 dark:text-gray-400">
<el-icon class="mr-1"><Clock /></el-icon>
@@ -158,7 +158,7 @@
<!-- 编辑新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
<!-- 工具抽屉 -->
<tools-drawer ref="toolsDrawerRef" />
</div>

View File

@@ -1,50 +1,50 @@
<template>
<el-drawer v-model="visible" title="MCP 工具能力" size="40%" direction="rtl" :before-close="handleClose">
<!-- 工具列表 -->
<div v-loading="loading">
<div v-if="toolsList.length === 0 && !loading" class="text-center py-12">
<el-empty description="暂无工具数据" />
</div>
<!-- 工具列表 -->
<div v-loading="loading">
<div v-if="toolsList.length === 0 && !loading" class="text-center py-12">
<el-empty description="暂无工具数据" />
</div>
<div v-else class="space-y-4">
<div
v-for="(tool, index) in toolsList"
:key="index"
class="p-4 border border-gray-200 rounded-lg transition-all duration-200 hover:shadow-md dark:border-gray-700 dark:bg-gray-800"
>
<div class="flex items-start justify-between mb-3">
<div class="flex-1">
<h4 class="text-base font-medium text-gray-900 dark:text-white">
{{ tool.name || '未命名工具' }}
</h4>
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
{{ tool.description || '暂无描述' }}
</p>
<div v-else class="space-y-4">
<div
v-for="(tool, index) in toolsList"
:key="index"
class="p-4 border border-gray-200 rounded-lg transition-all duration-200 hover:shadow-md dark:border-gray-700 dark:bg-gray-800"
>
<div class="flex items-start justify-between mb-3">
<div class="flex-1">
<h4 class="text-base font-medium text-gray-900 dark:text-white">
{{ tool.name || '未命名工具' }}
</h4>
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
{{ tool.description || '暂无描述' }}
</p>
</div>
<el-tag size="small" type="primary">工具</el-tag>
</div>
<!-- 工具详细信息 -->
<div class="space-y-3">
<!-- 输入参数 -->
<div v-if="tool.inputSchema">
<h5 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">输入参数:</h5>
<div class="p-3 bg-gray-50 rounded dark:bg-gray-700">
<pre class="text-xs text-gray-800 dark:text-gray-200 whitespace-pre-wrap">{{ formatSchema(tool.inputSchema) }}</pre>
</div>
<el-tag size="small" type="primary">工具</el-tag>
</div>
<!-- 工具详细信息 -->
<div class="space-y-3">
<!-- 参数 -->
<div v-if="tool.inputSchema">
<h5 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">输入参数:</h5>
<div class="p-3 bg-gray-50 rounded dark:bg-gray-700">
<pre class="text-xs text-gray-800 dark:text-gray-200 whitespace-pre-wrap">{{ formatSchema(tool.inputSchema) }}</pre>
</div>
</div>
<!-- 输出参数 -->
<div v-if="tool.outputSchema">
<h5 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">输出参数:</h5>
<div class="p-3 bg-gray-50 rounded dark:bg-gray-700">
<pre class="text-xs text-gray-800 dark:text-gray-200 whitespace-pre-wrap">{{ formatSchema(tool.outputSchema) }}</pre>
</div>
<!-- 输出参数 -->
<div v-if="tool.outputSchema">
<h5 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">参数:</h5>
<div class="p-3 bg-gray-50 rounded dark:bg-gray-700">
<pre class="text-xs text-gray-800 dark:text-gray-200 whitespace-pre-wrap">{{ formatSchema(tool.outputSchema) }}</pre>
</div>
</div>
</div>
</div>
</div>
</div>
<template #footer>
<div class="flex justify-end">
@@ -107,7 +107,7 @@ const formatSchema = (schema: any) => {
const handleClose = () => {
visible.value = false;
toolsList.value = [];
Object.keys(mcpInfo).forEach(key => delete mcpInfo[key]);
Object.keys(mcpInfo).forEach((key) => delete mcpInfo[key]);
};
// 暴露方法