mirror of https://github.com/langgenius/dify.git
Merge branch 'feat/plugins' of https://github.com/langgenius/dify into feat/plugins
This commit is contained in:
commit
84c2a9dc3b
|
|
@ -1,4 +1,5 @@
|
|||
export const tagKeys = [
|
||||
'agent',
|
||||
'search',
|
||||
'image',
|
||||
'videos',
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ const AgentLogItem = ({
|
|||
const [expanded, setExpanded] = useState(false)
|
||||
|
||||
return (
|
||||
<div className='border-[0.5px] border-components-panel-border rounded-[10px]'>
|
||||
<div className='bg-background-default border-[0.5px] border-components-panel-border rounded-[10px]'>
|
||||
<div
|
||||
className={cn(
|
||||
'flex items-center pl-1.5 pt-2 pr-3 pb-2 cursor-pointer',
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { RiArrowLeftLine } from '@remixicon/react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import AgentLogNavMore from './agent-log-nav-more'
|
||||
import Button from '@/app/components/base/button'
|
||||
import type { AgentLogItemWithChildren } from '@/types/workflow'
|
||||
|
|
@ -11,10 +12,14 @@ const AgentLogNav = ({
|
|||
agentOrToolLogItemStack,
|
||||
onShowAgentOrToolLog,
|
||||
}: AgentLogNavProps) => {
|
||||
const options = agentOrToolLogItemStack.slice(2)
|
||||
const { t } = useTranslation()
|
||||
const agentOrToolLogItemStackLength = agentOrToolLogItemStack.length
|
||||
const first = agentOrToolLogItemStack[0]
|
||||
const mid = agentOrToolLogItemStack.slice(1, -1)
|
||||
const end = agentOrToolLogItemStack.at(-1)
|
||||
|
||||
return (
|
||||
<div className='flex items-center p-1 pr-3 h-8'>
|
||||
<div className='flex items-center p-1 pr-3 h-8 bg-components-panel-bg'>
|
||||
<Button
|
||||
className='shrink-0 px-[5px]'
|
||||
size='small'
|
||||
|
|
@ -24,32 +29,48 @@ const AgentLogNav = ({
|
|||
}}
|
||||
>
|
||||
<RiArrowLeftLine className='mr-1 w-3.5 h-3.5' />
|
||||
Agent
|
||||
AGENT
|
||||
</Button>
|
||||
<div className='shrink-0 mx-0.5 system-xs-regular text-divider-deep'>/</div>
|
||||
<Button
|
||||
className='shrink-0 px-[5px]'
|
||||
size='small'
|
||||
variant='ghost-accent'
|
||||
onClick={() => {}}
|
||||
>
|
||||
Agent strategy
|
||||
</Button>
|
||||
{
|
||||
!!options.length && (
|
||||
agentOrToolLogItemStackLength > 1
|
||||
? (
|
||||
<Button
|
||||
className='shrink-0 px-[5px]'
|
||||
size='small'
|
||||
variant='ghost-accent'
|
||||
onClick={() => onShowAgentOrToolLog(first)}
|
||||
>
|
||||
{t('workflow.nodes.agent.strategy.label')}
|
||||
</Button>
|
||||
)
|
||||
: (
|
||||
<div className='flex items-center px-[5px] system-xs-medium-uppercase text-text-tertiary'>
|
||||
{t('workflow.nodes.agent.strategy.label')}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
{
|
||||
!!mid.length && (
|
||||
<>
|
||||
<div className='shrink-0 mx-0.5 system-xs-regular text-divider-deep'>/</div>
|
||||
<AgentLogNavMore
|
||||
options={options}
|
||||
options={mid}
|
||||
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
|
||||
</div>
|
||||
{
|
||||
!!end && agentOrToolLogItemStackLength > 2 && (
|
||||
<>
|
||||
<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'>
|
||||
{end.label}
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { RiArrowRightLine } from '@remixicon/react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import type {
|
||||
AgentLogItemWithChildren,
|
||||
NodeTracing,
|
||||
|
|
@ -12,12 +13,13 @@ const AgentLogTrigger = ({
|
|||
nodeInfo,
|
||||
onShowAgentOrToolLog,
|
||||
}: AgentLogTriggerProps) => {
|
||||
const { t } = useTranslation()
|
||||
const { agentLog } = nodeInfo
|
||||
|
||||
return (
|
||||
<div className='bg-components-button-tertiary-bg rounded-[10px]'>
|
||||
<div className='flex items-center px-3 pt-2 system-2xs-medium-uppercase text-text-tertiary'>
|
||||
Agent strategy
|
||||
{t('workflow.nodes.agent.strategy.label')}
|
||||
</div>
|
||||
<div className='flex items-center pl-3 pt-1 pr-2 pb-1.5'>
|
||||
<div className='shrink-0 w-5 h-5'></div>
|
||||
|
|
@ -28,7 +30,7 @@ const AgentLogTrigger = ({
|
|||
onShowAgentOrToolLog({ id: nodeInfo.id, children: agentLog || [] } as AgentLogItemWithChildren)
|
||||
}}
|
||||
>
|
||||
Detail
|
||||
{t('runLog.detail')}
|
||||
<RiArrowRightLine className='ml-0.5 w-3.5 h-3.5' />
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { RiAlertFill } from '@remixicon/react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import AgentLogItem from './agent-log-item'
|
||||
import AgentLogNav from './agent-log-nav'
|
||||
import type { AgentLogItemWithChildren } from '@/types/workflow'
|
||||
|
|
@ -13,17 +14,18 @@ const AgentResultPanel = ({
|
|||
agentOrToolLogListMap,
|
||||
onShowAgentOrToolLog,
|
||||
}: AgentResultPanelProps) => {
|
||||
const { t } = useTranslation()
|
||||
const top = agentOrToolLogItemStack[agentOrToolLogItemStack.length - 1]
|
||||
const list = agentOrToolLogListMap[top.id]
|
||||
|
||||
return (
|
||||
<div className='overflow-y-auto'>
|
||||
<div className='bg-background-section overflow-y-auto'>
|
||||
<AgentLogNav
|
||||
agentOrToolLogItemStack={agentOrToolLogItemStack}
|
||||
onShowAgentOrToolLog={onShowAgentOrToolLog}
|
||||
/>
|
||||
{
|
||||
<div className='p-2'>
|
||||
<div className='p-2 space-y-1'>
|
||||
{
|
||||
list.map(item => (
|
||||
<AgentLogItem
|
||||
|
|
@ -37,7 +39,7 @@ const AgentResultPanel = ({
|
|||
}
|
||||
{
|
||||
top.hasCircle && (
|
||||
<div className='flex items-center rounded-xl px-3 pr-2 border border-components-panel-border bg-components-panel-bg-blur shadow-md'>
|
||||
<div className='flex items-center mt-1 rounded-xl px-3 pr-2 border border-components-panel-border bg-components-panel-bg-blur shadow-md'>
|
||||
<div
|
||||
className='absolute inset-0 opacity-[0.4] rounded-xl'
|
||||
style={{
|
||||
|
|
@ -46,7 +48,7 @@ const AgentResultPanel = ({
|
|||
></div>
|
||||
<RiAlertFill className='mr-1.5 w-4 h-4 text-text-warning-secondary' />
|
||||
<div className='system-xs-medium text-text-primary'>
|
||||
There is circular invocation of tools/nodes in the current workflow.
|
||||
{t('runLog.circularInvocationTip')}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ const translation = {
|
|||
allTags: 'All Tags',
|
||||
searchTags: 'Search Tags',
|
||||
tags: {
|
||||
agent: 'Agent',
|
||||
search: 'Search',
|
||||
image: 'Image',
|
||||
videos: 'Videos',
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ const translation = {
|
|||
link: 'detail panel',
|
||||
tipRight: ' view it.',
|
||||
},
|
||||
actionLogs: 'Action Logs',
|
||||
circularInvocationTip: 'There is circular invocation of tools/nodes in the current workflow.',
|
||||
}
|
||||
|
||||
export default translation
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ const translation = {
|
|||
allTags: '所有标签',
|
||||
searchTags: '搜索标签',
|
||||
tags: {
|
||||
agent: 'Agent',
|
||||
search: '搜索',
|
||||
image: '图片',
|
||||
videos: '视频',
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ const translation = {
|
|||
link: '详细信息面板',
|
||||
tipRight: '查看它。',
|
||||
},
|
||||
actionLogs: 'Action 日志',
|
||||
circularInvocationTip: '当前工作流中存在工具/节点的循环调用。',
|
||||
}
|
||||
|
||||
export default translation
|
||||
|
|
|
|||
Loading…
Reference in New Issue