diff --git a/web/app/components/workflow/nodes/_base/components/before-run-form/index.tsx b/web/app/components/workflow/nodes/_base/components/before-run-form/index.tsx index be392098df..fd7c02eaba 100644 --- a/web/app/components/workflow/nodes/_base/components/before-run-form/index.tsx +++ b/web/app/components/workflow/nodes/_base/components/before-run-form/index.tsx @@ -12,6 +12,7 @@ import Split from '@/app/components/workflow/nodes/_base/components/split' 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' const i18nPrefix = 'workflow.singleRun' @@ -51,7 +52,18 @@ const BeforeRunForm: FC = ({ const isFinished = runningStatus === NodeRunningStatus.Succeeded || runningStatus === NodeRunningStatus.Failed const isRunning = runningStatus === NodeRunningStatus.Running + const isFileLoaded = (() => { + // system files + const filesForm = forms.find(item => !!item.values['#files#']) + if (!filesForm) + return true + const files = filesForm.values['#files#'] as any + if (files?.some((item: any) => item.transfer_method === TransferMethod.local_file && !item.upload_file_id)) + return false + + return true + })() const handleRun = useCallback(() => { let errMsg = '' forms.forEach((form) => { @@ -129,7 +141,7 @@ const BeforeRunForm: FC = ({ )} - diff --git a/web/app/components/workflow/panel/inputs-panel.tsx b/web/app/components/workflow/panel/inputs-panel.tsx index 4dc198a3e9..35a7ea2393 100644 --- a/web/app/components/workflow/panel/inputs-panel.tsx +++ b/web/app/components/workflow/panel/inputs-panel.tsx @@ -16,6 +16,7 @@ import { } from '../store' import { useWorkflowRun } from '../hooks' import type { StartNodeType } from '../nodes/start/types' +import { TransferMethod } from '../../base/text-generation/types' import Button from '@/app/components/base/button' import { useFeatures } from '@/app/components/base/features/hooks' @@ -75,6 +76,13 @@ const InputsPanel = ({ onRun }: Props) => { handleRun({ inputs, files }) } + const canRun = (() => { + if (files?.some(item => (item.transfer_method as any) === TransferMethod.local_file && !item.upload_file_id)) + return false + + return true + })() + return ( <>
@@ -97,7 +105,7 @@ const InputsPanel = ({ onRun }: Props) => {