mirror of https://github.com/langgenius/dify.git
chore: node add memo
This commit is contained in:
parent
93999cec56
commit
eab405af5b
|
|
@ -1,4 +1,5 @@
|
|||
import type { FC } from 'react'
|
||||
import React from 'react'
|
||||
import type { CodeNodeType } from './types'
|
||||
import type { NodeProps } from '@/app/components/workflow/types'
|
||||
|
||||
|
|
@ -9,4 +10,4 @@ const Node: FC<NodeProps<CodeNodeType>> = () => {
|
|||
)
|
||||
}
|
||||
|
||||
export default Node
|
||||
export default React.memo(Node)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import type { FC } from 'react'
|
||||
import React from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import InfoPanel from '../_base/components/info-panel'
|
||||
import type { DirectAnswerNodeType } from './types'
|
||||
|
|
@ -16,4 +17,4 @@ const Node: FC<NodeProps<DirectAnswerNodeType>> = ({
|
|||
)
|
||||
}
|
||||
|
||||
export default Node
|
||||
export default React.memo(Node)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import type { FC } from 'react'
|
||||
import React from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import type { EndNodeType } from './types'
|
||||
import type { NodeProps } from '@/app/components/workflow/types'
|
||||
|
|
@ -24,4 +25,4 @@ const Node: FC<NodeProps<EndNodeType>> = ({
|
|||
)
|
||||
}
|
||||
|
||||
export default Node
|
||||
export default React.memo(Node)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import type { FC } from 'react'
|
||||
import React from 'react'
|
||||
import type { HttpNodeType } from './types'
|
||||
import type { NodeProps } from '@/app/components/workflow/types'
|
||||
|
||||
|
|
@ -16,4 +17,4 @@ const Node: FC<NodeProps<HttpNodeType>> = ({
|
|||
)
|
||||
}
|
||||
|
||||
export default Node
|
||||
export default React.memo(Node)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import type { FC } from 'react'
|
||||
import React from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import type { NodeProps } from 'reactflow'
|
||||
import { NodeSourceHandle } from '../_base/components/node-handle'
|
||||
|
|
@ -50,4 +51,4 @@ const IfElseNode: FC<NodeProps<IfElseNodeType>> = (props) => {
|
|||
)
|
||||
}
|
||||
|
||||
export default IfElseNode
|
||||
export default React.memo(IfElseNode)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { type FC, useEffect, useState } from 'react'
|
||||
import React from 'react'
|
||||
import type { KnowledgeRetrievalNodeType } from './types'
|
||||
import { Folder } from '@/app/components/base/icons/src/vender/solid/files'
|
||||
import type { NodeProps } from '@/app/components/workflow/types'
|
||||
|
|
@ -38,4 +39,4 @@ const Node: FC<NodeProps<KnowledgeRetrievalNodeType>> = ({
|
|||
)
|
||||
}
|
||||
|
||||
export default Node
|
||||
export default React.memo(Node)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import type { FC } from 'react'
|
||||
import React from 'react'
|
||||
import type { LLMNodeType } from './types'
|
||||
import {
|
||||
useTextGenerationCurrentProviderAndModelAndModelList,
|
||||
|
|
@ -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'
|
|||
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 type { NodeProps } from '@/app/components/workflow/types'
|
||||
import { Resolution } from '@/types/app'
|
||||
|
||||
const i18nPrefix = 'workflow.nodes.llm'
|
||||
|
||||
|
|
@ -119,7 +120,7 @@ const Panel: FC<NodeProps<LLMNodeType>> = ({
|
|||
tooltip={t('appDebug.vision.description')!}
|
||||
operations={
|
||||
<ResolutionPicker
|
||||
value={inputs.vision.configs.detail}
|
||||
value={inputs.vision.configs?.detail || Resolution.high}
|
||||
onChange={handleVisionResolutionChange}
|
||||
/>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import type { FC } from 'react'
|
||||
import React from 'react'
|
||||
import type { NodeProps } from 'reactflow'
|
||||
import InfoPanel from '../_base/components/info-panel'
|
||||
import { NodeSourceHandle } from '../_base/components/node-handle'
|
||||
|
|
@ -46,4 +47,4 @@ const Node: FC<NodeProps<QuestionClassifierNodeType>> = (props) => {
|
|||
)
|
||||
}
|
||||
|
||||
export default Node
|
||||
export default React.memo(Node)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import type { FC } from 'react'
|
||||
import React from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import InputVarTypeIcon from '../_base/components/input-var-type-icon'
|
||||
import type { StartNodeType } from './types'
|
||||
|
|
@ -33,4 +34,4 @@ const Node: FC<NodeProps<StartNodeType>> = ({
|
|||
)
|
||||
}
|
||||
|
||||
export default Node
|
||||
export default React.memo(Node)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import type { FC } from 'react'
|
||||
import React from 'react'
|
||||
import type { TemplateTransformNodeType } from './types'
|
||||
import type { NodeProps } from '@/app/components/workflow/types'
|
||||
|
||||
|
|
@ -9,4 +10,4 @@ const Node: FC<NodeProps<TemplateTransformNodeType>> = () => {
|
|||
)
|
||||
}
|
||||
|
||||
export default Node
|
||||
export default React.memo(Node)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import type { FC } from 'react'
|
||||
import React from 'react'
|
||||
import type { ToolNodeType } from './types'
|
||||
import { VarType } from './types'
|
||||
import { Variable02 } from '@/app/components/base/icons/src/vender/solid/development'
|
||||
|
|
@ -36,4 +37,4 @@ const Node: FC<NodeProps<ToolNodeType>> = ({
|
|||
)
|
||||
}
|
||||
|
||||
export default Node
|
||||
export default React.memo(Node)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import type { FC } from 'react'
|
||||
import React from 'react'
|
||||
import type { NodeProps } from 'reactflow'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { NodeTargetHandle } from '../_base/components/node-handle'
|
||||
|
|
@ -78,4 +79,4 @@ const Node: FC<NodeProps<VariableAssignerNodeType>> = (props) => {
|
|||
)
|
||||
}
|
||||
|
||||
export default Node
|
||||
export default React.memo(Node)
|
||||
|
|
|
|||
Loading…
Reference in New Issue