From c0ccffa1c306528a1e50c30ec98ddd787cb42843 Mon Sep 17 00:00:00 2001 From: Joel Date: Mon, 11 Mar 2024 16:43:13 +0800 Subject: [PATCH] chore: no var not show var group --- .../components/workflow/nodes/llm/panel.tsx | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/web/app/components/workflow/nodes/llm/panel.tsx b/web/app/components/workflow/nodes/llm/panel.tsx index 9e31a6ab07..1665f24b9c 100644 --- a/web/app/components/workflow/nodes/llm/panel.tsx +++ b/web/app/components/workflow/nodes/llm/panel.tsx @@ -16,6 +16,7 @@ import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/compo import { Resolution } from '@/types/app' import { InputVarType, type NodePanelProps } from '@/app/components/workflow/types' import BeforeRunForm from '@/app/components/workflow/nodes/_base/components/before-run-form' +import type { Props as FormProps } from '@/app/components/workflow/nodes/_base/components/before-run-form/form' const i18nPrefix = 'workflow.nodes.llm' @@ -57,14 +58,18 @@ const Panel: FC> = ({ const model = inputs.model const singleRunForms = (() => { - const forms = [ - { - label: t(`${i18nPrefix}.singleRun.variable`)!, - inputs: varInputs, - values: inputVarValues, - onChange: setInputVarValues, - }, - ] + const forms: FormProps[] = [] + + if (varInputs.length > 0) { + forms.push( + { + label: t(`${i18nPrefix}.singleRun.variable`)!, + inputs: varInputs, + values: inputVarValues, + onChange: setInputVarValues, + }, + ) + } if (inputs.context?.variable_selector && inputs.context?.variable_selector.length > 0) { forms.push(