Browse Source

fix(header): update boolean form type to checkbox and improve JSX formatting in form input component

tags/2.0.0-beta.1
twwu 2 months ago
parent
commit
273dae6738

+ 1
- 1
web/app/components/header/account-setting/model-provider-page/declarations.ts View File

secretInput = 'secret-input', secretInput = 'secret-input',
select = 'select', select = 'select',
radio = 'radio', radio = 'radio',
boolean = 'boolean',
boolean = 'checkbox',
files = 'files', files = 'files',
file = 'file', file = 'file',
modelSelector = 'model-selector', modelSelector = 'model-selector',

+ 4
- 4
web/app/components/workflow/nodes/_base/components/form-input-item.tsx View File

// return VarType.appSelector // return VarType.appSelector
// else if (isModelSelector) // else if (isModelSelector)
// return VarType.modelSelector // return VarType.modelSelector
// else if (isBoolean)
// return VarType.boolean
else if (isBoolean)
return VarType.boolean
else if (isObject) else if (isObject)
return VarType.object return VarType.object
else if (isArray) else if (isArray)
return ( return (
<div className={cn('gap-1', !(isShowJSONEditor && isConstant) && 'flex')}> <div className={cn('gap-1', !(isShowJSONEditor && isConstant) && 'flex')}>
{showTypeSwitch && ( {showTypeSwitch && (
<FormInputTypeSwitch value={varInput?.type || VarKindType.constant} onChange={handleTypeChange}/>
<FormInputTypeSwitch value={varInput?.type || VarKindType.constant} onChange={handleTypeChange} />
)} )}
{isString && ( {isString && (
<MixedVariableTextInput <MixedVariableTextInput
placeholder={placeholder?.[language] || placeholder?.en_US} placeholder={placeholder?.[language] || placeholder?.en_US}
/> />
)} )}
{isBoolean && (
{isBoolean && isConstant && (
<FormInputBoolean <FormInputBoolean
value={varInput?.value as boolean} value={varInput?.value as boolean}
onChange={handleValueChange} onChange={handleValueChange}

Loading…
Cancel
Save