fix: agent log structure

This commit is contained in:
zxhlyh 2024-12-30 11:25:28 +08:00
parent f72818bed5
commit 98a03b0593
2 changed files with 12 additions and 10 deletions

View File

@ -5,16 +5,13 @@ import type { AgentLogItemWithChildren } from '@/types/workflow'
type AgentLogNavProps = {
agentOrToolLogItemStack: { id: string; label: string }[]
agentOrToolLogListMap: Record<string, AgentLogItemWithChildren[]>
onShowAgentOrToolLog: (detail?: AgentLogItemWithChildren) => void
}
const AgentLogNav = ({
agentOrToolLogItemStack,
agentOrToolLogListMap,
onShowAgentOrToolLog,
}: AgentLogNavProps) => {
const top = agentOrToolLogItemStack[agentOrToolLogItemStack.length - 1]
const options = agentOrToolLogListMap[top.id]
const options = agentOrToolLogItemStack.slice(2)
return (
<div className='flex items-center p-1 pr-3 h-8'>
@ -37,11 +34,17 @@ const AgentLogNav = ({
<RiArrowLeftLine className='mr-1 w-3.5 h-3.5' />
Agent strategy
</Button>
<div className='shrink-0 mx-0.5 system-xs-regular text-divider-deep'>/</div>
<AgentLogNavMore
options={options}
onShowAgentOrToolLog={onShowAgentOrToolLog}
/>
{
!!options.length && (
<>
<div className='shrink-0 mx-0.5 system-xs-regular text-divider-deep'>/</div>
<AgentLogNavMore
options={options}
onShowAgentOrToolLog={onShowAgentOrToolLog}
/>
</>
)
}
<div className='shrink-0 mx-0.5 system-xs-regular text-divider-deep'>/</div>
<div className='flex items-center px-[5px] system-xs-medium-uppercase text-text-tertiary'>
Run Actions

View File

@ -19,7 +19,6 @@ const AgentResultPanel = ({
<div className='overflow-y-auto'>
<AgentLogNav
agentOrToolLogItemStack={agentOrToolLogItemStack}
agentOrToolLogListMap={agentOrToolLogListMap}
onShowAgentOrToolLog={onShowAgentOrToolLog}
/>
{