FEAT: NEW WORKFLOW ENGINE (#3160)
Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: Yeuoly <admin@srmxy.cn> Co-authored-by: JzoNg <jzongcode@gmail.com> Co-authored-by: StyleZhang <jasonapring2015@outlook.com> Co-authored-by: jyong <jyong@dify.ai> Co-authored-by: nite-knite <nkCoding@gmail.com> Co-authored-by: jyong <718720800@qq.com>
This commit is contained in:
@@ -19,6 +19,9 @@ import Tooltip from '@/app/components/base/tooltip-plus'
|
||||
import { HelpCircle } from '@/app/components/base/icons/src/vender/line/general'
|
||||
import Radio from '@/app/components/base/radio'
|
||||
type FormProps = {
|
||||
className?: string
|
||||
itemClassName?: string
|
||||
fieldLabelClassName?: string
|
||||
value: FormValue
|
||||
onChange: (val: FormValue) => void
|
||||
formSchemas: CredentialFormSchema[]
|
||||
@@ -33,6 +36,9 @@ type FormProps = {
|
||||
}
|
||||
|
||||
const Form: FC<FormProps> = ({
|
||||
className,
|
||||
itemClassName,
|
||||
fieldLabelClassName,
|
||||
value,
|
||||
onChange,
|
||||
formSchemas,
|
||||
@@ -89,8 +95,8 @@ const Form: FC<FormProps> = ({
|
||||
|
||||
const disabed = readonly || (isEditMode && (variable === '__model_type' || variable === '__model_name'))
|
||||
return (
|
||||
<div key={variable} className='py-3'>
|
||||
<div className='py-2 text-sm text-gray-900'>
|
||||
<div key={variable} className={cn(itemClassName, 'py-3')}>
|
||||
<div className={cn(fieldLabelClassName, 'py-2 text-sm text-gray-900')}>
|
||||
{label[language] || label.en_US}
|
||||
{
|
||||
required && (
|
||||
@@ -130,8 +136,8 @@ const Form: FC<FormProps> = ({
|
||||
const disabed = isEditMode && (variable === '__model_type' || variable === '__model_name')
|
||||
|
||||
return (
|
||||
<div key={variable} className='py-3'>
|
||||
<div className='py-2 text-sm text-gray-900'>
|
||||
<div key={variable} className={cn(itemClassName, 'py-3')}>
|
||||
<div className={cn(fieldLabelClassName, 'py-2 text-sm text-gray-900')}>
|
||||
{label[language] || label.en_US}
|
||||
{
|
||||
required && (
|
||||
@@ -186,8 +192,8 @@ const Form: FC<FormProps> = ({
|
||||
return null
|
||||
|
||||
return (
|
||||
<div key={variable} className='py-3'>
|
||||
<div className='py-2 text-sm text-gray-900'>
|
||||
<div key={variable} className={cn(itemClassName, 'py-3')}>
|
||||
<div className={cn(fieldLabelClassName, 'py-2 text-sm text-gray-900')}>
|
||||
{label[language] || label.en_US}
|
||||
|
||||
{
|
||||
@@ -227,7 +233,7 @@ const Form: FC<FormProps> = ({
|
||||
return null
|
||||
|
||||
return (
|
||||
<div key={variable} className='py-3'>
|
||||
<div key={variable} className={cn(itemClassName, 'py-3')}>
|
||||
<div className='flex items-center justify-between py-2 text-sm text-gray-900'>
|
||||
<div className='flex items-center space-x-2'>
|
||||
<span>{label[language] || label.en_US}</span>
|
||||
@@ -249,7 +255,7 @@ const Form: FC<FormProps> = ({
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className={className}>
|
||||
{
|
||||
formSchemas.map(formSchema => renderField(formSchema))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user