File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -813,10 +813,33 @@ export default function Page() {
813
813
headerName : "Queue time" ,
814
814
flex : 1 ,
815
815
valueFormatter : ( params : number ) => durationDisplay ( params ) ,
816
+ cellClassName : ( params ) => {
817
+ const queueTimeHours = params . value / 3600 ;
818
+ if ( queueTimeHours >= 4 ) return "queue-time-red" ;
819
+ if ( queueTimeHours >= 1 ) return "queue-time-yellow" ;
820
+ return "" ;
821
+ } ,
816
822
} ,
817
823
{ field : "machine_type" , headerName : "Machine Type" , flex : 4 } ,
818
824
] }
819
- dataGridProps = { { getRowId : ( el : any ) => el . machine_type } }
825
+ dataGridProps = { {
826
+ getRowId : ( el : any ) => el . machine_type ,
827
+ initialState : {
828
+ sorting : {
829
+ sortModel : [ { field : "avg_queue_s" , sort : "desc" } ] ,
830
+ } ,
831
+ } ,
832
+ sx : {
833
+ "& .queue-time-yellow" : {
834
+ backgroundColor : "#B8860B" , // Dark goldenrod
835
+ color : "white" ,
836
+ } ,
837
+ "& .queue-time-red" : {
838
+ backgroundColor : "#B22222" , // Fire brick red
839
+ color : "white" ,
840
+ } ,
841
+ } ,
842
+ } }
820
843
/>
821
844
</ Grid2 >
822
845
You can’t perform that action at this time.
0 commit comments