-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Expand file tree
/
Copy pathMcpToolConfigDialog.vue
More file actions
67 lines (62 loc) · 1.56 KB
/
McpToolConfigDialog.vue
File metadata and controls
67 lines (62 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<template>
<el-dialog
:title="$t('views.tool.mcpConfig')"
width="600"
v-model="dialogVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
:destroy-on-close="true"
:before-close="close"
append-to-body
class="mcp-config-dialog"
>
<el-form label-width="auto" label-position="top">
<el-form-item>
<el-input
type="textarea"
v-model="mcp_servers"
rows="8"
disabled
class="config-textarea"
@mouseenter.stop="showIcon = true"
@mouseleave.stop="showIcon = false"
></el-input>
<el-button circle class="copy-icon" v-if="showIcon" @click="copyClick(mcp_servers)">
<AppIcon iconName="app-copy" class="color-secondary"/>
</el-button>
</el-form-item>
</el-form>
</el-dialog>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { copyClick } from '@/utils/clipboard'
const mcp_servers = ref<string>('')
const dialogVisible = ref<boolean>(false)
const showIcon = ref<boolean>(false)
const close = () => {
dialogVisible.value = false
}
const open = (item: any) => {
mcp_servers.value = item.code
dialogVisible.value = true
}
defineExpose({ open })
</script>
<style scoped lang="scss">
.mcp-config-dialog {
.copy-icon {
position: absolute;
top: 12px;
right: 12px;
box-shadow: 0px 4px 8px 0px rgba(31, 35, 41, 0.1);
z-index: 2;
}
.config-textarea {
:deep(.el-textarea__inner) {
color: var(--el-text-color-primary);
cursor: pointer;
}
}
}
</style>