@@ -52,6 +52,9 @@ import LiveView from '../LiveView/LiveView'
5252import SessionData , { createSessionData } from '../../models/session-data'
5353
5454function descendingComparator < T > ( a : T , b : T , orderBy : keyof T ) : number {
55+ if ( orderBy === 'sessionDurationMillis' ) {
56+ return Number ( b [ orderBy ] ) - Number ( a [ orderBy ] )
57+ }
5558 if ( b [ orderBy ] < a [ orderBy ] ) {
5659 return - 1
5760 }
@@ -94,7 +97,7 @@ const headCells: HeadCell[] = [
9497 { id : 'id' , numeric : false , label : 'Session' } ,
9598 { id : 'capabilities' , numeric : false , label : 'Capabilities' } ,
9699 { id : 'startTime' , numeric : false , label : 'Start time' } ,
97- { id : 'sessionDurationMillis' , numeric : false , label : 'Duration' } ,
100+ { id : 'sessionDurationMillis' , numeric : true , label : 'Duration' } ,
98101 { id : 'nodeUri' , numeric : false , label : 'Node URI' }
99102]
100103
@@ -170,7 +173,7 @@ function RunningSessions (props) {
170173 const [ rowOpen , setRowOpen ] = useState ( '' )
171174 const [ rowLiveViewOpen , setRowLiveViewOpen ] = useState ( '' )
172175 const [ order , setOrder ] = useState < Order > ( 'asc' )
173- const [ orderBy , setOrderBy ] = useState < keyof SessionData > ( 'startTime ' )
176+ const [ orderBy , setOrderBy ] = useState < keyof SessionData > ( 'sessionDurationMillis ' )
174177 const [ selected , setSelected ] = useState < string [ ] > ( [ ] )
175178 const [ page , setPage ] = useState ( 0 )
176179 const [ dense , setDense ] = useState ( false )
0 commit comments