diff --git a/web/src/pages/agent/form/retrieval-form/next.tsx b/web/src/pages/agent/form/retrieval-form/next.tsx index f3a000638..3f28d3f74 100644 --- a/web/src/pages/agent/form/retrieval-form/next.tsx +++ b/web/src/pages/agent/form/retrieval-form/next.tsx @@ -1,3 +1,4 @@ +import { Collapse } from '@/components/collapse'; import { CrossLanguageFormField } from '@/components/cross-language-form-field'; import { FormContainer } from '@/components/form-container'; import { KnowledgeBaseFormField } from '@/components/knowledge-base-item'; @@ -98,17 +99,19 @@ function RetrievalForm({ node }: INextOperatorForm) { - - - - - - - - + Advanced Settings}> + + + + + + + + + diff --git a/web/src/pages/agent/form/switch-form/index.tsx b/web/src/pages/agent/form/switch-form/index.tsx index e06c47996..7f173409e 100644 --- a/web/src/pages/agent/form/switch-form/index.tsx +++ b/web/src/pages/agent/form/switch-form/index.tsx @@ -127,7 +127,8 @@ function ConditionCards({ 'relative bg-transparent border-input-border border flex-1 min-w-0', { 'before:w-10 before:absolute before:h-[1px] before:bg-input-border before:top-1/2 before:-left-10': - index === 0 || index === fields.length - 1, + fields.length > 1 && + (index === 0 || index === fields.length - 1), }, )} > @@ -255,6 +256,9 @@ function SwitchForm({ node }: IOperatorForm) { }} > {fields.map((field, index) => { + const name = `${ConditionKey}.${index}`; + const conditions: Array = form.getValues(`${name}.${ItemKey}`); + const conditionLength = conditions.length; return (
@@ -272,28 +276,30 @@ function SwitchForm({ node }: IOperatorForm) { )}
-
-
-
- ( - - - - - - - )} - /> -
-
+
+ {conditionLength > 1 && ( +
+
+ ( + + + + + + + )} + /> +
+
+ )} { - - - - - - - - + Advanced Settings}> + + + + + + + + + );