tdrData in tdrChartData ändern und die Datei tdrDataSlice.ts in tdrChartDataSlice.ts umbenennen für bessere Übersicht
This commit is contained in:
@@ -9,7 +9,7 @@ const TDRChart: React.FC = () => {
|
|||||||
const chartInstance = useRef<Chart | null>(null);
|
const chartInstance = useRef<Chart | null>(null);
|
||||||
|
|
||||||
// TDR-Daten aus dem Redux Store selektieren
|
// TDR-Daten aus dem Redux Store selektieren
|
||||||
const chartData = useSelector((state: any) => state.tdrData.data);
|
const chartData = useSelector((state: any) => state.tdrChartData.data);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Importiere und registriere das Zoom-Plugin innerhalb des useEffect-Hooks
|
// Importiere und registriere das Zoom-Plugin innerhalb des useEffect-Hooks
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import TDRChart from "../../../../kabelueberwachung/kue705FO/Charts/TDRChart/TDR
|
|||||||
import { setChartData } from "../../../../../../redux/slices/chartDataSlice";
|
import { setChartData } from "../../../../../../redux/slices/chartDataSlice";
|
||||||
import { parseISO } from "date-fns";
|
import { parseISO } from "date-fns";
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
import { setTDRData } from "../../../../../../redux/slices/tdrDataSlice";
|
import { setTDRChartData } from "../../../../../../redux/slices/tdrChartDataSlice";
|
||||||
|
|
||||||
const TDRChartActionBar: React.FC = () => {
|
const TDRChartActionBar: React.FC = () => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
@@ -76,7 +76,7 @@ const TDRChartActionBar: React.FC = () => {
|
|||||||
}
|
}
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
// Daten im Redux Store speichern
|
// Daten im Redux Store speichern
|
||||||
dispatch(setTDRData(data));
|
dispatch(setTDRChartData(data));
|
||||||
|
|
||||||
console.log("Daten erfolgreich in Redux gespeichert:", data);
|
console.log("Daten erfolgreich in Redux gespeichert:", data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -6,5 +6,5 @@
|
|||||||
2: Patch oder Hotfix (Bugfixes oder kleine Änderungen).
|
2: Patch oder Hotfix (Bugfixes oder kleine Änderungen).
|
||||||
|
|
||||||
*/
|
*/
|
||||||
const webVersion = "1.6.87";
|
const webVersion = "1.6.88";
|
||||||
export default webVersion;
|
export default webVersion;
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
// redux/slices/tdrDataSlice.ts
|
// redux/slices/tdrChartDataSlice.ts
|
||||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||||
|
|
||||||
interface TDRDataState {
|
interface TDRChartDataState {
|
||||||
data: { timestamp: string; tdr: number }[];
|
data: { timestamp: string; tdr: number }[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const initialState: TDRDataState = {
|
const initialState: TDRChartDataState = {
|
||||||
data: [],
|
data: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
const tdrDataSlice = createSlice({
|
const tdrChartDataSlice = createSlice({
|
||||||
name: "tdrData",
|
name: "tdrChartData",
|
||||||
initialState,
|
initialState,
|
||||||
reducers: {
|
reducers: {
|
||||||
setTDRData(
|
setTDRChartData(
|
||||||
state,
|
state,
|
||||||
action: PayloadAction<{ timestamp: string; tdr: number }[]>
|
action: PayloadAction<{ timestamp: string; tdr: number }[]>
|
||||||
) {
|
) {
|
||||||
@@ -22,5 +22,5 @@ const tdrDataSlice = createSlice({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const { setTDRData } = tdrDataSlice.actions;
|
export const { setTDRChartData } = tdrChartDataSlice.actions;
|
||||||
export default tdrDataSlice.reducer;
|
export default tdrChartDataSlice.reducer;
|
||||||
@@ -6,7 +6,7 @@ import chartDataReducer from "./slices/chartDataSlice";
|
|||||||
import webVersionReducer from "./slices/webVersionSlice";
|
import webVersionReducer from "./slices/webVersionSlice";
|
||||||
import digitalInputsReducer from "./slices/digitalInputsSlice";
|
import digitalInputsReducer from "./slices/digitalInputsSlice";
|
||||||
import kabelueberwachungChartReducer from "./slices/kabelueberwachungChartSlice";
|
import kabelueberwachungChartReducer from "./slices/kabelueberwachungChartSlice";
|
||||||
import tdrDataReducer from "./slices/tdrDataSlice";
|
import tdrChartDataReducer from "./slices/tdrChartDataSlice";
|
||||||
|
|
||||||
const store = configureStore({
|
const store = configureStore({
|
||||||
reducer: {
|
reducer: {
|
||||||
@@ -16,7 +16,7 @@ const store = configureStore({
|
|||||||
webVersion: webVersionReducer,
|
webVersion: webVersionReducer,
|
||||||
digitalInputs: digitalInputsReducer,
|
digitalInputs: digitalInputsReducer,
|
||||||
kabelueberwachungChart: kabelueberwachungChartReducer,
|
kabelueberwachungChart: kabelueberwachungChartReducer,
|
||||||
tdrData: tdrDataReducer,
|
tdrChartData: tdrChartDataReducer,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user