File tree Expand file tree Collapse file tree 4 files changed +19
-6
lines changed
Expand file tree Collapse file tree 4 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -226,7 +226,8 @@ export default {
226226 getToolsSuccess : 'Get Tools Successfully' ,
227227 getTool : 'Get Tools' ,
228228 tool : 'Tool' ,
229- toolParam : 'Tool Params'
229+ toolParam : 'Tool Params' ,
230+ mcpServerTip : 'Please enter the JSON format of the MCP server config' ,
230231 } ,
231232 imageGenerateNode : {
232233 label : 'Image Generation' ,
Original file line number Diff line number Diff line change @@ -226,7 +226,8 @@ export default {
226226 getToolsSuccess : '获取工具成功' ,
227227 getTool : '获取工具' ,
228228 tool : '工具' ,
229- toolParam : '工具参数'
229+ toolParam : '工具参数' ,
230+ mcpServerTip : '请输入 JSON 格式的 MCP 服务器配置' ,
230231 } ,
231232 imageGenerateNode : {
232233 label : '图片生成' ,
Original file line number Diff line number Diff line change @@ -226,7 +226,8 @@ export default {
226226 getToolsSuccess : '獲取工具成功' ,
227227 getTool : '獲取工具' ,
228228 tool : '工具' ,
229- toolParam : '工具變數'
229+ toolParam : '工具變數' ,
230+ mcpServerTip : '請輸入 JSON 格式的 MCP 服務器配置' ,
230231 } ,
231232 imageGenerateNode : {
232233 label : '圖片生成' ,
Original file line number Diff line number Diff line change @@ -90,12 +90,12 @@ import { isLastNode } from '@/workflow/common/data'
9090import applicationApi from ' @/api/application'
9191import { t } from ' @/locales'
9292import DynamicsForm from ' @/components/dynamics-form/index.vue'
93- import { MsgSuccess } from ' @/utils/message'
93+ import { MsgError , MsgSuccess } from ' @/utils/message'
9494
9595const props = defineProps <{ nodeModel: any }>()
9696
9797const dynamicsFormRef = ref ()
98-
98+ const loading = ref ( false )
9999
100100const wheel = (e : any ) => {
101101 if (e .ctrlKey === true ) {
@@ -122,7 +122,17 @@ function submitDialog(val: string) {
122122}
123123
124124function getTools() {
125- applicationApi .getMcpTools ({ mcp_servers: form_data .value .mcp_servers }).then ((res : any ) => {
125+ if (! form_data .value .mcp_servers ) {
126+ MsgError (t (' views.applicationWorkflow.nodes.mcpNode.mcpServerTip' ))
127+ return
128+ }
129+ try {
130+ JSON .parse (form_data .value .mcp_servers )
131+ } catch (e ) {
132+ MsgError (t (' views.applicationWorkflow.nodes.mcpNode.mcpServerTip' ))
133+ return
134+ }
135+ applicationApi .getMcpTools ({ mcp_servers: form_data .value .mcp_servers }, loading ).then ((res : any ) => {
126136 form_data .value .mcp_tools = res .data
127137 MsgSuccess (t (' views.applicationWorkflow.nodes.mcpNode.getToolsSuccess' ))
128138 })
You can’t perform that action at this time.
0 commit comments