diff --git a/web/app/(commonLayout)/workflow/nodes/page.tsx b/web/app/(commonLayout)/workflow/nodes/page.tsx index 3179a48032..83086233fa 100644 --- a/web/app/(commonLayout)/workflow/nodes/page.tsx +++ b/web/app/(commonLayout)/workflow/nodes/page.tsx @@ -32,8 +32,8 @@ const allMockData = { [BlockEnum.End]: EndNodeMock, } const nodes = [ - BlockEnum.Start/* 1 */, BlockEnum.QuestionClassifier/* 5 */, BlockEnum.DirectAnswer/* 2 */, BlockEnum.LLM/* 3 */, BlockEnum.KnowledgeRetrieval/* 4 */, - BlockEnum.IfElse/* 6 */, BlockEnum.Code/* 7 */, BlockEnum.TemplateTransform/* 8 */, BlockEnum.HttpRequest/* 9 */, BlockEnum.Tool/* 10 */, + BlockEnum.Code/* 7 */, BlockEnum.Start/* 1 */, BlockEnum.QuestionClassifier/* 5 */, BlockEnum.DirectAnswer/* 2 */, BlockEnum.LLM/* 3 */, BlockEnum.KnowledgeRetrieval/* 4 */, + BlockEnum.IfElse/* 6 */, BlockEnum.TemplateTransform/* 8 */, BlockEnum.HttpRequest/* 9 */, BlockEnum.Tool/* 10 */, BlockEnum.VariableAssigner/* 11 */, BlockEnum.End/* 12 */, ].map((item, i) => { const payload = allMockData[item] @@ -78,7 +78,6 @@ const Page: FC = () => { ) diff --git a/web/app/components/workflow/nodes/_base/components/editor/base.tsx b/web/app/components/workflow/nodes/_base/components/editor/base.tsx index 09f004c44c..3f3f8d5f9c 100644 --- a/web/app/components/workflow/nodes/_base/components/editor/base.tsx +++ b/web/app/components/workflow/nodes/_base/components/editor/base.tsx @@ -40,7 +40,7 @@ const Base: FC = ({ }, [isExpanded]) return ( -
+
{title}
diff --git a/web/app/components/workflow/nodes/_base/components/editor/code-editor.tsx b/web/app/components/workflow/nodes/_base/components/editor/code-editor.tsx index d8e819c118..a593961442 100644 --- a/web/app/components/workflow/nodes/_base/components/editor/code-editor.tsx +++ b/web/app/components/workflow/nodes/_base/components/editor/code-editor.tsx @@ -1,13 +1,15 @@ 'use client' import type { FC } from 'react' +import Editor from '@monaco-editor/react' import React from 'react' import Base from './base' +import { CodeLanguage } from '@/app/components/workflow/nodes/code/types' type Props = { value: string onChange: (value: string) => void title: JSX.Element - language?: string + language: CodeLanguage headerRight?: JSX.Element } @@ -16,9 +18,13 @@ const CodeEditor: FC = ({ onChange, title, headerRight, + language, }) => { const [isFocus, setIsFocus] = React.useState(false) + const handleEditorChange = (value: string | undefined) => { + onChange(value || '') + } return (
= ({ value={value} headerRight={headerRight} isFocus={isFocus} - minHeight={86} + minHeight={200} > -