mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 18:08:07 +08:00
chore(web): pre-align HITL frontend from build/feat/hitl
This commit is contained in:
@ -44,15 +44,18 @@ const InputsPanel = ({ onRun }: Props) => {
|
||||
const startVariables = startNode?.data.variables
|
||||
const { checkInputsForm } = useCheckInputsForms()
|
||||
|
||||
const initialInputs = { ...inputs }
|
||||
if (startVariables) {
|
||||
startVariables.forEach((variable) => {
|
||||
if (variable.default)
|
||||
initialInputs[variable.variable] = variable.default
|
||||
if (inputs[variable.variable] !== undefined)
|
||||
initialInputs[variable.variable] = inputs[variable.variable]
|
||||
})
|
||||
}
|
||||
const initialInputs = useMemo(() => {
|
||||
const result = { ...inputs }
|
||||
if (startVariables) {
|
||||
startVariables.forEach((variable) => {
|
||||
if (variable.default)
|
||||
result[variable.variable] = variable.default
|
||||
if (inputs[variable.variable] !== undefined)
|
||||
result[variable.variable] = inputs[variable.variable]
|
||||
})
|
||||
}
|
||||
return result
|
||||
}, [inputs, startVariables])
|
||||
|
||||
const variables = useMemo(() => {
|
||||
const data = startVariables || []
|
||||
@ -97,10 +100,7 @@ const InputsPanel = ({ onRun }: Props) => {
|
||||
}, [files, handleRun, initialInputs, onRun, variables, checkInputsForm])
|
||||
|
||||
const canRun = useMemo(() => {
|
||||
if (files?.some(item => (item.transfer_method as any) === TransferMethod.local_file && !item.upload_file_id))
|
||||
return false
|
||||
|
||||
return true
|
||||
return !(files?.some(item => (item.transfer_method as any) === TransferMethod.local_file && !item.upload_file_id))
|
||||
}, [files])
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user