diff --git a/web/app/components/app/configuration/config-var/config-modal/index.tsx b/web/app/components/app/configuration/config-var/config-modal/index.tsx index 861020545d..4ba451452c 100644 --- a/web/app/components/app/configuration/config-var/config-modal/index.tsx +++ b/web/app/components/app/configuration/config-var/config-modal/index.tsx @@ -21,6 +21,10 @@ import Checkbox from '@/app/components/base/checkbox' import { DEFAULT_FILE_UPLOAD_SETTING } from '@/app/components/workflow/constants' import { DEFAULT_VALUE_MAX_LEN } from '@/config' import { SimpleSelect } from '@/app/components/base/select' +import Textarea from '@/app/components/base/textarea' +import { FileUploaderInAttachmentWrapper } from '@/app/components/base/file-uploader' +import { TransferMethod } from '@/types/app' +import type { FileEntity } from '@/app/components/base/file-uploader/types' const TEXT_MAX_LENGTH = 256 @@ -82,6 +86,8 @@ const ConfigModal: FC = ({ return () => { const newPayload = produce(tempPayload, (draft) => { draft.type = type + // Clear default value when switching types + draft.default = undefined if ([InputVarType.singleFile, InputVarType.multiFiles].includes(type)) { (Object.keys(DEFAULT_FILE_UPLOAD_SETTING)).forEach((key) => { if (key !== 'max_length') @@ -234,6 +240,41 @@ const ConfigModal: FC = ({ )} + + {/* Default value for text input */} + {type === InputVarType.textInput && ( + + handlePayloadChange('default')(e.target.value || undefined)} + placeholder={t('appDebug.variableConfig.inputPlaceholder')!} + /> + + )} + + {/* Default value for paragraph */} + {type === InputVarType.paragraph && ( + +