refactor: add reserved prop to Memory component

main
Josue 4 years ago committed by Tsu-ba-me
parent a3a4e4c72d
commit 24e4509c8d
  1. 7
      striker-ui/components/Memory.tsx
  2. 1
      striker-ui/types/AnvilMemory.d.ts

@ -13,7 +13,8 @@ const Memory = (): JSX.Element => {
`${process.env.NEXT_PUBLIC_API_URL}/get_memory?anvil_uuid=${uuid}`, `${process.env.NEXT_PUBLIC_API_URL}/get_memory?anvil_uuid=${uuid}`,
); );
const memoryData = isLoading || !data ? { total: 0, allocated: 0 } : data; const memoryData =
isLoading || !data ? { total: 0, allocated: 0, reserved: 0 } : data;
return ( return (
<Panel> <Panel>
@ -46,7 +47,9 @@ const Memory = (): JSX.Element => {
</Box> </Box>
<Box display="flex" justifyContent="center" width="100%"> <Box display="flex" justifyContent="center" width="100%">
<BodyText <BodyText
text={`Total Memory: ${prettyBytes.default(memoryData.total, { text={`Total: ${prettyBytes.default(memoryData.total, {
binary: true,
})} | Reserved: ${prettyBytes.default(memoryData.reserved, {
binary: true, binary: true,
})}`} })}`}
/> />

@ -1,4 +1,5 @@
declare type AnvilMemory = { declare type AnvilMemory = {
total: number; total: number;
allocated: number; allocated: number;
reserved: number;
}; };

Loading…
Cancel
Save