File tree 1 file changed +16
-4
lines changed
web/src/view/systemTools/autoCode
1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
- <div class =" p-5 " >
2
+ <div class =" p-2 " >
3
3
4
- <el-card class =" mt-5 " >
4
+ <el-card class =" mb-2 " >
5
5
<template #header >
6
6
<div class =" flex justify-between items-center font-bold" >
7
7
<span >MCP 服务器配置示例</span >
8
+ <el-tooltip content =" 复制配置" placement =" top" >
9
+ <el-button :icon =" DocumentCopy" circle @click =" copyMcpConfig" />
10
+ </el-tooltip >
8
11
</div >
9
12
</template >
10
13
<pre class =" font-mono whitespace-pre-wrap break-words bg-gray-100 p-2.5 rounded text-gray-700" >{{ mcpServerConfig }}</pre >
11
14
</el-card >
12
15
13
16
14
- <el-row :gutter =" 20 " >
17
+ <el-row :gutter =" 8 " >
15
18
<el-col v-for =" tool in mcpTools" :key =" tool.name" :xs =" 24" :sm =" 12" :md =" 8" :lg =" 6" >
16
19
<el-card class =" mb-5 h-[150px] flex flex-col overflow-hidden" >
17
20
<template #header >
110
113
<script setup>
111
114
import { ref , reactive , onMounted } from ' vue'
112
115
import { ElMessage } from ' element-plus'
113
- import { VideoPlay } from ' @element-plus/icons-vue'
116
+ import { VideoPlay , DocumentCopy } from ' @element-plus/icons-vue' // Added DocumentCopy
114
117
import { mcpList , mcpTest } from ' @/api/autoCode'
115
118
116
119
const mcpTools = ref ([])
@@ -142,6 +145,15 @@ onMounted(() => {
142
145
fetchMcpTools ()
143
146
})
144
147
148
+ const copyMcpConfig = async () => {
149
+ try {
150
+ await navigator .clipboard .writeText (mcpServerConfig .value )
151
+ ElMessage .success (' 配置已复制到剪贴板' )
152
+ } catch (err) {
153
+ ElMessage .error (' 复制失败: ' + err)
154
+ }
155
+ }
156
+
145
157
const openTestDialog = (tool ) => {
146
158
currentTestingTool .value = tool
147
159
apiDialogResponse .value = null // 清空之前的API响应
You can’t perform that action at this time.
0 commit comments