chart type option

This commit is contained in:
Alex Holliday committed 2026-01-24 00:51:13 +00:00
1 parent 61f3aa1d1c
commit 9904626526
5 files changed
+97 -4

No files matched your search

+8 -2
View File
@@ -17,7 +17,7 @@ import { useState } from "react";
import { useTheme } from "@emotion/react";
import { useTranslation } from "react-i18next";
import { useSelector, useDispatch } from "react-redux";
import { setTimezone, setMode, setLanguage, setShowURL } from "@/Features/UI/uiSlice.js";
import { setTimezone, setMode, setLanguage, setShowURL, setChartType } from "@/Features/UI/uiSlice.js";
import SettingsStats from "./SettingsStats.jsx";
import { useFetchSettings, useSaveSettings } from "@/Hooks/settingsHooks.js";
@@ -33,7 +33,7 @@ const BREADCRUMBS = [{ name: `Settings`, path: "/settings" }];
const Settings = () => {
// Redux state
const { mode, language = "en", timezone, showURL } = useSelector((state) => state.ui);
const { mode, language = "en", timezone, showURL, chartType = "histogram" } = useSelector((state) => state.ui);
// Local state
const [settingsData, setSettingsData] = useState({});
@@ -112,6 +112,11 @@ const Settings = () => {
return;
}
if (name === "chartType") {
dispatch(setChartType(value));
return;
}
if (name === "deleteStats") {
await deleteMonitorStats();
return;
@@ -209,6 +214,7 @@ const Settings = () => {
handleChange={handleChange}
mode={mode}
language={language}
chartType={chartType}
/>
<SettingsPagespeed
isAdmin={isAdmin}