mirror of
https://github.com/langgenius/dify.git
synced 2025-11-27 11:26:52 +00:00
feat: Update useConfigurations and useHiddenConfigurations to use InputVarType constants for type values
This commit is contained in:
parent
d1d83f8a2a
commit
7c3af74b0d
@ -117,7 +117,7 @@ export const useConfigurations = (props: {
|
|||||||
required: true,
|
required: true,
|
||||||
showConditions: [{
|
showConditions: [{
|
||||||
variable: 'type',
|
variable: 'type',
|
||||||
value: 'text-input',
|
value: InputVarType.textInput,
|
||||||
}],
|
}],
|
||||||
min: 1,
|
min: 1,
|
||||||
max: TEXT_MAX_LENGTH,
|
max: TEXT_MAX_LENGTH,
|
||||||
@ -128,7 +128,7 @@ export const useConfigurations = (props: {
|
|||||||
required: true,
|
required: true,
|
||||||
showConditions: [{
|
showConditions: [{
|
||||||
variable: 'type',
|
variable: 'type',
|
||||||
value: 'select',
|
value: InputVarType.select,
|
||||||
}],
|
}],
|
||||||
}, {
|
}, {
|
||||||
type: InputFieldType.fileTypes,
|
type: InputFieldType.fileTypes,
|
||||||
@ -137,7 +137,7 @@ export const useConfigurations = (props: {
|
|||||||
required: true,
|
required: true,
|
||||||
showConditions: [{
|
showConditions: [{
|
||||||
variable: 'type',
|
variable: 'type',
|
||||||
value: 'file',
|
value: InputVarType.singleFile,
|
||||||
}],
|
}],
|
||||||
}, {
|
}, {
|
||||||
type: InputFieldType.fileTypes,
|
type: InputFieldType.fileTypes,
|
||||||
@ -146,7 +146,7 @@ export const useConfigurations = (props: {
|
|||||||
required: true,
|
required: true,
|
||||||
showConditions: [{
|
showConditions: [{
|
||||||
variable: 'type',
|
variable: 'type',
|
||||||
value: 'file-list',
|
value: InputVarType.multiFiles,
|
||||||
}],
|
}],
|
||||||
}, {
|
}, {
|
||||||
type: InputFieldType.checkbox,
|
type: InputFieldType.checkbox,
|
||||||
@ -201,18 +201,29 @@ export const useHiddenConfigurations = (props: {
|
|||||||
required: false,
|
required: false,
|
||||||
showConditions: [{
|
showConditions: [{
|
||||||
variable: 'type',
|
variable: 'type',
|
||||||
value: 'text-input',
|
value: InputVarType.textInput,
|
||||||
}],
|
}],
|
||||||
showOptional: true,
|
showOptional: true,
|
||||||
}, {
|
}, {
|
||||||
type: InputFieldType.textInput,
|
type: InputFieldType.textInput,
|
||||||
|
label: t('appDebug.variableConfig.defaultValue'),
|
||||||
|
variable: 'default',
|
||||||
|
placeholder: t('appDebug.variableConfig.defaultValuePlaceholder'),
|
||||||
|
required: false,
|
||||||
|
showConditions: [{
|
||||||
|
variable: 'type',
|
||||||
|
value: InputVarType.paragraph,
|
||||||
|
}],
|
||||||
|
showOptional: true,
|
||||||
|
}, {
|
||||||
|
type: InputFieldType.numberInput,
|
||||||
label: t('appDebug.variableConfig.defaultValue'),
|
label: t('appDebug.variableConfig.defaultValue'),
|
||||||
variable: 'default',
|
variable: 'default',
|
||||||
placeholder: t('appDebug.variableConfig.defaultValuePlaceholder'),
|
placeholder: t('appDebug.variableConfig.defaultValuePlaceholder'),
|
||||||
required: false,
|
required: false,
|
||||||
showConditions: [{
|
showConditions: [{
|
||||||
variable: 'type',
|
variable: 'type',
|
||||||
value: 'number',
|
value: InputVarType.number,
|
||||||
}],
|
}],
|
||||||
showOptional: true,
|
showOptional: true,
|
||||||
}, {
|
}, {
|
||||||
@ -222,7 +233,7 @@ export const useHiddenConfigurations = (props: {
|
|||||||
required: false,
|
required: false,
|
||||||
showConditions: [{
|
showConditions: [{
|
||||||
variable: 'type',
|
variable: 'type',
|
||||||
value: 'select',
|
value: InputVarType.select,
|
||||||
}],
|
}],
|
||||||
showOptional: true,
|
showOptional: true,
|
||||||
options: defaultSelectOptions,
|
options: defaultSelectOptions,
|
||||||
@ -237,18 +248,7 @@ export const useHiddenConfigurations = (props: {
|
|||||||
required: false,
|
required: false,
|
||||||
showConditions: [{
|
showConditions: [{
|
||||||
variable: 'type',
|
variable: 'type',
|
||||||
value: 'text-input',
|
value: InputVarType.textInput,
|
||||||
}],
|
|
||||||
showOptional: true,
|
|
||||||
}, {
|
|
||||||
type: InputFieldType.textInput,
|
|
||||||
label: t('appDebug.variableConfig.unit'),
|
|
||||||
variable: 'unit',
|
|
||||||
placeholder: t('appDebug.variableConfig.unitPlaceholder'),
|
|
||||||
required: false,
|
|
||||||
showConditions: [{
|
|
||||||
variable: 'type',
|
|
||||||
value: 'number',
|
|
||||||
}],
|
}],
|
||||||
showOptional: true,
|
showOptional: true,
|
||||||
}, {
|
}, {
|
||||||
@ -259,7 +259,29 @@ export const useHiddenConfigurations = (props: {
|
|||||||
required: false,
|
required: false,
|
||||||
showConditions: [{
|
showConditions: [{
|
||||||
variable: 'type',
|
variable: 'type',
|
||||||
value: 'number',
|
value: InputVarType.paragraph,
|
||||||
|
}],
|
||||||
|
showOptional: true,
|
||||||
|
}, {
|
||||||
|
type: InputFieldType.textInput,
|
||||||
|
label: t('appDebug.variableConfig.unit'),
|
||||||
|
variable: 'unit',
|
||||||
|
placeholder: t('appDebug.variableConfig.unitPlaceholder'),
|
||||||
|
required: false,
|
||||||
|
showConditions: [{
|
||||||
|
variable: 'type',
|
||||||
|
value: InputVarType.number,
|
||||||
|
}],
|
||||||
|
showOptional: true,
|
||||||
|
}, {
|
||||||
|
type: InputFieldType.textInput,
|
||||||
|
label: t('appDebug.variableConfig.placeholder'),
|
||||||
|
variable: 'placeholder',
|
||||||
|
placeholder: t('appDebug.variableConfig.placeholderPlaceholder'),
|
||||||
|
required: false,
|
||||||
|
showConditions: [{
|
||||||
|
variable: 'type',
|
||||||
|
value: InputVarType.number,
|
||||||
}],
|
}],
|
||||||
showOptional: true,
|
showOptional: true,
|
||||||
}, {
|
}, {
|
||||||
@ -269,7 +291,7 @@ export const useHiddenConfigurations = (props: {
|
|||||||
required: false,
|
required: false,
|
||||||
showConditions: [{
|
showConditions: [{
|
||||||
variable: 'type',
|
variable: 'type',
|
||||||
value: 'file',
|
value: InputVarType.singleFile,
|
||||||
}],
|
}],
|
||||||
}, {
|
}, {
|
||||||
type: InputFieldType.uploadMethod,
|
type: InputFieldType.uploadMethod,
|
||||||
@ -278,7 +300,7 @@ export const useHiddenConfigurations = (props: {
|
|||||||
required: false,
|
required: false,
|
||||||
showConditions: [{
|
showConditions: [{
|
||||||
variable: 'type',
|
variable: 'type',
|
||||||
value: 'file-list',
|
value: InputVarType.multiFiles,
|
||||||
}],
|
}],
|
||||||
}, {
|
}, {
|
||||||
type: InputFieldType.numberSlider,
|
type: InputFieldType.numberSlider,
|
||||||
@ -287,7 +309,7 @@ export const useHiddenConfigurations = (props: {
|
|||||||
required: false,
|
required: false,
|
||||||
showConditions: [{
|
showConditions: [{
|
||||||
variable: 'type',
|
variable: 'type',
|
||||||
value: 'file-list',
|
value: InputVarType.multiFiles,
|
||||||
}],
|
}],
|
||||||
description: t('appDebug.variableConfig.maxNumberTip', {
|
description: t('appDebug.variableConfig.maxNumberTip', {
|
||||||
imgLimit: formatFileSize(imgSizeLimit),
|
imgLimit: formatFileSize(imgSizeLimit),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user