From 3e3ae989f0093773246a3186e9ba2f21b67f4fec Mon Sep 17 00:00:00 2001 From: Joel Date: Fri, 22 Nov 2024 10:54:22 +0800 Subject: [PATCH] chore: in tool file and files all support file and files --- .../nodes/tool/components/input-var-list.tsx | 23 ++++--------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/web/app/components/workflow/nodes/tool/components/input-var-list.tsx b/web/app/components/workflow/nodes/tool/components/input-var-list.tsx index 10c534509c..722ef1ccc2 100644 --- a/web/app/components/workflow/nodes/tool/components/input-var-list.tsx +++ b/web/app/components/workflow/nodes/tool/components/input-var-list.tsx @@ -46,9 +46,7 @@ const InputVarList: FC = ({ const paramType = (type: string) => { if (type === FormTypeEnum.textNumber) return 'Number' - else if (type === FormTypeEnum.file) - return 'File' - else if (type === FormTypeEnum.files) + else if (type === FormTypeEnum.file || type === FormTypeEnum.files) return 'Files' else if (type === FormTypeEnum.select) return 'Options' @@ -141,9 +139,8 @@ const InputVarList: FC = ({ const varInput = value[variable] const isNumber = type === FormTypeEnum.textNumber const isSelect = type === FormTypeEnum.select - const isFile = type === FormTypeEnum.file - const isFileArray = type === FormTypeEnum.files - const isString = !isNumber && !isSelect && !isFile && !isFileArray + const isFile = type === FormTypeEnum.file || type === FormTypeEnum.files + const isString = !isNumber && !isSelect && !isFile return (
@@ -188,19 +185,7 @@ const InputVarList: FC = ({ onChange={handleFileChange(variable)} onOpen={handleOpen(index)} defaultVarKindType={VarKindType.variable} - filterVar={(varPayload: Var) => varPayload.type === VarType.file} - /> - )} - {isFileArray && ( - varPayload.type === VarType.arrayFile} + filterVar={(varPayload: Var) => varPayload.type === VarType.file || varPayload.type === VarType.arrayFile} /> )} {tooltip &&
{tooltip[language] || tooltip.en_US}
}