feat: add tooltip to workflow run node name (#21564)
This commit is contained in:
@@ -29,6 +29,7 @@ import type {
|
|||||||
import ErrorHandleTip from '@/app/components/workflow/nodes/_base/components/error-handle/error-handle-tip'
|
import ErrorHandleTip from '@/app/components/workflow/nodes/_base/components/error-handle/error-handle-tip'
|
||||||
import { hasRetryNode } from '@/app/components/workflow/utils'
|
import { hasRetryNode } from '@/app/components/workflow/utils'
|
||||||
import { useDocLink } from '@/context/i18n'
|
import { useDocLink } from '@/context/i18n'
|
||||||
|
import Tooltip from '@/app/components/base/tooltip'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
className?: string
|
className?: string
|
||||||
@@ -129,10 +130,16 @@ const NodePanel: FC<Props> = ({
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<BlockIcon size={inMessage ? 'xs' : 'sm'} className={cn('mr-2 shrink-0', inMessage && '!mr-1')} type={nodeInfo.node_type} toolIcon={nodeInfo.extras?.icon || nodeInfo.extras} />
|
<BlockIcon size={inMessage ? 'xs' : 'sm'} className={cn('mr-2 shrink-0', inMessage && '!mr-1')} type={nodeInfo.node_type} toolIcon={nodeInfo.extras?.icon || nodeInfo.extras} />
|
||||||
|
<Tooltip
|
||||||
|
popupContent={
|
||||||
|
<div className='max-w-xs'>{nodeInfo.title}</div>
|
||||||
|
}
|
||||||
|
>
|
||||||
<div className={cn(
|
<div className={cn(
|
||||||
'system-xs-semibold-uppercase grow truncate text-text-secondary',
|
'system-xs-semibold-uppercase grow truncate text-text-secondary',
|
||||||
hideInfo && '!text-xs',
|
hideInfo && '!text-xs',
|
||||||
)} title={nodeInfo.title}>{nodeInfo.title}</div>
|
)}>{nodeInfo.title}</div>
|
||||||
|
</Tooltip>
|
||||||
{nodeInfo.status !== 'running' && !hideInfo && (
|
{nodeInfo.status !== 'running' && !hideInfo && (
|
||||||
<div className='system-xs-regular shrink-0 text-text-tertiary'>{nodeInfo.execution_metadata?.total_tokens ? `${getTokenCount(nodeInfo.execution_metadata?.total_tokens || 0)} tokens · ` : ''}{`${getTime(nodeInfo.elapsed_time || 0)}`}</div>
|
<div className='system-xs-regular shrink-0 text-text-tertiary'>{nodeInfo.execution_metadata?.total_tokens ? `${getTokenCount(nodeInfo.execution_metadata?.total_tokens || 0)} tokens · ` : ''}{`${getTime(nodeInfo.elapsed_time || 0)}`}</div>
|
||||||
)}
|
)}
|
||||||
|
Reference in New Issue
Block a user