File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
web/src/view/systemTools/autoCode Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change 11<template >
2- <div class =" p-5 " >
2+ <div class =" p-2 " >
33
4- <el-card class =" mt-5 " >
4+ <el-card class =" mb-2 " >
55 <template #header >
66 <div class =" flex justify-between items-center font-bold" >
77 <span >MCP 服务器配置示例</span >
8+ <el-tooltip content =" 复制配置" placement =" top" >
9+ <el-button :icon =" DocumentCopy" circle @click =" copyMcpConfig" />
10+ </el-tooltip >
811 </div >
912 </template >
1013 <pre class =" font-mono whitespace-pre-wrap break-words bg-gray-100 p-2.5 rounded text-gray-700" >{{ mcpServerConfig }}</pre >
1114 </el-card >
1215
1316
14- <el-row :gutter =" 20 " >
17+ <el-row :gutter =" 8 " >
1518 <el-col v-for =" tool in mcpTools" :key =" tool.name" :xs =" 24" :sm =" 12" :md =" 8" :lg =" 6" >
1619 <el-card class =" mb-5 h-[150px] flex flex-col overflow-hidden" >
1720 <template #header >
110113<script setup>
111114import { ref , reactive , onMounted } from ' vue'
112115import { ElMessage } from ' element-plus'
113- import { VideoPlay } from ' @element-plus/icons-vue'
116+ import { VideoPlay , DocumentCopy } from ' @element-plus/icons-vue' // Added DocumentCopy
114117import { mcpList , mcpTest } from ' @/api/autoCode'
115118
116119const mcpTools = ref ([])
@@ -142,6 +145,15 @@ onMounted(() => {
142145 fetchMcpTools ()
143146})
144147
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+
145157const openTestDialog = (tool ) => {
146158 currentTestingTool .value = tool
147159 apiDialogResponse .value = null // 清空之前的API响应
You can’t perform that action at this time.
0 commit comments