mirror of https://github.com/langgenius/dify.git
form field
This commit is contained in:
parent
bdf1e9ed3b
commit
ebbed8f863
|
|
@ -3,6 +3,7 @@ import { Markdown } from '@/app/components/base/markdown'
|
|||
import Select from '@/app/components/base/select'
|
||||
import Textarea from '@/app/components/base/textarea'
|
||||
import Input from '@/app/components/base/input'
|
||||
import FormInputBoolean from '@/app/components/workflow/nodes/_base/components/form-input-boolean'
|
||||
import { FileUploaderInAttachmentWrapper } from '@/app/components/base/file-uploader'
|
||||
import { getProcessedFiles } from '@/app/components/base/file-uploader/utils'
|
||||
import { DEFAULT_VALUE_MAX_LEN } from '@/config'
|
||||
|
|
@ -73,6 +74,12 @@ const ContentItem = ({ content, formInputFields, inputs, onInputChange }: Props)
|
|||
onChange={(e) => { onInputChange(fieldName, e.target.value) }}
|
||||
/>
|
||||
)}
|
||||
{formInputField.type === 'checkbox' && (
|
||||
<FormInputBoolean
|
||||
value={inputs[fieldName] as boolean}
|
||||
onChange={value => onInputChange(fieldName, value)}
|
||||
/>
|
||||
)}
|
||||
{formInputField.type === 'file' && (
|
||||
<FileUploaderInAttachmentWrapper
|
||||
onChange={(files) => { onInputChange(fieldName, getProcessedFiles(files)[0]) }}
|
||||
|
|
|
|||
|
|
@ -187,6 +187,7 @@ export enum InputVarType {
|
|||
singleFile = 'file',
|
||||
multiFiles = 'file-list',
|
||||
loop = 'loop', // loop input
|
||||
checkbox = 'checkbox',
|
||||
}
|
||||
|
||||
export type InputVar = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue