Parcourir la source

fix: in variable settings, use Textarea to replace Input. (#17864)

tags/1.3.0
Good Wood il y a 6 mois
Parent
révision
fe19cc7568
Aucun compte lié à l'adresse e-mail de l'auteur

+ 4
- 2
web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsx Voir le fichier

@@ -322,9 +322,11 @@ const ChatVariableModal = ({
</div>
<div className='flex'>
{type === ChatVarType.String && (
<Input
placeholder={t('workflow.chatVariable.modal.valuePlaceholder') || ''}
// Input will remove \n\r, so use Textarea just like description area
<textarea
className='system-sm-regular placeholder:system-sm-regular block h-20 w-full resize-none appearance-none rounded-lg border border-transparent bg-components-input-bg-normal p-2 caret-primary-600 outline-none placeholder:text-components-input-text-placeholder hover:border-components-input-border-hover hover:bg-components-input-bg-hover focus:border-components-input-border-active focus:bg-components-input-bg-active focus:shadow-xs'
value={value}
placeholder={t('workflow.chatVariable.modal.valuePlaceholder') || ''}
onChange={e => setValue(e.target.value)}
/>
)}

+ 14
- 6
web/app/components/workflow/panel/env-panel/variable-modal.tsx Voir le fichier

@@ -131,12 +131,20 @@ const VariableModal = ({
<div className=''>
<div className='system-sm-semibold mb-1 flex h-6 items-center text-text-secondary'>{t('workflow.env.modal.value')}</div>
<div className='flex'>
<Input
placeholder={t('workflow.env.modal.valuePlaceholder') || ''}
value={value}
onChange={e => setValue(e.target.value)}
type={type !== 'number' ? 'text' : 'number'}
/>
{
type !== 'number' ? <textarea
className='system-sm-regular placeholder:system-sm-regular block h-20 w-full resize-none appearance-none rounded-lg border border-transparent bg-components-input-bg-normal p-2 caret-primary-600 outline-none placeholder:text-components-input-text-placeholder hover:border-components-input-border-hover hover:bg-components-input-bg-hover focus:border-components-input-border-active focus:bg-components-input-bg-active focus:shadow-xs'
value={value}
placeholder={t('workflow.env.modal.valuePlaceholder') || ''}
onChange={e => setValue(e.target.value)}
/>
: <Input
placeholder={t('workflow.env.modal.valuePlaceholder') || ''}
value={value}
onChange={e => setValue(e.target.value)}
type="number"
/>
}
</div>
</div>
</div>

Chargement…
Annuler
Enregistrer