Kaynağa Gözat

chatflow/workflow add field required (#18892)

tags/1.3.1
Junjie.M 6 ay önce
ebeveyn
işleme
e3daef19e7
No account linked to committer's email address

+ 5
- 1
web/app/components/workflow/nodes/_base/components/field.tsx Dosyayı Görüntüle

children?: React.JSX.Element | string | null children?: React.JSX.Element | string | null
operations?: React.JSX.Element operations?: React.JSX.Element
inline?: boolean inline?: boolean
required?: boolean
} }


const Field: FC<Props> = ({ const Field: FC<Props> = ({
operations, operations,
inline, inline,
supportFold, supportFold,
required,
}) => { }) => {
const [fold, { const [fold, {
toggle: toggleFold, toggle: toggleFold,
onClick={() => supportFold && toggleFold()} onClick={() => supportFold && toggleFold()}
className={cn('flex items-center justify-between', supportFold && 'cursor-pointer')}> className={cn('flex items-center justify-between', supportFold && 'cursor-pointer')}>
<div className='flex h-6 items-center'> <div className='flex h-6 items-center'>
<div className={cn(isSubTitle ? 'system-xs-medium-uppercase text-text-tertiary' : 'system-sm-semibold-uppercase text-text-secondary')}>{title}</div>
<div className={cn(isSubTitle ? 'system-xs-medium-uppercase text-text-tertiary' : 'system-sm-semibold-uppercase text-text-secondary')}>
{title} {required && <span className='text-text-destructive'>*</span>}
</div>
{tooltip && ( {tooltip && (
<Tooltip <Tooltip
popupContent={tooltip} popupContent={tooltip}

+ 5
- 1
web/app/components/workflow/nodes/agent/panel.tsx Dosyayı Görüntüle

const resetEditor = useStore(s => s.setControlPromptEditorRerenderKey) const resetEditor = useStore(s => s.setControlPromptEditorRerenderKey)


return <div className='my-2'> return <div className='my-2'>
<Field title={t('workflow.nodes.agent.strategy.label')} className='px-4 py-2' tooltip={t('workflow.nodes.agent.strategy.tooltip')} >
<Field
required
title={t('workflow.nodes.agent.strategy.label')}
className='px-4 py-2'
tooltip={t('workflow.nodes.agent.strategy.tooltip')} >
<AgentStrategy <AgentStrategy
strategy={inputs.agent_strategy_name ? { strategy={inputs.agent_strategy_name ? {
agent_strategy_provider_name: inputs.agent_strategy_provider_name!, agent_strategy_provider_name: inputs.agent_strategy_provider_name!,

+ 1
- 1
web/app/components/workflow/nodes/code/panel.tsx Dosyayı Görüntüle

operations={ operations={
<AddButton onClick={handleAddOutputVariable} /> <AddButton onClick={handleAddOutputVariable} />
} }
required
> >

<OutputVarList <OutputVarList
readonly={readOnly} readonly={readOnly}
outputs={inputs.outputs} outputs={inputs.outputs}

+ 1
- 0
web/app/components/workflow/nodes/document-extractor/panel.tsx Dosyayı Görüntüle

<div className='space-y-4 px-4 pb-4'> <div className='space-y-4 px-4 pb-4'>
<Field <Field
title={t(`${i18nPrefix}.inputVar`)} title={t(`${i18nPrefix}.inputVar`)}
required
> >
<> <>
<VarReferencePicker <VarReferencePicker

+ 2
- 0
web/app/components/workflow/nodes/http/panel.tsx Dosyayı Görüntüle

<div className='space-y-4 px-4 pb-4'> <div className='space-y-4 px-4 pb-4'>
<Field <Field
title={t(`${i18nPrefix}.api`)} title={t(`${i18nPrefix}.api`)}
required
operations={ operations={
<div className='flex'> <div className='flex'>
<div <div
</Field> </Field>
<Field <Field
title={t(`${i18nPrefix}.body`)} title={t(`${i18nPrefix}.body`)}
required
> >
<EditBody <EditBody
nodeId={id} nodeId={id}

+ 2
- 0
web/app/components/workflow/nodes/iteration/panel.tsx Dosyayı Görüntüle

<div className='space-y-4 px-4 pb-4'> <div className='space-y-4 px-4 pb-4'>
<Field <Field
title={t(`${i18nPrefix}.input`)} title={t(`${i18nPrefix}.input`)}
required
operations={( operations={(
<div className='system-2xs-medium-uppercase flex h-[18px] items-center rounded-[5px] border border-divider-deep px-1 capitalize text-text-tertiary'>Array</div> <div className='system-2xs-medium-uppercase flex h-[18px] items-center rounded-[5px] border border-divider-deep px-1 capitalize text-text-tertiary'>Array</div>
)} )}
<div className='mt-2 space-y-4 px-4 pb-4'> <div className='mt-2 space-y-4 px-4 pb-4'>
<Field <Field
title={t(`${i18nPrefix}.output`)} title={t(`${i18nPrefix}.output`)}
required
operations={( operations={(
<div className='system-2xs-medium-uppercase flex h-[18px] items-center rounded-[5px] border border-divider-deep px-1 capitalize text-text-tertiary'>Array</div> <div className='system-2xs-medium-uppercase flex h-[18px] items-center rounded-[5px] border border-divider-deep px-1 capitalize text-text-tertiary'>Array</div>
)} )}

+ 2
- 0
web/app/components/workflow/nodes/knowledge-retrieval/panel.tsx Dosyayı Görüntüle

{/* {JSON.stringify(inputs, null, 2)} */} {/* {JSON.stringify(inputs, null, 2)} */}
<Field <Field
title={t(`${i18nPrefix}.queryVariable`)} title={t(`${i18nPrefix}.queryVariable`)}
required
> >
<VarReferencePicker <VarReferencePicker
nodeId={id} nodeId={id}


<Field <Field
title={t(`${i18nPrefix}.knowledge`)} title={t(`${i18nPrefix}.knowledge`)}
required
operations={ operations={
<div className='flex items-center space-x-1'> <div className='flex items-center space-x-1'>
<RetrievalConfig <RetrievalConfig

+ 1
- 0
web/app/components/workflow/nodes/list-operator/panel.tsx Dosyayı Görüntüle

<div className='space-y-4 px-4'> <div className='space-y-4 px-4'>
<Field <Field
title={t(`${i18nPrefix}.inputVar`)} title={t(`${i18nPrefix}.inputVar`)}
required
> >
<VarReferencePicker <VarReferencePicker
readonly={readOnly} readonly={readOnly}

+ 1
- 0
web/app/components/workflow/nodes/llm/panel.tsx Dosyayı Görüntüle

<div className='space-y-4 px-4 pb-4'> <div className='space-y-4 px-4 pb-4'>
<Field <Field
title={t(`${i18nPrefix}.model`)} title={t(`${i18nPrefix}.model`)}
required
> >
<ModelParameterModal <ModelParameterModal
popupClassName='!w-[387px]' popupClassName='!w-[387px]'

+ 3
- 0
web/app/components/workflow/nodes/parameter-extractor/panel.tsx Dosyayı Görüntüle

<div className='space-y-4 px-4'> <div className='space-y-4 px-4'>
<Field <Field
title={t(`${i18nCommonPrefix}.model`)} title={t(`${i18nCommonPrefix}.model`)}
required
> >
<ModelParameterModal <ModelParameterModal
popupClassName='!w-[387px]' popupClassName='!w-[387px]'
</Field> </Field>
<Field <Field
title={t(`${i18nPrefix}.inputVar`)} title={t(`${i18nPrefix}.inputVar`)}
required
> >
<> <>
<VarReferencePicker <VarReferencePicker
/> />
<Field <Field
title={t(`${i18nPrefix}.extractParameters`)} title={t(`${i18nPrefix}.extractParameters`)}
required
operations={ operations={
!readOnly !readOnly
? ( ? (

+ 3
- 0
web/app/components/workflow/nodes/question-classifier/panel.tsx Dosyayı Görüntüle

<div className='space-y-4 px-4'> <div className='space-y-4 px-4'>
<Field <Field
title={t(`${i18nPrefix}.model`)} title={t(`${i18nPrefix}.model`)}
required
> >
<ModelParameterModal <ModelParameterModal
popupClassName='!w-[387px]' popupClassName='!w-[387px]'
</Field> </Field>
<Field <Field
title={t(`${i18nPrefix}.inputVars`)} title={t(`${i18nPrefix}.inputVars`)}
required
> >
<VarReferencePicker <VarReferencePicker
readonly={readOnly} readonly={readOnly}
/> />
<Field <Field
title={t(`${i18nPrefix}.class`)} title={t(`${i18nPrefix}.class`)}
required
> >
<ClassList <ClassList
nodeId={id} nodeId={id}

Loading…
İptal
Kaydet