Skip to content

Commit

Permalink
Merge branch 'feat/workflow' into deploy/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
JzoNgKVO committed Mar 21, 2024
2 parents 7a1bd83 + 096cc74 commit 0a6bbe8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion web/app/components/base/chat/chat/answer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const Answer: FC<AnswerProps> = ({
}
{
workflowProcess && (
<WorkflowProcess data={workflowProcess} />
<WorkflowProcess data={workflowProcess} hideInfo />
)
}
{
Expand Down
3 changes: 3 additions & 0 deletions web/app/components/base/chat/chat/answer/workflow-process.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -87,6 +89,7 @@ const WorkflowProcessItem = ({
<NodePanel
className='!p-0'
nodeInfo={node}
hideInfo={hideInfo}
/>
</div>
))
Expand Down
5 changes: 3 additions & 2 deletions web/app/components/workflow/run/node.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ import type { NodeTracing } from '@/types/workflow'
type Props = {
nodeInfo: NodeTracing
className?: string
hideInfo?: boolean
}

const NodePanel: FC<Props> = ({ nodeInfo, className }) => {
const NodePanel: FC<Props> = ({ nodeInfo, className, hideInfo = false }) => {
const [collapseState, setCollapseState] = useState<boolean>(true)
const { t } = useTranslation()

Expand Down Expand Up @@ -59,7 +60,7 @@ const NodePanel: FC<Props> = ({ nodeInfo, className }) => {
/>
<BlockIcon className='shrink-0 mr-2' type={nodeInfo.node_type} />
<div className='grow text-gray-700 text-[13px] leading-[16px] font-semibold truncate' title={nodeInfo.title}>{nodeInfo.title}</div>
{nodeInfo.status !== 'running' && (
{nodeInfo.status !== 'running' && !hideInfo && (
<div className='shrink-0 text-gray-500 text-xs leading-[18px]'>{`${getTime(nodeInfo.elapsed_time || 0)} · ${getTokenCount(nodeInfo.execution_metadata?.total_tokens || 0)} tokens`}</div>
)}
{nodeInfo.status === 'succeeded' && (
Expand Down

0 comments on commit 0a6bbe8

Please sign in to comment.