mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-28 23:32:48 +00:00
fix: Adjust execution details and fix some bugs.
This commit is contained in:
parent
c0f0eb43e3
commit
a0103aa014
|
|
@ -568,7 +568,7 @@ const uploadFile = async (file: any, fileList: any) => {
|
|||
}
|
||||
filePromisionDict.value[file.uid] = false
|
||||
const inner = reactive(file)
|
||||
fileAllList.value.push(inner)
|
||||
// fileAllList.value.push(inner)
|
||||
if (!chatId_context.value) {
|
||||
chatId_context.value = await props.openChatId()
|
||||
}
|
||||
|
|
@ -1313,9 +1313,9 @@ async function saveUrl() {
|
|||
// 并行处理所有 URL
|
||||
await Promise.all(validUrls.map(url => processUrl(url)));
|
||||
|
||||
if (validFiles.length > 0) {
|
||||
fileAllList.value.push(...validFiles);
|
||||
}
|
||||
// if (validFiles.length > 0) {
|
||||
// fileAllList.value.push(...validFiles);
|
||||
// }
|
||||
|
||||
showURLSetting.value = false;
|
||||
urlForm.source_url = '';
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@
|
|||
</el-tooltip>
|
||||
</h5>
|
||||
<div class="p-8-12 border-t-dashed lighter">
|
||||
<el-scrollbar height="150">
|
||||
<el-scrollbar height="200">
|
||||
<el-card
|
||||
shadow="never"
|
||||
style="--el-card-padding: 8px"
|
||||
|
|
@ -310,6 +310,7 @@
|
|||
style="background: none"
|
||||
noImgZoomIn
|
||||
/>
|
||||
|
||||
<template v-else> -</template>
|
||||
</el-card>
|
||||
</el-scrollbar>
|
||||
|
|
@ -892,7 +893,11 @@
|
|||
{{ $t('views.workflow.nodes.variableAggregationNode.Strategy') }}
|
||||
</h5>
|
||||
<div class="p-8-12 border-t-dashed lighter pre-wrap">
|
||||
{{ data.strategy }}
|
||||
{{
|
||||
data.strategy === 'variable_to_json'
|
||||
? t('views.workflow.nodes.variableAggregationNode.placeholder1')
|
||||
: t('views.workflow.nodes.variableAggregationNode.placeholder')
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
|
|
@ -903,12 +908,14 @@
|
|||
<h5 class="p-8-12">
|
||||
{{ group.label + ' ' + $t('common.param.inputParam') }}
|
||||
</h5>
|
||||
<div class="p-8-12 border-t-dashed lighter">
|
||||
<div v-for="(f, i) in group.variable_list" :key="i" class="mb-8">
|
||||
<span class="color-secondary">{{ `${f.node_name}.${f.field}` }}:</span>
|
||||
{{ f.value }}
|
||||
<el-scrollbar height="200">
|
||||
<div class="p-8-12 border-t-dashed lighter">
|
||||
<div v-for="(f, i) in group.variable_list" :key="i" class="mb-8">
|
||||
<span class="color-secondary">{{ `${f.node_name}.${f.field}` }}:</span>
|
||||
{{ f.value }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<div class="card-never border-r-6 mt-8">
|
||||
<h5 class="p-8-12">
|
||||
|
|
@ -1106,9 +1113,16 @@
|
|||
>
|
||||
{{ data.split_strategy }}
|
||||
</div>
|
||||
<div class="mb-8">
|
||||
<span class="color-secondary"
|
||||
>{{ $t('views.workflow.nodes.documentSplitNode.chunk_length.label') }}:</span
|
||||
>
|
||||
{{ data.chunk_size }}
|
||||
</div>
|
||||
{{ data.size }}
|
||||
<div class="mb-8">
|
||||
<span class="color-secondary">{{ $t('common.inputContent') }}:</span>
|
||||
{{ data.document_list }}
|
||||
{{ data.document_list?.map((v: any) => v.name).join(',') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1119,72 +1133,100 @@
|
|||
}})
|
||||
</h5>
|
||||
<div class="p-8-12 border-t-dashed lighter">
|
||||
<el-radio-group v-model="currentParagraph" class="app-radio-button-group mb-8">
|
||||
<template
|
||||
v-for="(paragrapg, ParagraphIndex) in data.paragraph_list"
|
||||
:key="ParagraphIndex"
|
||||
>
|
||||
<el-radio-button :label="paragrapg.name" :value="ParagraphIndex" />
|
||||
</template>
|
||||
</el-radio-group>
|
||||
<template v-if="data.paragraph_list?.length > 0">
|
||||
<template
|
||||
v-for="(paragraph, pId) in data.paragraph_list?.[currentParagraph]?.paragraphs"
|
||||
:key="pId"
|
||||
>
|
||||
<ParagraphCard :data="paragraph" :content="paragraph.content" :index="pId">
|
||||
<template #footer>
|
||||
<span class="color-secondary">
|
||||
{{ $t('common.character') }}:{{ paragraph.content.length }}</span
|
||||
>
|
||||
<el-tabs v-model="currentParagraph" class="paragraph-tabs">
|
||||
<template v-for="(item, index) in data.paragraph_list" :key="index">
|
||||
<el-tab-pane :label="item.name" :name="index">
|
||||
<template #label>
|
||||
<div class="flex-center">
|
||||
<span class="ml-4">{{ item?.name }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</ParagraphCard>
|
||||
|
||||
<template v-for="(paragraph, pId) in item?.paragraphs" :key="pId">
|
||||
<ParagraphCard :data="paragraph" :content="paragraph.content" :index="pId">
|
||||
<template #footer>
|
||||
<span class="color-secondary">
|
||||
{{ $t('common.character') }}:{{ paragraph.content.length }}</span
|
||||
>
|
||||
</template>
|
||||
</ParagraphCard>
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
</template>
|
||||
</template>
|
||||
<template v-else> -</template>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!-- 知识库写入 -->
|
||||
<template v-if="data.type === WorkflowType.KnowledgeWriteNode">
|
||||
<div class="card-never border-r-6 mt-8">
|
||||
<h5 class="p-8-12">{{ $t('chat.executionDetails.writeContent') }}</h5>
|
||||
<div class="p-8-12 border-t-dashed lighter">
|
||||
<el-tabs v-model="currentWriteContent" class="paragraph-tabs">
|
||||
<template v-for="(item, index) in data.write_content" :key="index">
|
||||
<el-tab-pane :label="item.name" :name="index">
|
||||
<template #label>
|
||||
<div class="flex-center">
|
||||
<span class="ml-4">{{ item?.name }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-for="(paragraph, pId) in item?.paragraphs" :key="pId">
|
||||
<ParagraphCard :data="paragraph" :content="paragraph.content" :index="pId">
|
||||
<template #footer>
|
||||
<span class="color-secondary">
|
||||
{{ $t('common.character') }}:{{ paragraph.content.length }}</span
|
||||
>
|
||||
</template>
|
||||
</ParagraphCard>
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
</template>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!-- Web站点 -->
|
||||
<template v-if="data.type === WorkflowType.DataSourceWebNode">
|
||||
<div class="card-never border-r-6">
|
||||
<h5 class="p-8-12">
|
||||
{{ $t('common.param.inputParam') }}
|
||||
</h5>
|
||||
<div class="p-8-12 border-t-dashed lighter">
|
||||
<span class="color-secondary"
|
||||
>{{ $t('views.workflow.nodes.documentSplitNode.chunk_length.label') }}:</span
|
||||
>
|
||||
{{ data.size }}
|
||||
<p class="mb-8 color-secondary">
|
||||
{{ $t('views.document.form.selector.label') }}:{{ data.input_params.selector }}
|
||||
</p>
|
||||
<p class="mb-8 color-secondary">
|
||||
{{ $t('views.document.form.source_url.label') }}:{{
|
||||
data.input_params.source_url
|
||||
}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-never border-r-6 mt-8">
|
||||
<h5 class="p-8-12">{{ $t('chat.executionDetails.writeContent') }}</h5>
|
||||
<div class="card-never border-r-6">
|
||||
<h5 class="p-8-12">
|
||||
{{ $t('common.param.outputParam') }}
|
||||
</h5>
|
||||
<div class="p-8-12 border-t-dashed lighter">
|
||||
<el-radio-group v-model="currentWriteContent" class="app-radio-button-group mb-8">
|
||||
<template
|
||||
v-for="(paragrapg, ParagraphIndex) in data.write_content"
|
||||
:key="ParagraphIndex"
|
||||
<el-scrollbar height="200">
|
||||
<el-card
|
||||
shadow="never"
|
||||
style="--el-card-padding: 8px"
|
||||
v-for="(file_content, index) in data.output_params"
|
||||
:key="index"
|
||||
class="mb-8"
|
||||
>
|
||||
<el-radio-button :label="paragrapg.name" :value="ParagraphIndex" />
|
||||
</template>
|
||||
</el-radio-group>
|
||||
<template v-if="data.write_content?.length > 0">
|
||||
<template
|
||||
v-for="(paragraph, pId) in data.write_content?.[currentWriteContent]
|
||||
?.paragraphs"
|
||||
:key="pId"
|
||||
>
|
||||
<ParagraphCard :data="paragraph" :content="paragraph.content" :index="pId">
|
||||
<template #footer>
|
||||
<span class="color-secondary">
|
||||
{{ $t('common.character') }}:{{ paragraph.content.length }}</span
|
||||
>
|
||||
</template>
|
||||
</ParagraphCard>
|
||||
</template>
|
||||
</template>
|
||||
<template v-else> -</template>
|
||||
<MdPreview
|
||||
v-if="file_content"
|
||||
ref="editorRef"
|
||||
editorId="preview-only"
|
||||
:modelValue="file_content"
|
||||
style="background: none"
|
||||
noImgZoomIn
|
||||
/>
|
||||
<template v-else> -</template>
|
||||
</el-card>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
</span>
|
||||
</div>
|
||||
|
||||
<el-scrollbar :max-height="first ? 0 : 450">
|
||||
<el-scrollbar :max-height="first ? '' : 450">
|
||||
<div class="mt-16" style="padding: 0 8px; height: calc(100% - 100px)">
|
||||
<DynamicsForm
|
||||
:key="dynamicsFormRefresh"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import { defineStore } from 'pinia'
|
||||
import { type Ref } from 'vue'
|
||||
const useApplicationStore = defineStore('application', {
|
||||
state: () => ({
|
||||
location: `${window.location.origin}${window.MaxKB.chatPrefix ? window.MaxKB.chatPrefix : window.MaxKB.prefix}/`,
|
||||
|
|
|
|||
|
|
@ -180,7 +180,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
.import-button {
|
||||
.el-upload {
|
||||
display: block !important;
|
||||
|
|
@ -329,3 +328,31 @@
|
|||
border-color: var(--el-color-primary);
|
||||
}
|
||||
}
|
||||
|
||||
// 分段预览的tab样式
|
||||
.paragraph-tabs {
|
||||
.el-tabs__item {
|
||||
background: var(--app-text-color-light-1);
|
||||
margin: 4px;
|
||||
border-radius: 4px;
|
||||
padding: 5px 10px 5px 8px !important;
|
||||
height: auto;
|
||||
&:nth-child(2) {
|
||||
margin-left: 0;
|
||||
}
|
||||
&:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
&.is-active {
|
||||
border: 1px solid var(--el-color-primary);
|
||||
background: var(--el-color-primary-light-9);
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
}
|
||||
.el-tabs__nav-wrap::after {
|
||||
display: none;
|
||||
}
|
||||
.el-tabs__active-bar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -563,7 +563,10 @@ function toChat(row: any) {
|
|||
aips = aips ? aips : []
|
||||
const apiParams = mapToUrlParams(aips) ? '?' + mapToUrlParams(aips) : ''
|
||||
ApplicationApi.getAccessToken(row.id, loading).then((res: any) => {
|
||||
window.open(application.location + res?.data?.access_token + apiParams)
|
||||
const newUrl = router.resolve({
|
||||
path: application.location + res?.data?.access_token + apiParams,
|
||||
}).href
|
||||
window.open(newUrl)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
direction="rtl"
|
||||
destroy-on-close
|
||||
:before-close="close"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
>
|
||||
<div style="height: calc(100% - 57px)" v-loading="loading">
|
||||
<keep-alive :key="key" :include="['data_source', 'knowledge_base']">
|
||||
|
|
|
|||
|
|
@ -324,7 +324,7 @@ const publish = () => {
|
|||
)
|
||||
})
|
||||
.then((ok: any) => {
|
||||
MsgSuccess(t('views.knowledge.tip.publishSuccess'))
|
||||
MsgSuccess(t('views.application.tip.publishSuccess'))
|
||||
})
|
||||
.catch((res: any) => {
|
||||
const node = res.node
|
||||
|
|
|
|||
|
|
@ -41,32 +41,6 @@ defineProps({
|
|||
const activeName = ref(0)
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.paragraph-tabs {
|
||||
:deep(.el-tabs__item) {
|
||||
background: var(--app-text-color-light-1);
|
||||
margin: 4px;
|
||||
border-radius: 4px;
|
||||
padding: 5px 10px 5px 8px !important;
|
||||
height: auto;
|
||||
&:nth-child(2) {
|
||||
margin-left: 0;
|
||||
}
|
||||
&:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
&.is-active {
|
||||
border: 1px solid var(--el-color-primary);
|
||||
background: var(--el-color-primary-light-9);
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
}
|
||||
:deep(.el-tabs__nav-wrap::after) {
|
||||
display: none;
|
||||
}
|
||||
:deep(.el-tabs__active-bar) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.paragraph-list {
|
||||
height: calc(100vh - 319px);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ const submitHandle = async () => {
|
|||
.then((res: any) => {
|
||||
MsgSuccess(t('common.createSuccess'))
|
||||
router.push({
|
||||
path: `/knowledge/${res.data.id}/${currentFolder.value.id || 'shared'}/4/document`,
|
||||
path: `/knowledge/${res.data.id}/${currentFolder.value.id || 'shared'}/workflow`,
|
||||
})
|
||||
emit('refresh')
|
||||
})
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
</el-icon>
|
||||
</el-button>
|
||||
<el-dropdown
|
||||
v-if="showOperate(nodeModel.type)"
|
||||
v-if="showConditionOperate(nodeModel.type)"
|
||||
:teleported="false"
|
||||
trigger="click"
|
||||
placement="bottom-start"
|
||||
|
|
@ -174,7 +174,7 @@ import { ref, computed, onMounted, inject } from 'vue'
|
|||
import { set } from 'lodash'
|
||||
import { iconComponent } from '../icons/utils'
|
||||
import { copyClick } from '@/utils/clipboard'
|
||||
import { WorkflowType } from '@/enums/application'
|
||||
import { WorkflowType, WorkflowKind } from '@/enums/application'
|
||||
import { MsgError, MsgConfirm } from '@/utils/message'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import { t } from '@/locales'
|
||||
|
|
@ -350,6 +350,20 @@ function showOperate(type: string) {
|
|||
WorkflowType.LoopStartNode.toString(),
|
||||
].includes(type)
|
||||
}
|
||||
|
||||
function showConditionOperate(type: string) {
|
||||
console.log(props.nodeModel)
|
||||
return (
|
||||
![
|
||||
WorkflowType.Start,
|
||||
WorkflowType.Base,
|
||||
WorkflowType.KnowledgeBase,
|
||||
WorkflowType.LoopStartNode.toString(),
|
||||
WorkflowType.DataSourceLocalNode,
|
||||
WorkflowType.DataSourceWebNode,
|
||||
].includes(type) && props.nodeModel.properties.kind != WorkflowKind.DataSource
|
||||
)
|
||||
}
|
||||
const openNodeMenu = (anchorValue: any) => {
|
||||
showAnchor.value = true
|
||||
anchorData.value = anchorValue
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
v-if="props.nodeModel.properties.user_input_field_list?.length > 0"
|
||||
:data="props.nodeModel.properties.user_input_field_list"
|
||||
class="mb-16"
|
||||
ref="tableRef"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
<template>
|
||||
<NodeContainer :nodeModel="nodeModel">
|
||||
<h5 class="title-decoration-1 mb-8">{{ $t('views.workflow.nodeSetting') }}</h5>
|
||||
<UserInputFieldTable ref="UserInputFieldTableFef" :node-model="nodeModel" />
|
||||
|
||||
<h5 class="title-decoration-1 mb-8 mt-8">
|
||||
{{ $t('common.param.outputParam') }}
|
||||
</h5>
|
||||
<template v-if="nodeFields.length > 0">
|
||||
<h5 class="title-decoration-1 mb-8 mt-8">
|
||||
{{ $t('common.param.outputParam') }}
|
||||
</h5>
|
||||
<template v-for="(item, index) in nodeFields" :key="index">
|
||||
<div
|
||||
class="flex-between border-r-6 p-8-12 mb-8 layout-bg lighter"
|
||||
|
|
@ -25,6 +27,9 @@
|
|||
</div>
|
||||
</template>
|
||||
</template>
|
||||
<div v-else class="border-r-6 p-8-12 mb-8 layout-bg lighter">
|
||||
{{ $t('common.noData') }}
|
||||
</div>
|
||||
</NodeContainer>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
|
|
|||
Loading…
Reference in New Issue