fix(workflow_entry): Support receive File and FileList in single step run. (#10947)

Signed-off-by: -LAN- <laipz8200@outlook.com>
Co-authored-by: JzoNg <jzongcode@gmail.com>
This commit is contained in:
-LAN-
2024-11-25 12:46:50 +08:00
committed by GitHub
parent 79a35c2fe6
commit 3eb51d85da
12 changed files with 75 additions and 95 deletions

View File

@@ -16,6 +16,7 @@ import { InputVarType, NodeRunningStatus } from '@/app/components/workflow/types
import ResultPanel from '@/app/components/workflow/run/result-panel'
import Toast from '@/app/components/base/toast'
import { TransferMethod } from '@/types/app'
import { getProcessedFiles } from '@/app/components/base/file-uploader/utils'
const i18nPrefix = 'workflow.singleRun'
@@ -39,6 +40,11 @@ function formatValue(value: string | any, type: InputVarType) {
return JSON.parse(item)
})
}
if (type === InputVarType.multiFiles)
return getProcessedFiles(value)
if (type === InputVarType.singleFile)
return getProcessedFiles([value])[0]
return value
}