From 096cc74373a4851000412df525448a259916c0e7 Mon Sep 17 00:00:00 2001 From: JzoNg Date: Thu, 21 Mar 2024 19:56:43 +0800 Subject: [PATCH] hide node info in chat --- web/app/components/base/chat/chat/answer/index.tsx | 2 +- .../components/base/chat/chat/answer/workflow-process.tsx | 3 +++ web/app/components/workflow/run/node.tsx | 5 +++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/web/app/components/base/chat/chat/answer/index.tsx b/web/app/components/base/chat/chat/answer/index.tsx index 8c75a1bde6466b..4b1d757a0ee1f8 100644 --- a/web/app/components/base/chat/chat/answer/index.tsx +++ b/web/app/components/base/chat/chat/answer/index.tsx @@ -90,7 +90,7 @@ const Answer: FC = ({ } { workflowProcess && ( - + ) } { 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 d83009cea5e38d..bd90890958239b 100644 --- a/web/app/components/base/chat/chat/answer/workflow-process.tsx +++ b/web/app/components/base/chat/chat/answer/workflow-process.tsx @@ -16,11 +16,13 @@ type WorkflowProcessProps = { data: WorkflowProcess grayBg?: boolean expand?: boolean + hideInfo?: boolean } const WorkflowProcessItem = ({ data, grayBg, expand = false, + hideInfo = false, }: WorkflowProcessProps) => { const { t } = useTranslation() const [collapse, setCollapse] = useState(!expand) @@ -87,6 +89,7 @@ const WorkflowProcessItem = ({ )) diff --git a/web/app/components/workflow/run/node.tsx b/web/app/components/workflow/run/node.tsx index 61d15a159c4982..3f7a7577e36846 100644 --- a/web/app/components/workflow/run/node.tsx +++ b/web/app/components/workflow/run/node.tsx @@ -14,9 +14,10 @@ import type { NodeTracing } from '@/types/workflow' type Props = { nodeInfo: NodeTracing className?: string + hideInfo?: boolean } -const NodePanel: FC = ({ nodeInfo, className }) => { +const NodePanel: FC = ({ nodeInfo, className, hideInfo = false }) => { const [collapseState, setCollapseState] = useState(true) const { t } = useTranslation() @@ -59,7 +60,7 @@ const NodePanel: FC = ({ nodeInfo, className }) => { />
{nodeInfo.title}
- {nodeInfo.status !== 'running' && ( + {nodeInfo.status !== 'running' && !hideInfo && (
{`${getTime(nodeInfo.elapsed_time || 0)} ยท ${getTokenCount(nodeInfo.execution_metadata?.total_tokens || 0)} tokens`}
)} {nodeInfo.status === 'succeeded' && (