File tree Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change 88 Tooltip ,
99} from "@mui/material" ;
1010
11+ export function RunPlanButton ( ) { }
12+
1113export function AbortButton ( ) {
1214 const [ openMsg , setOpenMsg ] = React . useState < boolean > ( false ) ;
1315
Original file line number Diff line number Diff line change 1- import { Box , Grid2 , Stack } from "@mui/material" ;
1+ import { Grid2 , Stack , Typography } from "@mui/material" ;
22
33import { processUseBlueApiCall , useBlueApiCall } from "../blueapi/blueapi" ;
44import { useState } from "react" ;
55
66export function WorkerStatus ( ) {
77 const [ currentState , setCurrentState ] = useState < string > ( "UNKNOWN" ) ;
88 const workerStateInfo = useBlueApiCall ( "/worker/state" ) ;
9+
10+ const readCurrentState = ( ) => {
11+ return processUseBlueApiCall ( workerStateInfo , ( res ) => {
12+ if ( ! res . bodyUsed ) {
13+ res . json ( ) . then ( ( text ) => setCurrentState ( text ) ) ;
14+ }
15+ return currentState ;
16+ } ) ;
17+ } ;
18+
919 return (
1020 < Grid2 size = { 12 } >
1121 < Stack direction = { "row" } spacing = { 1 } justifyContent = { "center" } >
12- < b > BlueAPI worker status: </ b >
13- < Box >
14- { processUseBlueApiCall ( workerStateInfo , ( res ) => {
15- if ( ! res . bodyUsed ) {
16- res . json ( ) . then ( ( text ) => setCurrentState ( text ) ) ;
17- }
18- return currentState ;
19- } ) }
20- </ Box >
22+ < Typography variant = "body1" fontWeight = { "bold" } >
23+ BlueAPI worker status:
24+ </ Typography >
25+ < Typography variant = "body1" > { readCurrentState ( ) } </ Typography >
2126 </ Stack >
2227 </ Grid2 >
2328 ) ;
You can’t perform that action at this time.
0 commit comments