@@ -17,7 +17,7 @@ const SessionSlotCell: React.FC<OccupiedSlotViewProps> = ({
1717 sessionFrgmt,
1818 mode = 'requested' ,
1919} ) => {
20- const { deviceMetadata } = useResourceSlotsDetails ( ) ;
20+ const { mergedResourceSlots } = useResourceSlotsDetails ( '' ) ;
2121 const session = useFragment (
2222 graphql `
2323 fragment SessionSlotCellFragment on ComputeSessionNode {
@@ -38,18 +38,25 @@ const SessionSlotCell: React.FC<OccupiedSlotViewProps> = ({
3838 return slots . cpu ?? '-' ;
3939 } else if ( type === 'mem' ) {
4040 const mem = slots . mem ?? '-' ;
41- return mem === '-' ? mem : convertBinarySizeUnit ( mem , 'G' ) ?. number + ' GiB' ;
41+ return mem === '-'
42+ ? mem
43+ : convertBinarySizeUnit ( mem , 'G' , 3 ) ?. numberFixed + ' GiB' ;
4244 } else if ( type === 'accelerator' ) {
4345 const occupiedAccelerators = _ . omit ( slots , [ 'cpu' , 'mem' ] ) ;
44- return _ . isEmpty ( occupiedAccelerators )
46+
47+ const filteredAccelerators = _ . omitBy (
48+ occupiedAccelerators ,
49+ ( value ) => _ . toNumber ( value ) <= 0 || _ . isNaN ( _ . toNumber ( value ) ) ,
50+ ) ;
51+ return _ . every ( filteredAccelerators , ( value ) => value === 0 )
4552 ? '-'
46- : _ . map ( occupiedAccelerators , ( value , key ) => {
53+ : _ . map ( filteredAccelerators , ( value , key ) => {
4754 return (
4855 < Fragment key = { key } >
4956 < Typography . Text > { value } </ Typography . Text >
5057 < Divider type = "vertical" />
5158 < Typography . Text >
52- { deviceMetadata ?. [ key ] ?. human_readable_name }
59+ { mergedResourceSlots ?. [ key ] ?. display_unit }
5360 </ Typography . Text >
5461 </ Fragment >
5562 ) ;
0 commit comments