Perf workflow (#1492)

* perf: handle edge check

* search model

* feat: plugin input can render all input; fix: plugin default value

* fix ts

* feat: plugin input support required
This commit is contained in:
Archer
2024-05-15 16:17:43 +08:00
committed by GitHub
parent cd876251b7
commit 8386f707cd
36 changed files with 256 additions and 160 deletions

View File

@@ -131,7 +131,7 @@ const RenderHeaderContainer = React.memo(function RenderHeaderContainer({
return null;
},
[isShowVersionHistories, edges, updateAppDetail, app._id, t]
[isV2Workflow, isShowVersionHistories, edges, updateAppDetail, app._id, t]
);
const onclickPublish = useCallback(async () => {

View File

@@ -196,7 +196,10 @@ export async function getServerSideProps(context: any) {
const currentTab = context?.query?.currentTab || TabEnum.simpleEdit;
return {
props: { currentTab, ...(await serviceSideProps(context, ['app', 'file', 'publish'])) }
props: {
currentTab,
...(await serviceSideProps(context, ['app', 'file', 'publish', 'workflow']))
}
};
}

View File

@@ -91,7 +91,7 @@ export async function getServerSideProps(context: any) {
return {
props: {
pluginId: context?.query?.pluginId || '',
...(await serviceSideProps(context))
...(await serviceSideProps(context, ['app', 'workflow']))
}
};
}

View File

@@ -20,6 +20,7 @@ import { MongoImageTypeEnum } from '@fastgpt/global/common/file/image/constants'
import { PluginTypeEnum } from '@fastgpt/global/core/plugin/constants';
import { useWorkflowStore } from '@/web/core/workflow/store/workflow';
import { EditFormType } from './type';
import { FlowNodeTypeEnum } from '@fastgpt/global/core/workflow/node/constant';
const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz1234567890', 12);
export const defaultForm: EditFormType = {
@@ -33,7 +34,7 @@ export const defaultForm: EditFormType = {
nodeId: nanoid(),
name: '自定义插件输入',
avatar: '/imgs/workflow/input.png',
flowNodeType: 'pluginInput',
flowNodeType: FlowNodeTypeEnum.pluginInput,
showStatus: false,
position: {
x: 616.4226348688949,
@@ -47,7 +48,7 @@ export const defaultForm: EditFormType = {
nodeId: nanoid(),
name: '自定义插件输出',
avatar: '/imgs/workflow/output.png',
flowNodeType: 'pluginOutput',
flowNodeType: FlowNodeTypeEnum.pluginOutput,
showStatus: false,
position: {
x: 1607.7142331269126,