瀏覽代碼

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

Co-authored-by: crazywoola <427733928@qq.com>
tags/1.7.2
baonudesifeizhai 3 月之前
父節點
當前提交
72a2c3decf
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 13 行新增3 行删除
  1. 13
    3
      web/app/components/workflow/nodes/http/components/timeout/index.tsx

+ 13
- 3
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}

Loading…
取消
儲存