|
|
@ -1,4 +1,4 @@ |
|
|
|
import { Grid } from '@material-ui/core'; |
|
|
|
import { Box } from '@material-ui/core'; |
|
|
|
import * as prettyBytes from 'pretty-bytes'; |
|
|
|
import * as prettyBytes from 'pretty-bytes'; |
|
|
|
import Panel from './Panel'; |
|
|
|
import Panel from './Panel'; |
|
|
|
import { AllocationBar } from './Bars'; |
|
|
|
import { AllocationBar } from './Bars'; |
|
|
@ -15,11 +15,9 @@ const Memory = ({ uuid }: { uuid: string }): JSX.Element => { |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<Panel> |
|
|
|
<Panel> |
|
|
|
<Grid container alignItems="center" justify="space-around"> |
|
|
|
<HeaderText text="Memory" /> |
|
|
|
<Grid item xs={12}> |
|
|
|
<Box display="flex" width="100%"> |
|
|
|
<HeaderText text="Memory" /> |
|
|
|
<Box flexGrow={1}> |
|
|
|
</Grid> |
|
|
|
|
|
|
|
<Grid item xs={5}> |
|
|
|
|
|
|
|
<BodyText |
|
|
|
<BodyText |
|
|
|
text={`Allocated: ${prettyBytes.default( |
|
|
|
text={`Allocated: ${prettyBytes.default( |
|
|
|
memoryData.total - memoryData.free, |
|
|
|
memoryData.total - memoryData.free, |
|
|
@ -28,29 +26,31 @@ const Memory = ({ uuid }: { uuid: string }): JSX.Element => { |
|
|
|
}, |
|
|
|
}, |
|
|
|
)}`}
|
|
|
|
)}`}
|
|
|
|
/> |
|
|
|
/> |
|
|
|
</Grid> |
|
|
|
</Box> |
|
|
|
<Grid item xs={4}> |
|
|
|
<Box> |
|
|
|
<BodyText |
|
|
|
<BodyText |
|
|
|
text={`Free: ${prettyBytes.default(memoryData.free, { |
|
|
|
text={`Free: ${prettyBytes.default(memoryData.free, { |
|
|
|
binary: true, |
|
|
|
binary: true, |
|
|
|
})}`}
|
|
|
|
})}`}
|
|
|
|
/> |
|
|
|
/> |
|
|
|
</Grid> |
|
|
|
</Box> |
|
|
|
<Grid item xs={10}> |
|
|
|
</Box> |
|
|
|
|
|
|
|
<Box display="flex" width="100%"> |
|
|
|
|
|
|
|
<Box flexGrow={1}> |
|
|
|
<AllocationBar |
|
|
|
<AllocationBar |
|
|
|
allocated={ |
|
|
|
allocated={ |
|
|
|
((memoryData.total - memoryData.free) / memoryData.total) * 100 |
|
|
|
((memoryData.total - memoryData.free) / memoryData.total) * 100 |
|
|
|
} |
|
|
|
} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</Grid> |
|
|
|
</Box> |
|
|
|
<Grid item xs={5}> |
|
|
|
</Box> |
|
|
|
<BodyText |
|
|
|
<Box display="flex" justifyContent="center" width="100%"> |
|
|
|
text={`Total Memory: ${prettyBytes.default(memoryData.total, { |
|
|
|
<BodyText |
|
|
|
binary: true, |
|
|
|
text={`Total Memory: ${prettyBytes.default(memoryData.total, { |
|
|
|
})}`}
|
|
|
|
binary: true, |
|
|
|
/> |
|
|
|
})}`}
|
|
|
|
</Grid> |
|
|
|
/> |
|
|
|
</Grid> |
|
|
|
</Box> |
|
|
|
</Panel> |
|
|
|
</Panel> |
|
|
|
); |
|
|
|
); |
|
|
|
}; |
|
|
|
}; |
|
|
|