fix: use prop names from the specs

main
Josue 4 years ago committed by Tsu-ba-me
parent c3f0a948a6
commit 0e09683d61
  1. 20
      striker-ui/components/Memory.tsx
  2. 2
      striker-ui/types/AnvilMemory.d.ts

@ -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,
{
text={`Allocated: ${prettyBytes.default(memoryData.allocated, {
binary: true,
},
)}`}
})}`}
/>
</Box>
<Box>
<BodyText
text={`Free: ${prettyBytes.default(memoryData.free, {
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>

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

Loading…
Cancel
Save