Skip to content

Commit 841b639

Browse files
style: MCP config dialog style (#3911)
Co-authored-by: wangdan-fit2cloud <[email protected]>
1 parent 77b86b9 commit 841b639

File tree

6 files changed

+35
-43
lines changed

6 files changed

+35
-43
lines changed

ui/src/locales/lang/en-US/views/tool.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export default {
88
copyTool: 'Copy Tool',
99
importTool: 'Import Tool',
1010
settingTool: 'Set Tool',
11+
mcpConfig: 'MCP Service Config',
1112
toolStore: {
1213
title: 'Tool Store',
1314
createFromToolStore: 'Create from Tool Store',
@@ -38,9 +39,6 @@ export default {
3839
},
3940

4041
form: {
41-
create: 'Create Tool',
42-
createMcp: 'Create MCP',
43-
mcpConfig: 'MCP Service Config',
4442
toolName: {
4543
label: 'Name',
4644
name: 'Tool Name',

ui/src/locales/lang/zh-CN/views/tool.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export default {
88
copyTool: '复制工具',
99
importTool: '导入工具',
1010
settingTool: '设置工具',
11+
mcpConfig: 'MCP服务配置',
1112
toolStore: {
1213
title: '工具商店',
1314
createFromToolStore: '从工具商店创建',
@@ -32,9 +33,6 @@ export default {
3233
saveMessage: '当前的更改尚未保存,确认退出吗?',
3334
},
3435
form: {
35-
create: '创建工具',
36-
createMcp: '创建MCP',
37-
mcpConfig: 'MCP服务配置',
3836
toolName: {
3937
label: '名称',
4038
name: '工具名称',

ui/src/locales/lang/zh-Hant/views/tool.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export default {
88
copyTool: '複製工具',
99
importTool: '匯入工具',
1010
settingTool: '設定工具',
11+
mcpConfig: 'MCP服務配置',
1112
toolStore: {
1213
title: '工具商店',
1314
createFromToolStore: '從工具商店創建',
@@ -35,9 +36,6 @@ export default {
3536
confirmMessage: '停用後,引用該工具的應用在查詢時會報錯,請謹慎操作。',
3637
},
3738
form: {
38-
create: '建立工具',
39-
createMcp: '建立MCP',
40-
mcpConfig: 'MCP服務配置',
4139
toolName: {
4240
label: '名稱',
4341
name: '工具名稱',
Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<template>
22
<el-dialog
3-
:title="$t('views.tool.form.mcpConfig')"
3+
:title="$t('views.tool.mcpConfig')"
44
width="600"
55
v-model="dialogVisible"
66
:close-on-click-modal="false"
77
:close-on-press-escape="false"
88
:destroy-on-close="true"
99
:before-close="close"
1010
append-to-body
11+
class="mcp-config-dialog"
1112
>
1213
<el-form label-width="auto" label-position="top">
1314
<el-form-item>
@@ -16,24 +17,25 @@
1617
v-model="mcp_servers"
1718
rows="8"
1819
disabled
20+
class="config-textarea"
21+
@mouseenter.stop="showIcon = true"
22+
@mouseleave.stop="showIcon = false"
1923
></el-input>
20-
<AppIcon
21-
iconName="app-copy"
22-
class="copy-icon color-secondary"
23-
@click="copyClick(mcp_servers)"
24-
/>
24+
<el-button circle class="copy-icon" v-if="showIcon" @click="copyClick(mcp_servers)">
25+
<AppIcon iconName="app-copy" class="color-secondary"/>
26+
</el-button>
2527
</el-form-item>
2628
</el-form>
2729
</el-dialog>
2830
</template>
2931

3032
<script setup lang="ts">
31-
import {ref} from 'vue'
32-
import {copyClick} from '@/utils/clipboard'
33-
33+
import { ref } from 'vue'
34+
import { copyClick } from '@/utils/clipboard'
3435
3536
const mcp_servers = ref<string>('')
3637
const dialogVisible = ref<boolean>(false)
38+
const showIcon = ref<boolean>(false)
3739
3840
const close = () => {
3941
dialogVisible.value = false
@@ -43,25 +45,23 @@ const open = (item: any) => {
4345
dialogVisible.value = true
4446
}
4547
46-
defineExpose({open,})
48+
defineExpose({ open })
4749
</script>
4850

4951
<style scoped lang="scss">
50-
51-
.copy-icon {
52-
position: absolute;
53-
top: 6px;
54-
right: 8px;
55-
font-size: 16px;
56-
cursor: pointer;
57-
z-index: 2;
58-
}
59-
60-
.copy-icon:hover {
61-
opacity: 0.85;
62-
}
63-
64-
:deep(.el-textarea__inner) {
65-
padding-right: 34px; // 给右上角图标留空间
52+
.mcp-config-dialog {
53+
.copy-icon {
54+
position: absolute;
55+
top: 12px;
56+
right: 12px;
57+
box-shadow: 0px 4px 8px 0px rgba(31, 35, 41, 0.1);
58+
z-index: 2;
59+
}
60+
.config-textarea {
61+
:deep(.el-textarea__inner) {
62+
color: var(--el-text-color-primary);
63+
cursor: pointer;
64+
}
65+
}
6666
}
6767
</style>

ui/src/views/tool/component/ToolListContainer.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<img src="@/assets/workflow/icon_tool.svg" style="width: 58%" alt="" />
5151
</el-avatar>
5252
<div class="pre-wrap ml-8">
53-
<div class="lighter">{{ $t('views.tool.form.create') }}</div>
53+
<div class="lighter">{{ $t('views.tool.createTool') }}</div>
5454
</div>
5555
</div>
5656
</el-dropdown-item>
@@ -60,7 +60,7 @@
6060
<img src="@/assets/workflow/icon_mcp.svg" style="width: 75%" alt="" />
6161
</el-avatar>
6262
<div class="pre-wrap ml-8">
63-
<div class="lighter">{{ $t('views.tool.form.createMcp') }}</div>
63+
<div class="lighter">{{ $t('views.tool.createMcpTool') }}</div>
6464
</div>
6565
</div>
6666
</el-dropdown-item>
@@ -222,8 +222,8 @@
222222
v-if="item.tool_type === 'MCP'"
223223
@click.stop="showMcpConfig(item)"
224224
>
225-
<AppIcon iconName="app-edit" class="color-secondary"></AppIcon>
226-
{{ $t('views.tool.form.mcpConfig') }}
225+
<AppIcon iconName="app-operate-log" class="color-secondary"></AppIcon>
226+
{{ $t('views.tool.mcpConfig') }}
227227
</el-dropdown-item>
228228
<el-dropdown-item
229229
v-if="item.template_id && permissionPrecise.edit(item.id)"

ui/src/workflow/nodes/start-node/index.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@
2020
</el-button>
2121
</el-tooltip>
2222
</div>
23-
<template v-if="nodeModel.properties.config.chatFields">
23+
<template v-if="nodeModel.properties.config.chatFields?.length">
2424
<h5 class="title-decoration-1 mb-8">{{ $t('views.applicationWorkflow.variable.chat') }}</h5>
2525
<div
26-
v-for="(item, index) in nodeModel.properties.config.chatFields
27-
? nodeModel.properties.config.chatFields
28-
: []"
26+
v-for="(item, index) in nodeModel.properties.config.chatFields || []"
2927
:key="index"
3028
class="flex-between border-r-6 p-8-12 mb-8 layout-bg lighter"
3129
@mouseenter="showicon = true"

0 commit comments

Comments
 (0)