diff --git a/web/app/(commonLayout)/workflow/nodes/page.tsx b/web/app/(commonLayout)/workflow/nodes/page.tsx
index 2c6212bf2b..b411a5a839 100644
--- a/web/app/(commonLayout)/workflow/nodes/page.tsx
+++ b/web/app/(commonLayout)/workflow/nodes/page.tsx
@@ -48,7 +48,7 @@ const Page: FC = () => {
* 2 directAnswer 3: llm 5: questionClassifier
* 7 Code, 8 TemplateTransform
*/
- selectedNodeId='8'
+ selectedNodeId='3'
/>
)
diff --git a/web/app/components/workflow/nodes/code/panel.tsx b/web/app/components/workflow/nodes/code/panel.tsx
index b37bf11a62..ef00931557 100644
--- a/web/app/components/workflow/nodes/code/panel.tsx
+++ b/web/app/components/workflow/nodes/code/panel.tsx
@@ -33,32 +33,37 @@ const Panel: FC = () => {
handleCodeLanguageChange,
} = useConfig(mockData)
return (
-
-
- }
- >
-
-
-
-
+
+
+ }
+ >
+
- }
- value={inputs.code}
- onChange={handleCodeChange}
- />
+
+
+
+ }
+ value={inputs.code}
+ onChange={handleCodeChange}
+ />
+
+
+ output var
+
)
}
diff --git a/web/app/components/workflow/nodes/direct-answer/use-config.ts b/web/app/components/workflow/nodes/direct-answer/use-config.ts
index 9b189e782c..55a6f724c8 100644
--- a/web/app/components/workflow/nodes/direct-answer/use-config.ts
+++ b/web/app/components/workflow/nodes/direct-answer/use-config.ts
@@ -1,27 +1,15 @@
import { useCallback, useState } from 'react'
import produce from 'immer'
-import type { Variable } from '../../types'
+import useVarList from '../_base/hooks/use-var-list'
import type { DirectAnswerNodeType } from './types'
const useConfig = (initInputs: DirectAnswerNodeType) => {
const [inputs, setInputs] = useState(initInputs)
// variables
- const handleVarListChange = useCallback((newList: Variable[]) => {
- const newInputs = produce(inputs, (draft) => {
- draft.variables = newList
- })
- setInputs(newInputs)
- }, [inputs, setInputs])
-
- const handleAddVariable = useCallback(() => {
- const newInputs = produce(inputs, (draft) => {
- draft.variables.push({
- variable: '',
- value_selector: [],
- })
- })
- setInputs(newInputs)
- }, [inputs, setInputs])
+ const { handleVarListChange, handleAddVariable } = useVarList({
+ inputs,
+ setInputs,
+ })
const handleAnswerChange = useCallback((value: string) => {
const newInputs = produce(inputs, (draft) => {
diff --git a/web/app/components/workflow/nodes/llm/panel.tsx b/web/app/components/workflow/nodes/llm/panel.tsx
index d565ff8fa9..6b6b9b30b4 100644
--- a/web/app/components/workflow/nodes/llm/panel.tsx
+++ b/web/app/components/workflow/nodes/llm/panel.tsx
@@ -29,80 +29,85 @@ const Panel: FC = () => {
// const isChatMode = modelMode === 'chat'
return (
-
-
-
-
-
-
- }
- >
-
-
-
-
+
+
+
- }
- >
- {inputs.context.enabled
- ? (
- Context
- )
- : null}
-
-
- Prompt
-
+
+
+
+ }
+ >
+
+
+
+
+ }
+ >
+ {inputs.context.enabled
+ ? (
+
Context
+ )
+ : null}
+
+
+ Prompt
+
+
+
+ Vision
+
+
-
- Vision
-
+
+
+ <>
+
+
+ >
+
+
-
- <>
-
-
- >
-
)
}
diff --git a/web/app/components/workflow/nodes/template-transform/node.tsx b/web/app/components/workflow/nodes/template-transform/node.tsx
index b3261c4416..09b5acfb1f 100644
--- a/web/app/components/workflow/nodes/template-transform/node.tsx
+++ b/web/app/components/workflow/nodes/template-transform/node.tsx
@@ -2,7 +2,8 @@ import type { FC } from 'react'
const Node: FC = () => {
return (
- template-transform
+ // No summary content
+
)
}
diff --git a/web/app/components/workflow/nodes/template-transform/panel.tsx b/web/app/components/workflow/nodes/template-transform/panel.tsx
index e91f2955e1..efc34b8f57 100644
--- a/web/app/components/workflow/nodes/template-transform/panel.tsx
+++ b/web/app/components/workflow/nodes/template-transform/panel.tsx
@@ -23,49 +23,54 @@ const Panel: FC = () => {
handleCodeChange,
} = useConfig(mockData)
return (
-
-
- }
- >
-
-
-
- {t(`${i18nPrefix}.code`)}
- }
- headerRight={
-
- }
- value={inputs.template}
- onChange={handleCodeChange}
- />
-
-
- <>
-
+
+
+
+ }
+ >
+
- >
-
+
+
+ {t(`${i18nPrefix}.code`)}
+ }
+ headerRight={
+
+ }
+ value={inputs.template}
+ onChange={handleCodeChange}
+ />
+
+
+
+
+ <>
+
+ >
+
+
)
}