* perf: some log, chatTest histories slice; http request failed tip

* fix: ssr render

* perf: if else node ui and fix value type select
This commit is contained in:
Archer
2024-05-07 15:27:05 +08:00
committed by GitHub
parent 2053bbdb1b
commit 8f9203c053
21 changed files with 164 additions and 137 deletions

View File

@@ -24,6 +24,7 @@ import {
} from '@fastgpt/global/core/workflow/utils';
import { getSystemVariables } from '../app/utils';
import { TFunction } from 'next-i18next';
import { ReferenceValueProps } from '@fastgpt/global/core/workflow/type/io';
export const nodeTemplate2FlowNode = ({
template,
@@ -140,6 +141,26 @@ export const computedNodeInputReference = ({
return sourceNodes;
};
export const getReferenceDataValueType = ({
variable,
nodeList,
t
}: {
variable?: ReferenceValueProps;
nodeList: FlowNodeItemType[];
t: TFunction;
}) => {
if (!variable) return WorkflowIOValueTypeEnum.any;
const node = nodeList.find((node) => node.nodeId === variable[0]);
const systemVariables = getWorkflowGlobalVariables(nodeList, t);
if (!node) return systemVariables.find((item) => item.key === variable?.[1])?.valueType;
const output = node.outputs.find((item) => item.id === variable[1]);
if (!output) return WorkflowIOValueTypeEnum.any;
return output.valueType;
};
/* Connection rules */
export const checkWorkflowNodeAndConnection = ({