Commit eab405af authored by Joel's avatar Joel

chore: node add memo

parent 93999cec
import type { FC } from 'react' import type { FC } from 'react'
import React from 'react'
import type { CodeNodeType } from './types' import type { CodeNodeType } from './types'
import type { NodeProps } from '@/app/components/workflow/types' import type { NodeProps } from '@/app/components/workflow/types'
...@@ -9,4 +10,4 @@ const Node: FC<NodeProps<CodeNodeType>> = () => { ...@@ -9,4 +10,4 @@ const Node: FC<NodeProps<CodeNodeType>> = () => {
) )
} }
export default Node export default React.memo(Node)
import type { FC } from 'react' import type { FC } from 'react'
import React from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import InfoPanel from '../_base/components/info-panel' import InfoPanel from '../_base/components/info-panel'
import type { DirectAnswerNodeType } from './types' import type { DirectAnswerNodeType } from './types'
...@@ -16,4 +17,4 @@ const Node: FC<NodeProps<DirectAnswerNodeType>> = ({ ...@@ -16,4 +17,4 @@ const Node: FC<NodeProps<DirectAnswerNodeType>> = ({
) )
} }
export default Node export default React.memo(Node)
import type { FC } from 'react' import type { FC } from 'react'
import React from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import type { EndNodeType } from './types' import type { EndNodeType } from './types'
import type { NodeProps } from '@/app/components/workflow/types' import type { NodeProps } from '@/app/components/workflow/types'
...@@ -24,4 +25,4 @@ const Node: FC<NodeProps<EndNodeType>> = ({ ...@@ -24,4 +25,4 @@ const Node: FC<NodeProps<EndNodeType>> = ({
) )
} }
export default Node export default React.memo(Node)
import type { FC } from 'react' import type { FC } from 'react'
import React from 'react'
import type { HttpNodeType } from './types' import type { HttpNodeType } from './types'
import type { NodeProps } from '@/app/components/workflow/types' import type { NodeProps } from '@/app/components/workflow/types'
...@@ -16,4 +17,4 @@ const Node: FC<NodeProps<HttpNodeType>> = ({ ...@@ -16,4 +17,4 @@ const Node: FC<NodeProps<HttpNodeType>> = ({
) )
} }
export default Node export default React.memo(Node)
import type { FC } from 'react' import type { FC } from 'react'
import React from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import type { NodeProps } from 'reactflow' import type { NodeProps } from 'reactflow'
import { NodeSourceHandle } from '../_base/components/node-handle' import { NodeSourceHandle } from '../_base/components/node-handle'
...@@ -50,4 +51,4 @@ const IfElseNode: FC<NodeProps<IfElseNodeType>> = (props) => { ...@@ -50,4 +51,4 @@ const IfElseNode: FC<NodeProps<IfElseNodeType>> = (props) => {
) )
} }
export default IfElseNode export default React.memo(IfElseNode)
import { type FC, useEffect, useState } from 'react' import { type FC, useEffect, useState } from 'react'
import React from 'react'
import type { KnowledgeRetrievalNodeType } from './types' import type { KnowledgeRetrievalNodeType } from './types'
import { Folder } from '@/app/components/base/icons/src/vender/solid/files' import { Folder } from '@/app/components/base/icons/src/vender/solid/files'
import type { NodeProps } from '@/app/components/workflow/types' import type { NodeProps } from '@/app/components/workflow/types'
...@@ -38,4 +39,4 @@ const Node: FC<NodeProps<KnowledgeRetrievalNodeType>> = ({ ...@@ -38,4 +39,4 @@ const Node: FC<NodeProps<KnowledgeRetrievalNodeType>> = ({
) )
} }
export default Node export default React.memo(Node)
import type { FC } from 'react' import type { FC } from 'react'
import React from 'react'
import type { LLMNodeType } from './types' import type { LLMNodeType } from './types'
import { import {
useTextGenerationCurrentProviderAndModelAndModelList, useTextGenerationCurrentProviderAndModelAndModelList,
...@@ -24,4 +25,4 @@ const Node: FC<NodeProps<LLMNodeType>> = ({ ...@@ -24,4 +25,4 @@ const Node: FC<NodeProps<LLMNodeType>> = ({
) )
} }
export default Node export default React.memo(Node)
...@@ -13,6 +13,7 @@ import Split from '@/app/components/workflow/nodes/_base/components/split' ...@@ -13,6 +13,7 @@ import Split from '@/app/components/workflow/nodes/_base/components/split'
import ModelParameterModal from '@/app/components/header/account-setting/model-provider-page/model-parameter-modal' import ModelParameterModal from '@/app/components/header/account-setting/model-provider-page/model-parameter-modal'
import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars' import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars'
import type { NodeProps } from '@/app/components/workflow/types' import type { NodeProps } from '@/app/components/workflow/types'
import { Resolution } from '@/types/app'
const i18nPrefix = 'workflow.nodes.llm' const i18nPrefix = 'workflow.nodes.llm'
...@@ -119,7 +120,7 @@ const Panel: FC<NodeProps<LLMNodeType>> = ({ ...@@ -119,7 +120,7 @@ const Panel: FC<NodeProps<LLMNodeType>> = ({
tooltip={t('appDebug.vision.description')!} tooltip={t('appDebug.vision.description')!}
operations={ operations={
<ResolutionPicker <ResolutionPicker
value={inputs.vision.configs.detail} value={inputs.vision.configs?.detail || Resolution.high}
onChange={handleVisionResolutionChange} onChange={handleVisionResolutionChange}
/> />
} }
......
import type { FC } from 'react' import type { FC } from 'react'
import React from 'react'
import type { NodeProps } from 'reactflow' import type { NodeProps } from 'reactflow'
import InfoPanel from '../_base/components/info-panel' import InfoPanel from '../_base/components/info-panel'
import { NodeSourceHandle } from '../_base/components/node-handle' import { NodeSourceHandle } from '../_base/components/node-handle'
...@@ -46,4 +47,4 @@ const Node: FC<NodeProps<QuestionClassifierNodeType>> = (props) => { ...@@ -46,4 +47,4 @@ const Node: FC<NodeProps<QuestionClassifierNodeType>> = (props) => {
) )
} }
export default Node export default React.memo(Node)
import type { FC } from 'react' import type { FC } from 'react'
import React from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import InputVarTypeIcon from '../_base/components/input-var-type-icon' import InputVarTypeIcon from '../_base/components/input-var-type-icon'
import type { StartNodeType } from './types' import type { StartNodeType } from './types'
...@@ -33,4 +34,4 @@ const Node: FC<NodeProps<StartNodeType>> = ({ ...@@ -33,4 +34,4 @@ const Node: FC<NodeProps<StartNodeType>> = ({
) )
} }
export default Node export default React.memo(Node)
import type { FC } from 'react' import type { FC } from 'react'
import React from 'react'
import type { TemplateTransformNodeType } from './types' import type { TemplateTransformNodeType } from './types'
import type { NodeProps } from '@/app/components/workflow/types' import type { NodeProps } from '@/app/components/workflow/types'
...@@ -9,4 +10,4 @@ const Node: FC<NodeProps<TemplateTransformNodeType>> = () => { ...@@ -9,4 +10,4 @@ const Node: FC<NodeProps<TemplateTransformNodeType>> = () => {
) )
} }
export default Node export default React.memo(Node)
import type { FC } from 'react' import type { FC } from 'react'
import React from 'react'
import type { ToolNodeType } from './types' import type { ToolNodeType } from './types'
import { VarType } from './types' import { VarType } from './types'
import { Variable02 } from '@/app/components/base/icons/src/vender/solid/development' import { Variable02 } from '@/app/components/base/icons/src/vender/solid/development'
...@@ -36,4 +37,4 @@ const Node: FC<NodeProps<ToolNodeType>> = ({ ...@@ -36,4 +37,4 @@ const Node: FC<NodeProps<ToolNodeType>> = ({
) )
} }
export default Node export default React.memo(Node)
import type { FC } from 'react' import type { FC } from 'react'
import React from 'react'
import type { NodeProps } from 'reactflow' import type { NodeProps } from 'reactflow'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { NodeTargetHandle } from '../_base/components/node-handle' import { NodeTargetHandle } from '../_base/components/node-handle'
...@@ -78,4 +79,4 @@ const Node: FC<NodeProps<VariableAssignerNodeType>> = (props) => { ...@@ -78,4 +79,4 @@ const Node: FC<NodeProps<VariableAssignerNodeType>> = (props) => {
) )
} }
export default Node export default React.memo(Node)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment