remove button and loading circle close #65 #67
@@ -64,7 +64,7 @@ export default function Chart(props) {
|
|||||||
const { q0, q1, q2, q3, q4, q5, q6, q7 } = state;
|
const { q0, q1, q2, q3, q4, q5, q6, q7 } = state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Grid container spacing={2} className={classes.root}>
|
<React.Fragment>
|
||||||
<Grid item xs={12} className={classes.chart}>
|
<Grid item xs={12} className={classes.chart}>
|
||||||
<ResponsiveContainer width="99%" height={300}>
|
<ResponsiveContainer width="99%" height={300}>
|
||||||
<LineChart
|
<LineChart
|
||||||
@@ -81,11 +81,8 @@ export default function Chart(props) {
|
|||||||
{lines}
|
{lines}
|
||||||
</LineChart>
|
</LineChart>
|
||||||
</ResponsiveContainer>
|
</ResponsiveContainer>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12}>
|
<Grid item>
|
||||||
<FormControl component="fieldset" className={classes.formControl}>
|
<FormControl component="fieldset" className={classes.formControl}>
|
||||||
<FormLabel component="legend">Select Qualities:</FormLabel>
|
<FormLabel component="legend">Select Qualities:</FormLabel>
|
||||||
<FormGroup row>
|
<FormGroup row>
|
||||||
@@ -124,7 +121,6 @@ export default function Chart(props) {
|
|||||||
</FormGroup>
|
</FormGroup>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid >
|
</React.Fragment>
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
const output = (data) => {
|
const output = (data) => {
|
||||||
if (data === null) {
|
if (data === null) {
|
||||||
return (
|
return (
|
||||||
<CircularProgress color="secondary" disableShrink />
|
null
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
@@ -108,10 +108,6 @@ export default function ResourceChart(props) {
|
|||||||
if (data === null) {
|
if (data === null) {
|
||||||
loadData();
|
loadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleClick = (e) => {
|
|
||||||
loadData()
|
|
||||||
}
|
|
||||||
const handleChange = (event) => {
|
const handleChange = (event) => {
|
||||||
setInterval(event.target.value);
|
setInterval(event.target.value);
|
||||||
}
|
}
|
||||||
@@ -126,25 +122,27 @@ export default function ResourceChart(props) {
|
|||||||
<Grid item xs={12}>
|
<Grid item xs={12}>
|
||||||
<Card className={classes.card}>
|
<Card className={classes.card}>
|
||||||
|
|
||||||
<FormControl style={{ margin: 20 }}>
|
|
||||||
<Select
|
|
||||||
id="select-interval"
|
|
||||||
value={interval}
|
|
||||||
onChange={handleChange}
|
|
||||||
>
|
|
||||||
<MenuItem value={"day"}>Day</MenuItem>
|
|
||||||
<MenuItem value={"week"}>Week</MenuItem>
|
|
||||||
<MenuItem value={"month"}>Month</MenuItem>
|
|
||||||
</Select>
|
|
||||||
<FormHelperText>Select Interval</FormHelperText>
|
|
||||||
</FormControl>
|
|
||||||
{loading}
|
{loading}
|
||||||
<CardContent style={{ padding: 0 }}>
|
<CardContent style={{ padding: 0 }}>
|
||||||
{output(data)}
|
<Grid container spacing={2}>
|
||||||
|
{output(data)}
|
||||||
|
<Grid item>
|
||||||
|
<FormControl style={{ margin: 20 }}>
|
||||||
|
<Select
|
||||||
|
id="select-interval"
|
||||||
|
value={interval}
|
||||||
|
onChange={handleChange}
|
||||||
|
>
|
||||||
|
<MenuItem value={"day"}>Day</MenuItem>
|
||||||
|
<MenuItem value={"week"}>Week</MenuItem>
|
||||||
|
<MenuItem value={"month"}>Month</MenuItem>
|
||||||
|
</Select>
|
||||||
|
<FormHelperText>Select Interval</FormHelperText>
|
||||||
|
</FormControl>
|
||||||
|
</Grid >
|
||||||
|
</Grid >
|
||||||
</CardContent>
|
</CardContent>
|
||||||
<Button variant="contained" color="secondary" onClick={handleClick}>
|
|
||||||
Refresh
|
|
||||||
</Button>
|
|
||||||
</Card>
|
</Card>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
Reference in New Issue
Block a user