Commit 17285136 authored by JzoNg's avatar JzoNg

fix sequence number and tokens in result panel

parent 68fa81ec
...@@ -116,10 +116,10 @@ export const useWorkflowRun = () => { ...@@ -116,10 +116,10 @@ export const useWorkflowRun = () => {
body: params, body: params,
}, },
{ {
onWorkflowStarted: ({ task_id, workflow_run_id, sequence_number }) => { onWorkflowStarted: ({ task_id, workflow_run_id, data }) => {
useStore.setState({ runningStatus: WorkflowRunningStatus.Running }) useStore.setState({ runningStatus: WorkflowRunningStatus.Running })
useStore.setState({ taskId: task_id }) useStore.setState({ taskId: task_id })
useStore.setState({ currentSequenceNumber: sequence_number }) useStore.setState({ currentSequenceNumber: data.sequence_number })
useStore.setState({ workflowRunId: workflow_run_id }) useStore.setState({ workflowRunId: workflow_run_id })
const newNodes = produce(getNodes(), (draft) => { const newNodes = produce(getNodes(), (draft) => {
draft.forEach((node) => { draft.forEach((node) => {
......
...@@ -86,7 +86,7 @@ const MetaData: FC<Props> = ({ ...@@ -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)]'/> <div className='my-[5px] w-[48px] h-2 rounded-sm bg-[rgba(0,0,0,0.05)]'/>
)} )}
{status !== 'running' && ( {status !== 'running' && (
<span>{`${tokens} Tokens`}</span> <span>{`${tokens || 0} Tokens`}</span>
)} )}
</div> </div>
</div> </div>
......
...@@ -82,7 +82,7 @@ const StatusPanel: FC<ResultProps> = ({ ...@@ -82,7 +82,7 @@ const StatusPanel: FC<ResultProps> = ({
<div className='w-20 h-2 rounded-sm bg-[rgba(0,0,0,0.05)]'/> <div className='w-20 h-2 rounded-sm bg-[rgba(0,0,0,0.05)]'/>
)} )}
{status !== 'running' && ( {status !== 'running' && (
<span>{`${tokens} Tokens`}</span> <span>{`${tokens || 0} Tokens`}</span>
)} )}
</div> </div>
</div> </div>
......
...@@ -50,11 +50,11 @@ export type NodeTracingListResponse = { ...@@ -50,11 +50,11 @@ export type NodeTracingListResponse = {
export type WorkflowStartedResponse = { export type WorkflowStartedResponse = {
task_id: string task_id: string
workflow_run_id: string workflow_run_id: string
sequence_number: number
event: string event: string
data: { data: {
id: string id: string
workflow_id: string workflow_id: string
sequence_number: number
created_at: number created_at: number
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment