TDR Chart bekommt von Redux Daten, aber die Darstellung ist noch zu optimieren
This commit is contained in:
26
redux/slices/tdrDataSlice.ts
Normal file
26
redux/slices/tdrDataSlice.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
// redux/slices/tdrDataSlice.ts
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
|
||||
interface TDRDataState {
|
||||
data: { timestamp: string; tdr: number }[];
|
||||
}
|
||||
|
||||
const initialState: TDRDataState = {
|
||||
data: [],
|
||||
};
|
||||
|
||||
const tdrDataSlice = createSlice({
|
||||
name: "tdrData",
|
||||
initialState,
|
||||
reducers: {
|
||||
setTDRData(
|
||||
state,
|
||||
action: PayloadAction<{ timestamp: string; tdr: number }[]>
|
||||
) {
|
||||
state.data = action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { setTDRData } = tdrDataSlice.actions;
|
||||
export default tdrDataSlice.reducer;
|
||||
@@ -6,6 +6,7 @@ import chartDataReducer from "./slices/chartDataSlice";
|
||||
import webVersionReducer from "./slices/webVersionSlice";
|
||||
import digitalInputsReducer from "./slices/digitalInputsSlice";
|
||||
import kabelueberwachungChartReducer from "./slices/kabelueberwachungChartSlice";
|
||||
import tdrDataReducer from "./slices/tdrDataSlice";
|
||||
|
||||
const store = configureStore({
|
||||
reducer: {
|
||||
@@ -15,6 +16,7 @@ const store = configureStore({
|
||||
webVersion: webVersionReducer,
|
||||
digitalInputs: digitalInputsReducer,
|
||||
kabelueberwachungChart: kabelueberwachungChartReducer,
|
||||
tdrData: tdrDataReducer,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user