diff --git a/javascript/grid-ui/src/components/RunningSessions/RunningSessions.tsx b/javascript/grid-ui/src/components/RunningSessions/RunningSessions.tsx index fcc666f3457c4..dd819be55f905 100644 --- a/javascript/grid-ui/src/components/RunningSessions/RunningSessions.tsx +++ b/javascript/grid-ui/src/components/RunningSessions/RunningSessions.tsx @@ -52,6 +52,9 @@ import LiveView from '../LiveView/LiveView' import SessionData, { createSessionData } from '../../models/session-data' function descendingComparator (a: T, b: T, orderBy: keyof T): number { + if (orderBy === 'sessionDurationMillis') { + return Number(b[orderBy]) - Number(a[orderBy]) + } if (b[orderBy] < a[orderBy]) { return -1 } @@ -94,7 +97,7 @@ const headCells: HeadCell[] = [ { id: 'id', numeric: false, label: 'Session' }, { id: 'capabilities', numeric: false, label: 'Capabilities' }, { id: 'startTime', numeric: false, label: 'Start time' }, - { id: 'sessionDurationMillis', numeric: false, label: 'Duration' }, + { id: 'sessionDurationMillis', numeric: true, label: 'Duration' }, { id: 'nodeUri', numeric: false, label: 'Node URI' } ] @@ -170,7 +173,7 @@ function RunningSessions (props) { const [rowOpen, setRowOpen] = useState('') const [rowLiveViewOpen, setRowLiveViewOpen] = useState('') const [order, setOrder] = useState('asc') - const [orderBy, setOrderBy] = useState('startTime') + const [orderBy, setOrderBy] = useState('sessionDurationMillis') const [selected, setSelected] = useState([]) const [page, setPage] = useState(0) const [dense, setDense] = useState(false)