mirror of https://github.com/langgenius/dify.git
node
This commit is contained in:
parent
45ef4059f0
commit
344e30bef4
|
|
@ -105,9 +105,10 @@ const Item = ({
|
|||
provider_id: data.id,
|
||||
provider_type: data.type,
|
||||
tool_name: tool.name,
|
||||
_icon: data.icon,
|
||||
title: tool.label[language],
|
||||
desc: tool.description[language],
|
||||
_icon: data.icon,
|
||||
_about: tool.description[language],
|
||||
_author: data.author,
|
||||
})}
|
||||
>
|
||||
<div className='absolute left-[22px] w-[1px] h-8 bg-black/5' />
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ export type ToolDefaultValue = {
|
|||
provider_type: string
|
||||
tool_name: string
|
||||
title: string
|
||||
desc: string
|
||||
_icon: Collection['icon']
|
||||
_about: string
|
||||
_author: string
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,24 +14,28 @@ import EndNodeDefault from './nodes/end/default'
|
|||
|
||||
export const NODES_INITIAL_DATA = {
|
||||
[BlockEnum.Start]: {
|
||||
_author: 'Dify',
|
||||
type: BlockEnum.Start,
|
||||
title: '',
|
||||
desc: '',
|
||||
...StartNodeDefault.defaultValue,
|
||||
},
|
||||
[BlockEnum.End]: {
|
||||
_author: 'Dify',
|
||||
type: BlockEnum.End,
|
||||
title: '',
|
||||
desc: '',
|
||||
...EndNodeDefault.defaultValue,
|
||||
},
|
||||
[BlockEnum.DirectAnswer]: {
|
||||
_author: 'Dify',
|
||||
type: BlockEnum.DirectAnswer,
|
||||
title: '',
|
||||
desc: '',
|
||||
...DirectAnswerDefault.defaultValue,
|
||||
},
|
||||
[BlockEnum.LLM]: {
|
||||
_author: 'Dify',
|
||||
type: BlockEnum.LLM,
|
||||
title: '',
|
||||
desc: '',
|
||||
|
|
@ -39,6 +43,7 @@ export const NODES_INITIAL_DATA = {
|
|||
...LLMDefault.defaultValue,
|
||||
},
|
||||
[BlockEnum.KnowledgeRetrieval]: {
|
||||
_author: 'Dify',
|
||||
type: BlockEnum.KnowledgeRetrieval,
|
||||
title: '',
|
||||
desc: '',
|
||||
|
|
@ -48,6 +53,7 @@ export const NODES_INITIAL_DATA = {
|
|||
...KnowledgeRetrievalDefault.defaultValue,
|
||||
},
|
||||
[BlockEnum.IfElse]: {
|
||||
_author: 'Dify',
|
||||
type: BlockEnum.IfElse,
|
||||
title: '',
|
||||
desc: '',
|
||||
|
|
@ -55,6 +61,7 @@ export const NODES_INITIAL_DATA = {
|
|||
...IfElseDefault.defaultValue,
|
||||
},
|
||||
[BlockEnum.Code]: {
|
||||
_author: 'Dify',
|
||||
type: BlockEnum.Code,
|
||||
title: '',
|
||||
desc: '',
|
||||
|
|
@ -65,6 +72,7 @@ export const NODES_INITIAL_DATA = {
|
|||
...CodeDefault.defaultValue,
|
||||
},
|
||||
[BlockEnum.TemplateTransform]: {
|
||||
_author: 'Dify',
|
||||
type: BlockEnum.TemplateTransform,
|
||||
title: '',
|
||||
desc: '',
|
||||
|
|
@ -73,6 +81,7 @@ export const NODES_INITIAL_DATA = {
|
|||
...TemplateTransformDefault.defaultValue,
|
||||
},
|
||||
[BlockEnum.QuestionClassifier]: {
|
||||
_author: 'Dify',
|
||||
type: BlockEnum.QuestionClassifier,
|
||||
title: '',
|
||||
desc: '',
|
||||
|
|
@ -81,6 +90,7 @@ export const NODES_INITIAL_DATA = {
|
|||
...QuestionClassifierDefault.defaultValue,
|
||||
},
|
||||
[BlockEnum.HttpRequest]: {
|
||||
_author: 'Dify',
|
||||
type: BlockEnum.HttpRequest,
|
||||
title: '',
|
||||
desc: '',
|
||||
|
|
@ -88,6 +98,7 @@ export const NODES_INITIAL_DATA = {
|
|||
...HttpRequestDefault.defaultValue,
|
||||
},
|
||||
[BlockEnum.VariableAssigner]: {
|
||||
_author: 'Dify',
|
||||
type: BlockEnum.VariableAssigner,
|
||||
title: '',
|
||||
desc: '',
|
||||
|
|
@ -106,3 +117,4 @@ export const NODES_INITIAL_DATA = {
|
|||
export const NODE_WIDTH = 220
|
||||
export const X_OFFSET = 64
|
||||
export const Y_OFFSET = 39
|
||||
export const TREE_DEEPTH = 20
|
||||
|
|
|
|||
|
|
@ -202,7 +202,9 @@ const WorkflowWrap: FC<WorkflowProps> = ({
|
|||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<Loading />
|
||||
<div className='flex justify-center items-center relative w-full h-full bg-[#F0F2F7]'>
|
||||
<Loading />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,18 +11,21 @@ import {
|
|||
PortalToFollowElemContent,
|
||||
PortalToFollowElemTrigger,
|
||||
} from '@/app/components/base/portal-to-follow-elem'
|
||||
import type { Node } from '@/app/components/workflow/types'
|
||||
|
||||
type PanelOperatorProps = {
|
||||
nodeId: string
|
||||
id: string
|
||||
data: Node['data']
|
||||
}
|
||||
const PanelOperator = ({
|
||||
nodeId,
|
||||
id,
|
||||
data,
|
||||
}: PanelOperatorProps) => {
|
||||
const edges = useEdges()
|
||||
const { handleNodeDelete } = useWorkflow()
|
||||
const [open, setOpen] = useState(false)
|
||||
|
||||
const edge = edges.find(edge => edge.target === nodeId)
|
||||
const edge = edges.find(edge => edge.target === id)
|
||||
|
||||
return (
|
||||
<PortalToFollowElem
|
||||
|
|
@ -49,7 +52,7 @@ const PanelOperator = ({
|
|||
<div className='w-[240px] border-[0.5px] border-gray-200 rounded-2xl shadow-xl bg-white'>
|
||||
<div className='p-1'>
|
||||
<ChangeBlock
|
||||
nodeId={nodeId}
|
||||
nodeId={id}
|
||||
sourceHandle={edge?.sourceHandle || 'source'}
|
||||
/>
|
||||
<div className='flex items-center px-3 h-8 text-sm text-gray-700 rounded-lg cursor-pointer hover:bg-gray-50'>Help Link</div>
|
||||
|
|
@ -58,7 +61,7 @@ const PanelOperator = ({
|
|||
<div className='p-1'>
|
||||
<div
|
||||
className='flex items-center px-3 h-8 text-sm text-gray-700 rounded-lg cursor-pointer hover:bg-gray-50'
|
||||
onClick={() => handleNodeDelete(nodeId)}
|
||||
onClick={() => handleNodeDelete(id)}
|
||||
>
|
||||
Delete
|
||||
</div>
|
||||
|
|
@ -69,10 +72,10 @@ const PanelOperator = ({
|
|||
<div className='flex items-center mb-1 h-[22px] font-medium'>
|
||||
ABOUT
|
||||
</div>
|
||||
<div className='text-gray-500 leading-[18px]'>A tool for performing a Google SERP search and extracting snippets and webpages.Input should be a search query.</div>
|
||||
<div className='text-gray-500 leading-[18px]'>{data._about}</div>
|
||||
<div className='my-2 h-[0.5px] bg-black/5'></div>
|
||||
<div className='leading-[18px]'>
|
||||
Created By Dify
|
||||
Created By {data._author}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ const BasePanel: FC<BasePanelProps> = ({
|
|||
data,
|
||||
children,
|
||||
}) => {
|
||||
const type = data.type
|
||||
const {
|
||||
handleNodeSelect,
|
||||
handleNodeDataUpdate,
|
||||
|
|
@ -75,7 +74,7 @@ const BasePanel: FC<BasePanelProps> = ({
|
|||
</TooltipPlus>
|
||||
)
|
||||
}
|
||||
<PanelOperator nodeId={id} />
|
||||
<PanelOperator id={id} data={data} />
|
||||
<div className='mx-3 w-[1px] h-3.5 bg-gray-200' />
|
||||
<div
|
||||
className='flex items-center justify-center w-6 h-6 cursor-pointer'
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ export type CommonNodeType<T = {}> = {
|
|||
_targetBranches?: Branch[]
|
||||
_isSingleRun?: boolean
|
||||
_icon?: Collection['icon']
|
||||
_about?: string
|
||||
_author?: string
|
||||
title: string
|
||||
desc: string
|
||||
type: BlockEnum
|
||||
|
|
|
|||
Loading…
Reference in New Issue