Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

Fix/http node timeout validation#23077 (#23117)

baonudesifeizhai72a2c3decf2b
diff --git a/web/app/components/workflow/nodes/http/components/timeout/index.tsx b/web/app/components/workflow/nodes/http/components/timeout/index.tsx
index b0fd3b229e2..40ebab0e2ae 100644
--- a/web/app/components/workflow/nodes/http/components/timeout/index.tsx
+++ b/web/app/components/workflow/nodes/http/components/timeout/index.tsx
@@ -20,7 +20,7 @@ const InputField: FC<{
description: string
placeholder: string
value?: number
- onChange: (value: number) => void
+ onChange: (value: number | undefined) => void
readOnly?: boolean
min: number
max: number
@@ -35,8 +35,18 @@ const InputField: FC<{
type='number'
value={value}
onChange={(e) => {
- const value = Math.max(min, Math.min(max, Number.parseInt(e.target.value, 10)))
- onChange(value)
+ const inputValue = e.target.value
+ if (inputValue === '') {
+ // When user clears the input, set to undefined to let backend use default values
+ onChange(undefined)
+ }
+ else {
+ const parsedValue = Number.parseInt(inputValue, 10)
+ if (!Number.isNaN(parsedValue)) {
+ const value = Math.max(min, Math.min(max, parsedValue))
+ onChange(value)
+ }
+ }
}}
placeholder={placeholder}
readOnly={readOnly}