Skip to content

Commit 927fe1b

Browse files
yomybabyLablup Agent
andauthored
fix(FR-2412): display resource amounts for terminated sessions in session list table (#6272)
Co-authored-by: Lablup Agent <agent@lablup.com>
1 parent 4b1f34f commit 927fe1b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

react/src/components/ComputeSessionNodeItems/SessionSlotCell.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,13 @@ const SessionSlotCell: React.FC<OccupiedSlotViewProps> = ({
4545

4646
const { liveStat } = useSessionLiveStat(session);
4747

48+
const parsedOccupiedSlots = JSON.parse(session.occupied_slots || '{}');
4849
const occupiedSlots: {
4950
[key in ResourceSlotName]?: string;
50-
} = JSON.parse(session.occupied_slots || '{}');
51+
} =
52+
Object.keys(parsedOccupiedSlots).length > 0
53+
? parsedOccupiedSlots
54+
: JSON.parse(session.requested_slots || '{}');
5155

5256
if (type === 'cpu') {
5357
const CPUOccupiedSlot = parseFloat(occupiedSlots.cpu ?? '1');

0 commit comments

Comments
 (0)