|
|
|
@ -13,7 +13,7 @@ const Memory = (): JSX.Element => { |
|
|
|
|
`${process.env.NEXT_PUBLIC_API_URL}/get_memory?anvil_uuid=${uuid}`, |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
const memoryData = isLoading || !data ? { total: 0, free: 0 } : data; |
|
|
|
|
const memoryData = isLoading || !data ? { total: 0, allocated: 0 } : data; |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<Panel> |
|
|
|
@ -21,28 +21,26 @@ const Memory = (): JSX.Element => { |
|
|
|
|
<Box display="flex" width="100%"> |
|
|
|
|
<Box flexGrow={1}> |
|
|
|
|
<BodyText |
|
|
|
|
text={`Allocated: ${prettyBytes.default( |
|
|
|
|
memoryData.total - memoryData.free, |
|
|
|
|
{ |
|
|
|
|
binary: true, |
|
|
|
|
}, |
|
|
|
|
)}`}
|
|
|
|
|
text={`Allocated: ${prettyBytes.default(memoryData.allocated, { |
|
|
|
|
binary: true, |
|
|
|
|
})}`}
|
|
|
|
|
/> |
|
|
|
|
</Box> |
|
|
|
|
<Box> |
|
|
|
|
<BodyText |
|
|
|
|
text={`Free: ${prettyBytes.default(memoryData.free, { |
|
|
|
|
binary: true, |
|
|
|
|
})}`}
|
|
|
|
|
text={`Free: ${prettyBytes.default( |
|
|
|
|
memoryData.total - memoryData.allocated, |
|
|
|
|
{ |
|
|
|
|
binary: true, |
|
|
|
|
}, |
|
|
|
|
)}`}
|
|
|
|
|
/> |
|
|
|
|
</Box> |
|
|
|
|
</Box> |
|
|
|
|
<Box display="flex" width="100%"> |
|
|
|
|
<Box flexGrow={1}> |
|
|
|
|
<AllocationBar |
|
|
|
|
allocated={ |
|
|
|
|
((memoryData.total - memoryData.free) / memoryData.total) * 100 |
|
|
|
|
} |
|
|
|
|
allocated={(memoryData.allocated / memoryData.total) * 100} |
|
|
|
|
/> |
|
|
|
|
</Box> |
|
|
|
|
</Box> |
|
|
|
|