|
|
@ -1,4 +1,6 @@ |
|
|
|
import { Grid, Switch } from '@material-ui/core'; |
|
|
|
import { Box } from '@material-ui/core'; |
|
|
|
|
|
|
|
import { makeStyles } from '@material-ui/core/styles'; |
|
|
|
|
|
|
|
|
|
|
|
import * as prettyBytes from 'pretty-bytes'; |
|
|
|
import * as prettyBytes from 'pretty-bytes'; |
|
|
|
|
|
|
|
|
|
|
|
import InnerPanel from './InnerPanel'; |
|
|
|
import InnerPanel from './InnerPanel'; |
|
|
@ -6,51 +8,64 @@ import { AllocationBar } from './Bars'; |
|
|
|
import { BodyText } from './Text'; |
|
|
|
import { BodyText } from './Text'; |
|
|
|
import PanelHeader from './PanelHeader'; |
|
|
|
import PanelHeader from './PanelHeader'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const useStyles = makeStyles(() => ({ |
|
|
|
|
|
|
|
fs: { |
|
|
|
|
|
|
|
paddingLeft: '10px', |
|
|
|
|
|
|
|
paddingRight: '10px', |
|
|
|
|
|
|
|
paddingTop: '20px', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
bar: { |
|
|
|
|
|
|
|
paddingLeft: '10px', |
|
|
|
|
|
|
|
paddingRight: '10px', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
})); |
|
|
|
|
|
|
|
|
|
|
|
const SharedStorageNode = ({ |
|
|
|
const SharedStorageNode = ({ |
|
|
|
node, |
|
|
|
node, |
|
|
|
}: { |
|
|
|
}: { |
|
|
|
node: AnvilSharedStorageNode; |
|
|
|
node: AnvilSharedStorageNode; |
|
|
|
}): JSX.Element => { |
|
|
|
}): JSX.Element => { |
|
|
|
|
|
|
|
const classes = useStyles(); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<InnerPanel> |
|
|
|
<InnerPanel> |
|
|
|
<PanelHeader> |
|
|
|
<PanelHeader> |
|
|
|
<Grid container alignItems="center" justify="space-around"> |
|
|
|
<Box display="flex" width="100%"> |
|
|
|
<Grid item xs={6}> |
|
|
|
<Box> |
|
|
|
<BodyText text={`Node: ${node.nodeInfo?.node_name}`} /> |
|
|
|
<BodyText text={node.nodeInfo?.node_name} /> |
|
|
|
</Grid> |
|
|
|
</Box> |
|
|
|
<Grid item xs={3}> |
|
|
|
</Box> |
|
|
|
<Switch checked={node.is_mounted} /> |
|
|
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
</PanelHeader> |
|
|
|
</PanelHeader> |
|
|
|
<Grid container alignItems="center" justify="space-around"> |
|
|
|
<Box display="flex" width="100%" className={classes.fs}> |
|
|
|
<Grid item xs={4}> |
|
|
|
<Box flexGrow={1}> |
|
|
|
<BodyText |
|
|
|
<BodyText |
|
|
|
text={`Used: ${prettyBytes.default(node.total - node.free, { |
|
|
|
text={`Used: ${prettyBytes.default(node.total - node.free, { |
|
|
|
binary: true, |
|
|
|
binary: true, |
|
|
|
})}`}
|
|
|
|
})}`}
|
|
|
|
/> |
|
|
|
/> |
|
|
|
</Grid> |
|
|
|
</Box> |
|
|
|
<Grid item xs={4}> |
|
|
|
<Box> |
|
|
|
<BodyText |
|
|
|
<BodyText |
|
|
|
text={`Free: ${prettyBytes.default(node.free, { |
|
|
|
text={`Free: ${prettyBytes.default(node.free, { |
|
|
|
binary: true, |
|
|
|
binary: true, |
|
|
|
})}`}
|
|
|
|
})}`}
|
|
|
|
/> |
|
|
|
/> |
|
|
|
</Grid> |
|
|
|
</Box> |
|
|
|
<Grid item xs={10}> |
|
|
|
</Box> |
|
|
|
|
|
|
|
<Box display="flex" width="100%" className={classes.bar}> |
|
|
|
|
|
|
|
<Box flexGrow={1}> |
|
|
|
<AllocationBar |
|
|
|
<AllocationBar |
|
|
|
allocated={((node.total - node.free) / node.total) * 100} |
|
|
|
allocated={((node.total - node.free) / node.total) * 100} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</Grid> |
|
|
|
</Box> |
|
|
|
<Grid item xs={6}> |
|
|
|
</Box> |
|
|
|
|
|
|
|
<Box display="flex" justifyContent="center" width="100%"> |
|
|
|
<BodyText |
|
|
|
<BodyText |
|
|
|
text={`Total Storage: ${prettyBytes.default(node.total, { |
|
|
|
text={`Total Storage: ${prettyBytes.default(node.total, { |
|
|
|
binary: true, |
|
|
|
binary: true, |
|
|
|
})}`}
|
|
|
|
})}`}
|
|
|
|
/> |
|
|
|
/> |
|
|
|
</Grid> |
|
|
|
</Box> |
|
|
|
</Grid> |
|
|
|
|
|
|
|
</InnerPanel> |
|
|
|
</InnerPanel> |
|
|
|
); |
|
|
|
); |
|
|
|
}; |
|
|
|
}; |
|
|
|