You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.4 KiB
50 lines
1.4 KiB
4 years ago
|
import { Grid, Switch } from '@material-ui/core';
|
||
|
|
||
4 years ago
|
import InnerPanel from '../InnerPanel';
|
||
|
import { ProgressBar } from '../Bars';
|
||
|
import { BodyText } from '../Text';
|
||
|
import PanelHeader from '../PanelHeader';
|
||
4 years ago
|
|
||
4 years ago
|
const AnvilNode = ({
|
||
|
node,
|
||
|
}: {
|
||
|
node: Array<AnvilStatusNode & AnvilListItemNode>;
|
||
|
}): JSX.Element => {
|
||
4 years ago
|
return (
|
||
|
<>
|
||
|
{node &&
|
||
4 years ago
|
node.map(
|
||
4 years ago
|
(n): JSX.Element => {
|
||
|
return (
|
||
4 years ago
|
<InnerPanel key={n.node_uuid}>
|
||
4 years ago
|
<PanelHeader>
|
||
|
<Grid container alignItems="center" justify="space-around">
|
||
|
<Grid item xs={7}>
|
||
|
<BodyText text={`Node: ${n.node_name}`} />
|
||
|
</Grid>
|
||
|
<Grid item xs={3}>
|
||
|
<Switch checked />
|
||
|
</Grid>
|
||
4 years ago
|
</Grid>
|
||
4 years ago
|
</PanelHeader>
|
||
|
<Grid container alignItems="center" justify="space-around">
|
||
|
<Grid item xs={5}>
|
||
4 years ago
|
<BodyText text={`State: ${n.state}`} />
|
||
|
</Grid>
|
||
|
<Grid item xs={4}>
|
||
|
<BodyText text={n.state_message} />
|
||
|
</Grid>
|
||
|
<Grid item xs={10}>
|
||
4 years ago
|
<ProgressBar progressPercentage={n.state_percent} />
|
||
4 years ago
|
</Grid>
|
||
|
</Grid>
|
||
4 years ago
|
</InnerPanel>
|
||
4 years ago
|
);
|
||
|
},
|
||
|
)}
|
||
|
</>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default AnvilNode;
|