diff --git a/web/app/components/base/chat/chat/answer/workflow-process.tsx b/web/app/components/base/chat/chat/answer/workflow-process.tsx index 5f36e40c40..6e32ed2ae2 100644 --- a/web/app/components/base/chat/chat/answer/workflow-process.tsx +++ b/web/app/components/base/chat/chat/answer/workflow-process.tsx @@ -11,10 +11,10 @@ import { } from '@remixicon/react' import { useTranslation } from 'react-i18next' import type { ChatItem, WorkflowProcess } from '../../types' +import TracingPanel from '@/app/components/workflow/run/tracing-panel' import cn from '@/utils/classnames' import { CheckCircle } from '@/app/components/base/icons/src/vender/solid/general' import { WorkflowRunningStatus } from '@/app/components/workflow/types' -import NodePanel from '@/app/components/workflow/run/node' import { useStore as useAppStore } from '@/app/components/app/store' type WorkflowProcessProps = { @@ -31,7 +31,6 @@ const WorkflowProcessItem = ({ grayBg, expand = false, hideInfo = false, - hideProcessDetail = false, }: WorkflowProcessProps) => { const { t } = useTranslation() const [collapse, setCollapse] = useState(!expand) @@ -107,16 +106,9 @@ const WorkflowProcessItem = ({ !collapse && (
{ - data.tracing.map(node => ( -
- -
- )) + }
) diff --git a/web/app/components/workflow/run/iteration-result-panel.tsx b/web/app/components/workflow/run/iteration-result-panel.tsx index c833ea0342..7a88d4da0a 100644 --- a/web/app/components/workflow/run/iteration-result-panel.tsx +++ b/web/app/components/workflow/run/iteration-result-panel.tsx @@ -4,7 +4,7 @@ import React, { useCallback } from 'react' import { useTranslation } from 'react-i18next' import { RiCloseLine } from '@remixicon/react' import { ArrowNarrowLeft } from '../../base/icons/src/vender/line/arrows' -import NodePanel from './node' +import TracingPanel from './tracing-panel' import cn from '@/utils/classnames' import type { NodeTracing } from '@/types/workflow' const i18nPrefix = 'workflow.singleRun' @@ -32,10 +32,10 @@ const IterationResultPanel: FC = ({ {t(`${i18nPrefix}.testRunIteration`)}
- +
-
+
{t(`${i18nPrefix}.back`)}
@@ -43,25 +43,10 @@ const IterationResultPanel: FC = ({ {/* List */}
{list.map((iteration, index) => ( -
-
-
{t(`${i18nPrefix}.iteration`)} {index + 1}
-
-
-
- {iteration.map(node => ( - - ))} -
-
+ ))}
diff --git a/web/app/components/workflow/run/tracing-panel.tsx b/web/app/components/workflow/run/tracing-panel.tsx index 1689dd49f9..3cbf63cab3 100644 --- a/web/app/components/workflow/run/tracing-panel.tsx +++ b/web/app/components/workflow/run/tracing-panel.tsx @@ -12,11 +12,14 @@ import { RiMenu4Line, } from '@remixicon/react' import NodePanel from './node' +import { + BlockEnum, +} from '@/app/components/workflow/types' import type { NodeTracing } from '@/types/workflow' type TracingPanelProps = { list: NodeTracing[] - onShowIterationDetail: (detail: NodeTracing[][]) => void + onShowIterationDetail?: (detail: NodeTracing[][]) => void } type TracingNodeProps = { @@ -72,9 +75,14 @@ function buildLogTree(nodes: NodeTracing[]): TracingNodeProps[] { } for (const node of nodes) { - const parallel_id = node.execution_metadata?.parallel_id ?? null + let parallel_id = node.execution_metadata?.parallel_id ?? null const parent_parallel_id = node.execution_metadata?.parent_parallel_id ?? null - const parallel_start_node_id = node.execution_metadata?.parallel_start_node_id ?? null + let parallel_start_node_id = node.execution_metadata?.parallel_start_node_id ?? null + + if (node.node_type === BlockEnum.Iteration) { + parallel_id = node.parallel_id ?? null + parallel_start_node_id = node.parallel_start_node_id ?? null + } if (!parallel_id) { rootNodes.push({ @@ -173,7 +181,10 @@ const TracingPanel: FC = ({ list, onShowIterationDetail }) =>
{node.parallelTitle}
-
+