Refactored ChartUtils to allow for variable normalization parameters, Added day, week, and month filters to Details chart
This commit is contained in:
1 parent
07719aad2b
commit
9cb2abd62a
4 files changed
+91
-26
No files matched your search
@@ -46,6 +46,8 @@ const DetailsPage = () => {
|
||||
const [data, setData] = useState({});
|
||||
const { monitorId } = useParams();
|
||||
const { authToken } = useSelector((state) => state.auth);
|
||||
const [filter, setFilter] = useState("day");
|
||||
|
||||
useEffect(() => {
|
||||
const fetchMonitor = async () => {
|
||||
const res = await axiosInstance.get(`/monitors/${monitorId}`, {
|
||||
@@ -180,13 +182,25 @@ const DetailsPage = () => {
|
||||
Response Times
|
||||
</Typography>
|
||||
<ButtonGroup>
|
||||
<Button level="secondary" label="Day" />
|
||||
<Button level="secondary" label="Week" />
|
||||
<Button level="secondary" label="Month" />
|
||||
<Button
|
||||
level="secondary"
|
||||
label="Day"
|
||||
onClick={() => setFilter("day")}
|
||||
/>
|
||||
<Button
|
||||
level="secondary"
|
||||
label="Week"
|
||||
onClick={() => setFilter("week")}
|
||||
/>
|
||||
<Button
|
||||
level="secondary"
|
||||
label="Month"
|
||||
onClick={() => setFilter("month")}
|
||||
/>
|
||||
</ButtonGroup>
|
||||
</div>
|
||||
<div style={{ height: "10rem" }}>
|
||||
<MonitorDetailsAreaChart checks={monitor.checks} />
|
||||
<div style={{ height: "33vh" }}>
|
||||
<MonitorDetailsAreaChart checks={monitor.checks} filter={filter} />
|
||||
</div>
|
||||
<Typography component="h1" mb={theme.gap.small}>
|
||||
History
|
||||
|
||||
Reference in new issue
Block a user