-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
21de1f1
commit b9c851c
Showing
9 changed files
with
108 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function Chart({ children }) { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { Line } from "react-chartjs-2"; | ||
import Panel from "./Panel"; | ||
|
||
export default function NetworkSpeedsPanel({ stats }) { | ||
const statsByDate = _.orderBy(stats, 'asc'); | ||
const metricsNames = ['download', 'upload']; | ||
|
||
const dates = _.map(statsByDate, 'date'); | ||
|
||
const download = { | ||
label: 'Download', | ||
data: _.map(statsByDate, 'metrics.download'), | ||
fill: false, | ||
borderColor: '#4caf50', | ||
tension: 0.1, | ||
}; | ||
|
||
const upload = { | ||
label: 'Upload', | ||
data: _.map(statsByDate, 'metrics.upload'), | ||
fill: false, | ||
borderColor: '#f50057', | ||
tension: 0.1, | ||
}; | ||
|
||
const data = { | ||
labels: dates, | ||
datasets: [ | ||
download, | ||
upload, | ||
], | ||
}; | ||
|
||
return ( | ||
<Panel title="Speeds"> | ||
<Line | ||
data={data} | ||
/> | ||
</Panel> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { AppBar, Card, CardContent, Divider, Toolbar, Typography } from "@mui/material"; | ||
import { Box } from "@mui/system"; | ||
|
||
export default function Panel({ title, children }) { | ||
return ( | ||
<Card variant="outlined"> | ||
<Box sx={{ display: 'flex', flexDirection: 'column' }}> | ||
<Box | ||
sx={{ | ||
display: 'flex', | ||
borderBottom: (theme) => `1px solid ${theme.palette.divider}`, | ||
bgcolor: 'background.paper', | ||
color: 'text.secondary', | ||
'& svg': { | ||
m: 1.5, | ||
}, | ||
'& hr': { | ||
mx: 0.5, | ||
}, | ||
paddingX: (theme) => theme.spacing(2), | ||
paddingY: (theme) => theme.spacing(1), | ||
}} | ||
> | ||
<Typography>{title}</Typography> | ||
</Box> | ||
<CardContent sx={{ flex: '1 0 auto' }}> | ||
{children} | ||
</CardContent> | ||
</Box> | ||
</Card> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Line } from 'react-chartjs-2'; | ||
import _ from 'lodash'; | ||
|
||
import { Container } from '@mui/material'; | ||
import NetworkSpeedChart from '../modules/panels/NetworkSpeedsPanel'; | ||
|
||
export default function PanelsPage({ stats }) { | ||
return ( | ||
<Container> | ||
<NetworkSpeedChart stats={stats} /> | ||
</Container> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters