chore: clean up whitespace and formatting in index.vue
parent
fbfeb67db6
commit
20642223a7
|
|
@ -28,7 +28,7 @@
|
||||||
:label="$t('views.applicationWorkflow.nodes.mcpNode.reference')"
|
:label="$t('views.applicationWorkflow.nodes.mcpNode.reference')"
|
||||||
value="referencing"
|
value="referencing"
|
||||||
/>
|
/>
|
||||||
<el-option :label="$t('common.custom')" value="custom" />
|
<el-option :label="$t('common.custom')" value="custom"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -41,7 +41,8 @@
|
||||||
@submitDialog="submitDialog"
|
@submitDialog="submitDialog"
|
||||||
:placeholder="mcpServerJson"
|
:placeholder="mcpServerJson"
|
||||||
/>
|
/>
|
||||||
<el-select v-else v-model="form_data.mcp_tool_id" filterable @change="mcpToolSelectChange">
|
<el-select v-else v-model="form_data.mcp_tool_id" filterable
|
||||||
|
@change="mcpToolSelectChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="mcpTool in mcpToolSelectOptions"
|
v-for="mcpTool in mcpToolSelectOptions"
|
||||||
:key="mcpTool.id"
|
:key="mcpTool.id"
|
||||||
|
|
@ -61,7 +62,7 @@
|
||||||
<span>{{ $t('views.applicationWorkflow.nodes.mcpNode.tool') }}</span>
|
<span>{{ $t('views.applicationWorkflow.nodes.mcpNode.tool') }}</span>
|
||||||
<el-button type="primary" link @click="getTools()">
|
<el-button type="primary" link @click="getTools()">
|
||||||
<el-icon class="mr-4">
|
<el-icon class="mr-4">
|
||||||
<Plus />
|
<Plus/>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
{{ $t('views.applicationWorkflow.nodes.mcpNode.getTool') }}
|
{{ $t('views.applicationWorkflow.nodes.mcpNode.getTool') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
@ -115,7 +116,7 @@
|
||||||
<template #label>
|
<template #label>
|
||||||
<div class="flex-between">
|
<div class="flex-between">
|
||||||
<div>
|
<div>
|
||||||
<TooltipLabel :label="item.label.label" :tooltip="item.label.attrs.tooltip" />
|
<TooltipLabel :label="item.label.label" :tooltip="item.label.attrs.tooltip"/>
|
||||||
<span v-if="item.required" class="color-danger">*</span>
|
<span v-if="item.required" class="color-danger">*</span>
|
||||||
</div>
|
</div>
|
||||||
<el-select
|
<el-select
|
||||||
|
|
@ -129,7 +130,7 @@
|
||||||
:label="$t('views.applicationWorkflow.nodes.replyNode.replyContent.reference')"
|
:label="$t('views.applicationWorkflow.nodes.replyNode.replyContent.reference')"
|
||||||
value="referencing"
|
value="referencing"
|
||||||
/>
|
/>
|
||||||
<el-option :label="$t('common.custom')" value="custom" />
|
<el-option :label="$t('common.custom')" value="custom"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -184,7 +185,7 @@
|
||||||
<template #label>
|
<template #label>
|
||||||
<div class="flex-between">
|
<div class="flex-between">
|
||||||
<div>
|
<div>
|
||||||
<TooltipLabel :label="item.label.label" :tooltip="item.label.attrs.tooltip" />
|
<TooltipLabel :label="item.label.label" :tooltip="item.label.attrs.tooltip"/>
|
||||||
<span v-if="item.required" class="color-danger">*</span>
|
<span v-if="item.required" class="color-danger">*</span>
|
||||||
</div>
|
</div>
|
||||||
<el-select
|
<el-select
|
||||||
|
|
@ -197,7 +198,7 @@
|
||||||
:label="$t('views.applicationWorkflow.nodes.replyNode.replyContent.reference')"
|
:label="$t('views.applicationWorkflow.nodes.replyNode.replyContent.reference')"
|
||||||
value="referencing"
|
value="referencing"
|
||||||
/>
|
/>
|
||||||
<el-option :label="$t('common.custom')" value="custom" />
|
<el-option :label="$t('common.custom')" value="custom"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -235,7 +236,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { cloneDeep, set } from 'lodash'
|
import { cloneDeep, set } from 'lodash'
|
||||||
import NodeContainer from '@/workflow/common/NodeContainer.vue'
|
import NodeContainer from '@/workflow/common/NodeContainer.vue'
|
||||||
import { computed, onMounted, ref, inject } from 'vue'
|
import { computed, inject, onMounted, ref } from 'vue'
|
||||||
import { isLastNode } from '@/workflow/common/data'
|
import { isLastNode } from '@/workflow/common/data'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
import { MsgError, MsgSuccess } from '@/utils/message'
|
import { MsgError, MsgSuccess } from '@/utils/message'
|
||||||
|
|
@ -244,12 +245,13 @@ import NodeCascader from '@/workflow/common/NodeCascader.vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||||
import useStore from "@/stores";
|
import useStore from "@/stores";
|
||||||
|
|
||||||
const props = defineProps<{ nodeModel: any }>()
|
const props = defineProps<{ nodeModel: any }>()
|
||||||
const { user } = useStore()
|
const {user} = useStore()
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const {
|
const {
|
||||||
params: { id },
|
params: {id},
|
||||||
} = route as any
|
} = route as any
|
||||||
const getApplicationDetail = inject('getApplicationDetail') as any
|
const getApplicationDetail = inject('getApplicationDetail') as any
|
||||||
const applicationDetail = getApplicationDetail()
|
const applicationDetail = getApplicationDetail()
|
||||||
|
|
@ -300,7 +302,7 @@ function submitDialog(val: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function mcpToolSelectChange() {
|
async function mcpToolSelectChange() {
|
||||||
const tool = await loadSharedApi({ type: 'tool', systemType: apiType.value })
|
const tool = await loadSharedApi({type: 'tool', systemType: apiType.value})
|
||||||
.getToolById(form_data.value.mcp_tool_id, loading)
|
.getToolById(form_data.value.mcp_tool_id, loading)
|
||||||
form_data.value.mcp_servers = tool.data.code
|
form_data.value.mcp_servers = tool.data.code
|
||||||
}
|
}
|
||||||
|
|
@ -320,7 +322,7 @@ function getTools() {
|
||||||
MsgError(t('views.applicationWorkflow.nodes.mcpNode.mcpServerTip'))
|
MsgError(t('views.applicationWorkflow.nodes.mcpNode.mcpServerTip'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
loadSharedApi({ type: 'application', systemType: apiType.value })
|
loadSharedApi({type: 'application', systemType: apiType.value})
|
||||||
.getMcpTools(id, form_data.value.mcp_servers, loading)
|
.getMcpTools(id, form_data.value.mcp_servers, loading)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
form_data.value.mcp_tools = res.data
|
form_data.value.mcp_tools = res.data
|
||||||
|
|
@ -363,7 +365,7 @@ function changeTool() {
|
||||||
label: {
|
label: {
|
||||||
input_type: 'TooltipLabel',
|
input_type: 'TooltipLabel',
|
||||||
label: item2,
|
label: item2,
|
||||||
attrs: { tooltip: params[item2].description },
|
attrs: {tooltip: params[item2].description},
|
||||||
props_info: {},
|
props_info: {},
|
||||||
},
|
},
|
||||||
input_type: input_type,
|
input_type: input_type,
|
||||||
|
|
@ -399,7 +401,7 @@ function changeTool() {
|
||||||
label: {
|
label: {
|
||||||
input_type: 'TooltipLabel',
|
input_type: 'TooltipLabel',
|
||||||
label: item,
|
label: item,
|
||||||
attrs: { tooltip: args_schema.properties[item].description },
|
attrs: {tooltip: args_schema.properties[item].description},
|
||||||
props_info: {},
|
props_info: {},
|
||||||
},
|
},
|
||||||
input_type: input_type,
|
input_type: input_type,
|
||||||
|
|
@ -419,7 +421,7 @@ function changeTool() {
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
if (form_data.value.params_nested) {
|
if (form_data.value.params_nested) {
|
||||||
form_data.value.tool_params = { [form_data.value.params_nested]: {} }
|
form_data.value.tool_params = {[form_data.value.params_nested]: {}}
|
||||||
} else {
|
} else {
|
||||||
form_data.value.tool_params = {}
|
form_data.value.tool_params = {}
|
||||||
}
|
}
|
||||||
|
|
@ -513,6 +515,9 @@ onMounted(() => {
|
||||||
set(props.nodeModel.properties.node_data, 'is_result', true)
|
set(props.nodeModel.properties.node_data, 'is_result', true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (props.nodeModel.properties.node_data.mcp_servers) {
|
||||||
|
set(props.nodeModel.properties.node_data, 'mcp_source', 'custom')
|
||||||
|
}
|
||||||
getMcpToolSelectOptions()
|
getMcpToolSelectOptions()
|
||||||
set(props.nodeModel, 'validate', validate)
|
set(props.nodeModel, 'validate', validate)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue