style: change CPU component to match latest changes in the design

main
Josue 4 years ago committed by Tsu-ba-me
parent 1852c68454
commit 117fd8a78d
  1. 23
      striker-ui/components/CPU.tsx

@ -1,7 +1,6 @@
import { useContext } from 'react'; import { useContext } from 'react';
import { Box } from '@material-ui/core'; import { Box } from '@material-ui/core';
import { Panel } from './Panels'; import { Panel } from './Panels';
import { AllocationBar } from './Bars';
import { HeaderText, BodyText } from './Text'; import { HeaderText, BodyText } from './Text';
import PeriodicFetch from '../lib/fetchers/periodicFetch'; import PeriodicFetch from '../lib/fetchers/periodicFetch';
import { AnvilContext } from './AnvilContext'; import { AnvilContext } from './AnvilContext';
@ -22,26 +21,12 @@ const CPU = (): JSX.Element => {
<HeaderText text="CPU" /> <HeaderText text="CPU" />
{!isLoading ? ( {!isLoading ? (
<> <>
{' '}
<Box display="flex" width="100%"> <Box display="flex" width="100%">
<Box flexGrow={1}> <Box flexGrow={1} style={{ marginLeft: '1em', marginTop: '1em' }}>
<BodyText text={`Allocated: ${cpuData.allocated}`} /> <BodyText text={`Total Cores: ${cpuData.cores}`} />
<BodyText text={`Total Threads: ${cpuData.threads}`} />
<BodyText text={`Allocated Cores: ${cpuData.allocated}`} />
</Box> </Box>
<Box>
<BodyText text={`Free: ${cpuData.cores - cpuData.allocated}`} />
</Box>
</Box>
<Box display="flex" width="100%">
<Box flexGrow={1}>
<AllocationBar
allocated={(cpuData.allocated / cpuData.cores) * 100}
/>
</Box>
</Box>
<Box display="flex" justifyContent="center" width="100%">
<BodyText
text={`Total Cores: ${cpuData.cores}c | ${cpuData.threads}t`}
/>
</Box> </Box>
</> </>
) : ( ) : (

Loading…
Cancel
Save