fix sequence number and tokens in result panel

This commit is contained in:
JzoNg 2024-03-13 18:13:16 +08:00
parent 68fa81ec82
commit 1728513634
4 changed files with 5 additions and 5 deletions

View File

@ -116,10 +116,10 @@ export const useWorkflowRun = () => {
body: params,
},
{
onWorkflowStarted: ({ task_id, workflow_run_id, sequence_number }) => {
onWorkflowStarted: ({ task_id, workflow_run_id, data }) => {
useStore.setState({ runningStatus: WorkflowRunningStatus.Running })
useStore.setState({ taskId: task_id })
useStore.setState({ currentSequenceNumber: sequence_number })
useStore.setState({ currentSequenceNumber: data.sequence_number })
useStore.setState({ workflowRunId: workflow_run_id })
const newNodes = produce(getNodes(), (draft) => {
draft.forEach((node) => {

View File

@ -86,7 +86,7 @@ const MetaData: FC<Props> = ({
<div className='my-[5px] w-[48px] h-2 rounded-sm bg-[rgba(0,0,0,0.05)]'/>
)}
{status !== 'running' && (
<span>{`${tokens} Tokens`}</span>
<span>{`${tokens || 0} Tokens`}</span>
)}
</div>
</div>

View File

@ -82,7 +82,7 @@ const StatusPanel: FC<ResultProps> = ({
<div className='w-20 h-2 rounded-sm bg-[rgba(0,0,0,0.05)]'/>
)}
{status !== 'running' && (
<span>{`${tokens} Tokens`}</span>
<span>{`${tokens || 0} Tokens`}</span>
)}
</div>
</div>

View File

@ -50,11 +50,11 @@ export type NodeTracingListResponse = {
export type WorkflowStartedResponse = {
task_id: string
workflow_run_id: string
sequence_number: number
event: string
data: {
id: string
workflow_id: string
sequence_number: number
created_at: number
}
}