mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-15 15:41:05 +00:00
This reverts commit f000fbb19d
.
This commit is contained in:
@@ -341,13 +341,7 @@ export const toolSetData2FlowNodeIO = ({
|
||||
};
|
||||
|
||||
export const formatEditorVariablePickerIcon = (
|
||||
variables: {
|
||||
id: string;
|
||||
key: string;
|
||||
label: string;
|
||||
type?: `${VariableInputEnum}`;
|
||||
required?: boolean;
|
||||
}[]
|
||||
variables: { key: string; label: string; type?: `${VariableInputEnum}`; required?: boolean }[]
|
||||
): EditorVariablePickerType[] => {
|
||||
return variables.map((item) => ({
|
||||
...item,
|
||||
|
@@ -1,7 +1,6 @@
|
||||
import type { WorkflowIOValueTypeEnum } from '@fastgpt/global/core/workflow/constants';
|
||||
|
||||
export type EditorVariablePickerType = {
|
||||
id: string;
|
||||
key: string;
|
||||
label: string;
|
||||
required?: boolean;
|
||||
|
@@ -385,7 +385,7 @@ const TableItem = ({
|
||||
onClick={() => {
|
||||
const formattedItem = {
|
||||
...item,
|
||||
list: item.enums?.map((item) => ({ label: item.value, value: item.value })) || []
|
||||
list: item.enums || []
|
||||
};
|
||||
reset(formattedItem);
|
||||
}}
|
||||
|
@@ -100,14 +100,11 @@ const InputRender = (props: InputRenderProps) => {
|
||||
}
|
||||
|
||||
if (inputType === InputTypeEnum.select) {
|
||||
const list =
|
||||
props.list || props.enums?.map((item) => ({ label: item.value, value: item.value })) || [];
|
||||
return <MySelect {...commonProps} list={list} h={10} />;
|
||||
return <MySelect {...commonProps} list={props.list || []} h={10} />;
|
||||
}
|
||||
|
||||
if (inputType === InputTypeEnum.multipleSelect) {
|
||||
const list =
|
||||
props.list || props.enums?.map((item) => ({ label: item.value, value: item.value })) || [];
|
||||
const { list = [] } = props;
|
||||
return (
|
||||
<MultipleSelect<string>
|
||||
{...commonProps}
|
||||
|
@@ -40,9 +40,6 @@ type SpecificProps =
|
||||
// select & multipleSelect
|
||||
inputType: InputTypeEnum.select | InputTypeEnum.multipleSelect;
|
||||
list?: { label: string; value: string }[];
|
||||
|
||||
// old version
|
||||
enums?: { value: string }[];
|
||||
}
|
||||
| {
|
||||
// JSONEditor
|
||||
|
@@ -174,7 +174,6 @@ const RenderHttpMethodAndUrl = React.memo(function RenderHttpMethodAndUrl({
|
||||
return (
|
||||
feConfigs?.externalProviderWorkflowVariables?.map((item) => ({
|
||||
key: item.key,
|
||||
id: item.key,
|
||||
label: item.name
|
||||
})) || []
|
||||
);
|
||||
@@ -295,7 +294,6 @@ export function RenderHttpProps({
|
||||
return (
|
||||
feConfigs?.externalProviderWorkflowVariables?.map((item) => ({
|
||||
key: item.key,
|
||||
id: item.key,
|
||||
label: item.name
|
||||
})) || []
|
||||
);
|
||||
@@ -500,7 +498,6 @@ const RenderForm = ({
|
||||
input: FlowNodeInputItemType;
|
||||
variables: EditorVariableLabelPickerType[];
|
||||
externalProviderWorkflowVariables: {
|
||||
id: string;
|
||||
key: string;
|
||||
label: string;
|
||||
}[];
|
||||
@@ -687,7 +684,6 @@ const RenderBody = ({
|
||||
typeInput: FlowNodeInputItemType | undefined;
|
||||
variables: EditorVariableLabelPickerType[];
|
||||
externalProviderWorkflowVariables: {
|
||||
id: string;
|
||||
key: string;
|
||||
label: string;
|
||||
}[];
|
||||
|
@@ -67,7 +67,6 @@ const NodeVariableUpdate = ({ data, selected }: NodeProps<FlowNodeItemType>) =>
|
||||
const externalProviderWorkflowVariables = useMemo(() => {
|
||||
return (
|
||||
feConfigs?.externalProviderWorkflowVariables?.map((item) => ({
|
||||
id: item.key,
|
||||
key: item.key,
|
||||
label: item.name
|
||||
})) || []
|
||||
|
@@ -51,7 +51,6 @@ const CommonInputForm = ({ item, nodeId }: RenderInputProps) => {
|
||||
const externalVariables = useMemo(() => {
|
||||
return (
|
||||
feConfigs?.externalProviderWorkflowVariables?.map((item) => ({
|
||||
id: item.key,
|
||||
key: item.key,
|
||||
label: item.name
|
||||
})) || []
|
||||
|
@@ -247,10 +247,7 @@ const EditModal = ({ onClose, ...props }: RenderInputProps & { onClose: () => vo
|
||||
</Flex>
|
||||
|
||||
<PromptEditor
|
||||
variables={quoteTemplateVariables.map((item) => ({
|
||||
...item,
|
||||
id: item.key
|
||||
}))}
|
||||
variables={quoteTemplateVariables}
|
||||
minH={160}
|
||||
title={t('common:core.app.Quote templates')}
|
||||
placeholder={t('workflow:quote_content_placeholder')}
|
||||
@@ -271,10 +268,7 @@ const EditModal = ({ onClose, ...props }: RenderInputProps & { onClose: () => vo
|
||||
/>
|
||||
</Flex>
|
||||
<PromptEditor
|
||||
variables={quotePromptVariables.map((item) => ({
|
||||
...item,
|
||||
id: item.key
|
||||
}))}
|
||||
variables={quotePromptVariables}
|
||||
title={t('common:core.app.Quote prompt')}
|
||||
minH={300}
|
||||
placeholder={t('workflow:quote_prompt_tip', {
|
||||
|
@@ -107,7 +107,6 @@ export const getEditorVariables = ({
|
||||
const nodeVariables = currentNode.inputs
|
||||
.filter((input) => input.canEdit)
|
||||
.map((item) => ({
|
||||
id: item.key,
|
||||
key: item.key,
|
||||
label: item.label,
|
||||
parent: {
|
||||
@@ -138,7 +137,6 @@ export const getEditorVariables = ({
|
||||
)
|
||||
.map((output) => {
|
||||
return {
|
||||
id: output.id,
|
||||
label: t((output.label as any) || ''),
|
||||
key: output.id,
|
||||
parent: {
|
||||
|
@@ -582,35 +582,30 @@ export function filterSensitiveFormData(appForm: AppSimpleEditFormType) {
|
||||
|
||||
export const workflowSystemVariables: EditorVariablePickerType[] = [
|
||||
{
|
||||
id: 'userId',
|
||||
key: 'userId',
|
||||
label: i18nT('workflow:use_user_id'),
|
||||
required: true,
|
||||
valueType: WorkflowIOValueTypeEnum.string
|
||||
},
|
||||
{
|
||||
id: 'appId',
|
||||
key: 'appId',
|
||||
label: i18nT('common:core.module.http.AppId'),
|
||||
required: true,
|
||||
valueType: WorkflowIOValueTypeEnum.string
|
||||
},
|
||||
{
|
||||
id: 'chatId',
|
||||
key: 'chatId',
|
||||
label: i18nT('common:core.module.http.ChatId'),
|
||||
valueType: WorkflowIOValueTypeEnum.string,
|
||||
required: true
|
||||
},
|
||||
{
|
||||
id: 'responseChatItemId',
|
||||
key: 'responseChatItemId',
|
||||
label: i18nT('common:core.module.http.ResponseChatItemId'),
|
||||
valueType: WorkflowIOValueTypeEnum.string,
|
||||
required: true
|
||||
},
|
||||
{
|
||||
id: 'histories',
|
||||
key: 'histories',
|
||||
label: i18nT('common:core.module.http.Histories'),
|
||||
required: true,
|
||||
@@ -618,7 +613,6 @@ export const workflowSystemVariables: EditorVariablePickerType[] = [
|
||||
valueDesc: chatHistoryValueDesc
|
||||
},
|
||||
{
|
||||
id: 'cTime',
|
||||
key: 'cTime',
|
||||
label: i18nT('common:core.module.http.Current time'),
|
||||
required: true,
|
||||
|
@@ -54,7 +54,7 @@ export const getGlobalVariableNode = ({
|
||||
nodeId: VARIABLE_NODE_ID,
|
||||
...template,
|
||||
outputs: globalVariables.map((item) => ({
|
||||
id: item.id,
|
||||
id: item.key,
|
||||
type: FlowNodeOutputTypeEnum.static,
|
||||
label: item.label,
|
||||
key: item.key,
|
||||
|
Reference in New Issue
Block a user