Feat/loop break node (#17268)

This commit is contained in:
zxhlyh 2025-04-01 16:52:07 +08:00 • committed by GitHub
commit 713902dc47
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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,