diff --git a/ui/src/api/application/application.ts b/ui/src/api/application/application.ts index e85f38cfa..44c306f15 100644 --- a/ui/src/api/application/application.ts +++ b/ui/src/api/application/application.ts @@ -286,6 +286,16 @@ const speechToText: ( return post(`${prefix.value}/${application_id}/speech_to_text`, data, undefined, loading) } +/** + * mcp 节点 + */ +const getMcpTools: (application_id: String, loading?: Ref) => Promise> = ( + application_id, + loading, +) => { + return get(`${prefix.value}/${application_id}/mcp_tools`, undefined, loading) +} + export default { getAllApplication, getApplication, @@ -310,4 +320,5 @@ export default { playDemoText, textToSpeech, speechToText, + getMcpTools, } diff --git a/ui/src/components/generate-related-resource-dialog/index.vue b/ui/src/components/generate-related-resource-dialog/index.vue deleted file mode 100644 index 4ec62034c..000000000 --- a/ui/src/components/generate-related-resource-dialog/index.vue +++ /dev/null @@ -1,204 +0,0 @@ - - - diff --git a/ui/src/components/select-knowledge-document/index.vue b/ui/src/components/select-knowledge-document/index.vue new file mode 100644 index 000000000..5cf1df47f --- /dev/null +++ b/ui/src/components/select-knowledge-document/index.vue @@ -0,0 +1,176 @@ + + diff --git a/ui/src/views/HomeView.vue b/ui/src/views/HomeView.vue deleted file mode 100644 index 1bdcee152..000000000 --- a/ui/src/views/HomeView.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - diff --git a/ui/src/views/chat-log/component/EditContentDialog.vue b/ui/src/views/chat-log/component/EditContentDialog.vue index c529b381a..8528cc5e7 100644 --- a/ui/src/views/chat-log/component/EditContentDialog.vue +++ b/ui/src/views/chat-log/component/EditContentDialog.vue @@ -48,42 +48,14 @@ > - - - - - - - {{ item.name }} - - - - - - - - {{ item.name }} - - - + diff --git a/ui/src/workflow/common/app-node.ts b/ui/src/workflow/common/app-node.ts index 8eed6c15b..f6d3f5e54 100644 --- a/ui/src/workflow/common/app-node.ts +++ b/ui/src/workflow/common/app-node.ts @@ -1,7 +1,7 @@ import Components from '@/components' import ElementPlus from 'element-plus' import * as ElementPlusIcons from '@element-plus/icons-vue' -import zhCn from 'element-plus/dist/locale/zh-cn.mjs' +import zhCn from 'element-plus/es/locale/lang/zh-cn' import { HtmlResize } from '@logicflow/extension' import { h as lh } from '@logicflow/core' import { createApp, h } from 'vue' diff --git a/ui/src/workflow/nodes/application-node/index.vue b/ui/src/workflow/nodes/application-node/index.vue index 265f668f7..ce3ff8db6 100644 --- a/ui/src/workflow/nodes/application-node/index.vue +++ b/ui/src/workflow/nodes/application-node/index.vue @@ -223,33 +223,35 @@ const update_field = () => { } // todo applicationApi - .getApplicationById(id, props.nodeModel.properties.node_data.application_id) + .getApplicationDetail(id) .then((ok) => { const old_api_input_field_list = cloneDeep( - props.nodeModel.properties.node_data.api_input_field_list + props.nodeModel.properties.node_data.api_input_field_list, ) const old_user_input_field_list = cloneDeep( - props.nodeModel.properties.node_data.user_input_field_list + props.nodeModel.properties.node_data.user_input_field_list, ) if (isWorkFlow(ok.data.type)) { const nodeData = ok.data.work_flow.nodes[0].properties.node_data const new_api_input_field_list = cloneDeep( - ok.data.work_flow.nodes[0].properties.api_input_field_list + ok.data.work_flow.nodes[0].properties.api_input_field_list, ) const new_user_input_field_list = cloneDeep( - ok.data.work_flow.nodes[0].properties.user_input_field_list + ok.data.work_flow.nodes[0].properties.user_input_field_list, ) const merge_api_input_field_list = (new_api_input_field_list || []).map((item: any) => { const find_field = old_api_input_field_list.find( - (old_item: any) => old_item.variable == item.variable + (old_item: any) => old_item.variable == item.variable, ) if (find_field) { return { ...item, value: find_field.value, label: - typeof item.label === 'object' && item.label != null ? item.label.label : item.label + typeof item.label === 'object' && item.label != null + ? item.label.label + : item.label, } } else { return item @@ -258,18 +260,20 @@ const update_field = () => { set( props.nodeModel.properties.node_data, 'api_input_field_list', - merge_api_input_field_list + merge_api_input_field_list, ) const merge_user_input_field_list = (new_user_input_field_list || []).map((item: any) => { const find_field = old_user_input_field_list.find( - (old_item: any) => old_item.field == item.field + (old_item: any) => old_item.field == item.field, ) if (find_field) { return { ...item, value: find_field.value, label: - typeof item.label === 'object' && item.label != null ? item.label.label : item.label + typeof item.label === 'object' && item.label != null + ? item.label.label + : item.label, } } else { return item @@ -278,7 +282,7 @@ const update_field = () => { set( props.nodeModel.properties.node_data, 'user_input_field_list', - merge_user_input_field_list + merge_user_input_field_list, ) const fileEnable = nodeData.file_upload_enable const fileUploadSetting = nodeData.file_upload_setting diff --git a/ui/src/workflow/nodes/mcp-node/index.vue b/ui/src/workflow/nodes/mcp-node/index.vue index 3719224fb..00f73bded 100644 --- a/ui/src/workflow/nodes/mcp-node/index.vue +++ b/ui/src/workflow/nodes/mcp-node/index.vue @@ -95,10 +95,7 @@ :label="$t('views.applicationWorkflow.nodes.replyNode.replyContent.reference')" value="referencing" /> - + @@ -166,10 +163,7 @@ :label="$t('views.applicationWorkflow.nodes.replyNode.replyContent.reference')" value="referencing" /> - + @@ -214,9 +208,14 @@ import { t } from '@/locales' import { MsgError, MsgSuccess } from '@/utils/message' import TooltipLabel from '@/components/dynamics-form/items/label/TooltipLabel.vue' import NodeCascader from '@/workflow/common/NodeCascader.vue' - +import { useRoute } from 'vue-router' const props = defineProps<{ nodeModel: any }>() +const route = useRoute() +const { + params: { id }, +} = route as any + const dynamicsFormRef = ref() const loading = ref(false) @@ -262,16 +261,14 @@ function getTools() { return } // todo - applicationApi - .getMcpTools({ mcp_servers: form_data.value.mcp_servers }, loading) - .then((res: any) => { - form_data.value.mcp_tools = res.data - MsgSuccess(t('views.applicationWorkflow.nodes.mcpNode.getToolsSuccess')) - // 修改了json,刷新mcp_server - form_data.value.mcp_server = form_data.value.mcp_tools.filter( - (item: any) => item.name === form_data.value.mcp_tool, - )[0].server - }) + applicationApi.getMcpTools(id, loading).then((res: any) => { + form_data.value.mcp_tools = res.data + MsgSuccess(t('views.applicationWorkflow.nodes.mcpNode.getToolsSuccess')) + // 修改了json,刷新mcp_server + form_data.value.mcp_server = form_data.value.mcp_tools.filter( + (item: any) => item.name === form_data.value.mcp_tool, + )[0].server + }) } function changeTool() { diff --git a/ui/src/workflow/nodes/tool-lib-node/index.vue b/ui/src/workflow/nodes/tool-lib-node/index.vue index cf4bc846b..06d8ee40a 100644 --- a/ui/src/workflow/nodes/tool-lib-node/index.vue +++ b/ui/src/workflow/nodes/tool-lib-node/index.vue @@ -89,6 +89,7 @@ import type { FormInstance } from 'element-plus' import { ref, computed, onMounted } from 'vue' import { isLastNode } from '@/workflow/common/data' import applicationApi from '@/api/application/application' +import ToolApi from '@/api/tool/tool' const props = defineProps<{ nodeModel: any }>() @@ -127,8 +128,7 @@ const update_field = () => { return } //todo - applicationApi - .getToolLib(id, props.nodeModel.properties.node_data.tool_lib_id) + ToolApi.getToolById(props.nodeModel.properties.node_data.tool_lib_id) .then((ok) => { const old_input_field_list = props.nodeModel.properties.node_data.input_field_list const merge_input_field_list = ok.data.input_field_list.map((item: any) => { @@ -141,7 +141,7 @@ const update_field = () => { set(props.nodeModel.properties.node_data, 'input_field_list', merge_input_field_list) set(props.nodeModel.properties, 'status', ok.data.is_active ? 200 : 500) }) - .catch((err) => { + .catch(() => { set(props.nodeModel.properties, 'status', 500) }) } diff --git a/ui/vite.config.ts b/ui/vite.config.ts index 5e8e515d9..61abb0701 100644 --- a/ui/vite.config.ts +++ b/ui/vite.config.ts @@ -1,4 +1,3 @@ -import { model } from '@/permission/model' import { fileURLToPath, URL } from 'node:url' import type { ProxyOptions } from 'vite' import { defineConfig, loadEnv } from 'vite' @@ -37,7 +36,7 @@ export default defineConfig((conf: any) => { const ENV = loadEnv(mode, envDir) const proxyConf: Record = {} proxyConf['/admin/api'] = { - // target: 'http://47.92.195.88:8080', + // target: 'http://47.92.195.88:8080/', target: 'http://127.0.0.1:8080', changeOrigin: true, }