@@ -52,6 +52,9 @@ import LiveView from '../LiveView/LiveView'
52
52
import SessionData , { createSessionData } from '../../models/session-data'
53
53
54
54
function descendingComparator < T > ( a : T , b : T , orderBy : keyof T ) : number {
55
+ if ( orderBy === 'sessionDurationMillis' ) {
56
+ return Number ( b [ orderBy ] ) - Number ( a [ orderBy ] )
57
+ }
55
58
if ( b [ orderBy ] < a [ orderBy ] ) {
56
59
return - 1
57
60
}
@@ -94,7 +97,7 @@ const headCells: HeadCell[] = [
94
97
{ id : 'id' , numeric : false , label : 'Session' } ,
95
98
{ id : 'capabilities' , numeric : false , label : 'Capabilities' } ,
96
99
{ id : 'startTime' , numeric : false , label : 'Start time' } ,
97
- { id : 'sessionDurationMillis' , numeric : false , label : 'Duration' } ,
100
+ { id : 'sessionDurationMillis' , numeric : true , label : 'Duration' } ,
98
101
{ id : 'nodeUri' , numeric : false , label : 'Node URI' }
99
102
]
100
103
@@ -170,7 +173,7 @@ function RunningSessions (props) {
170
173
const [ rowOpen , setRowOpen ] = useState ( '' )
171
174
const [ rowLiveViewOpen , setRowLiveViewOpen ] = useState ( '' )
172
175
const [ order , setOrder ] = useState < Order > ( 'asc' )
173
- const [ orderBy , setOrderBy ] = useState < keyof SessionData > ( 'startTime ' )
176
+ const [ orderBy , setOrderBy ] = useState < keyof SessionData > ( 'sessionDurationMillis ' )
174
177
const [ selected , setSelected ] = useState < string [ ] > ( [ ] )
175
178
const [ page , setPage ] = useState ( 0 )
176
179
const [ dense , setDense ] = useState ( false )
0 commit comments