Feat/loop break node (#17268)

This commit is contained in:
zxhlyh
2025-04-01 16:52:07 +08:00
committed by GitHub
parent 627a9e2ce1
commit 713902dc47
64 changed files with 1397 additions and 139 deletions

View File

@@ -15,6 +15,7 @@ import { BLOCK_CLASSIFICATIONS } from './constants'
import { useBlocks } from './hooks'
import type { ToolDefaultValue } from './types'
import Tooltip from '@/app/components/base/tooltip'
import Badge from '@/app/components/base/badge'
type BlocksProps = {
searchText: string
@@ -90,7 +91,15 @@ const Blocks = ({
className='mr-2 shrink-0'
type={block.type}
/>
<div className='text-sm text-text-secondary'>{block.title}</div>
<div className='grow text-sm text-text-secondary'>{block.title}</div>
{
block.type === BlockEnum.LoopEnd && (
<Badge
text={t('workflow.nodes.loop.loopNode')}
className='ml-2 shrink-0'
/>
)
}
</div>
</Tooltip>
))

View File

@@ -39,6 +39,12 @@ export const BLOCKS: Block[] = [
type: BlockEnum.IfElse,
title: 'IF/ELSE',
},
{
classification: BlockClassificationEnum.Logic,
type: BlockEnum.LoopEnd,
title: 'Exit Loop',
description: '',
},
{
classification: BlockClassificationEnum.Logic,
type: BlockEnum.Iteration,