chore: fetch to get in redux thunks files name
This commit is contained in:
@@ -8,7 +8,7 @@ import { RootState } from "@/redux/store";
|
||||
import { useSelector, useDispatch } from "react-redux";
|
||||
import { AppDispatch } from "@/redux/store";
|
||||
import decodeToken from "@/utils/decodeToken";
|
||||
import { fetchSystemSettingsThunk } from "@/redux/thunks/fetchSystemSettingsThunk";
|
||||
import { getSystemSettingsThunk } from "@/redux/thunks/getSystemSettingsThunk";
|
||||
|
||||
function Header() {
|
||||
const router = useRouter();
|
||||
@@ -59,7 +59,7 @@ function Header() {
|
||||
|
||||
useEffect(() => {
|
||||
if (!deviceName) {
|
||||
dispatch(fetchSystemSettingsThunk());
|
||||
dispatch(getSystemSettingsThunk());
|
||||
}
|
||||
}, [deviceName, dispatch]);
|
||||
//----------------------------------------------------------------
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import React, { useEffect } from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { RootState, AppDispatch } from "@/redux/store";
|
||||
import { fetchAnalogInputsThunk } from "@/redux/thunks/fetchAnalogInputsThunk";
|
||||
import { getAnalogInputsThunk } from "@/redux/thunks/getAnalogInputsThunk";
|
||||
import { Icon } from "@iconify/react";
|
||||
import settingsIcon from "@iconify/icons-mdi/settings";
|
||||
import waveformIcon from "@iconify/icons-mdi/waveform";
|
||||
@@ -20,7 +20,7 @@ export default function AnalogInputsTable({
|
||||
const [activeId, setActiveId] = React.useState<number | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
dispatch(fetchAnalogInputsThunk());
|
||||
dispatch(getAnalogInputsThunk());
|
||||
}, [dispatch]);
|
||||
|
||||
const analogInputs = useSelector(
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
setSelectedChartType,
|
||||
} from "../../../../../redux/slices/tdrChartSlice";
|
||||
import { resetBrushRange } from "../../../../../redux/slices/brushSlice";
|
||||
import { fetchTDMDataBySlotThunk } from "../../../../../redux/thunks/fetchTDMListBySlotThunk";
|
||||
import { fetchTDMDataBySlotThunk } from "../../../../../redux/thunks/getTDMListBySlotThunk";
|
||||
import { useLoopChartLoader } from "./LoopMeasurementChart/LoopChartActionBar";
|
||||
|
||||
import {
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Chart, registerables } from "chart.js";
|
||||
import "chartjs-adapter-date-fns";
|
||||
import { getColor } from "../../../../../../utils/colors";
|
||||
import TDRChartActionBar from "./TDRChartActionBar";
|
||||
import { fetchReferenceCurveBySlotThunk } from "../../../../../../redux/thunks/fetchReferenceCurveBySlotThunk";
|
||||
import { getReferenceCurveBySlotThunk } from "../../../../../../redux/thunks/getReferenceCurveBySlotThunk";
|
||||
|
||||
const TDRChart: React.FC<{ isFullScreen: boolean }> = ({ isFullScreen }) => {
|
||||
const dispatch = useDispatch<AppDispatch>();
|
||||
@@ -52,7 +52,7 @@ const TDRChart: React.FC<{ isFullScreen: boolean }> = ({ isFullScreen }) => {
|
||||
//--------------------------------
|
||||
useEffect(() => {
|
||||
if (selectedSlot !== null) {
|
||||
dispatch(fetchReferenceCurveBySlotThunk(selectedSlot));
|
||||
dispatch(getReferenceCurveBySlotThunk(selectedSlot));
|
||||
}
|
||||
}, [selectedSlot, dispatch]);
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ import React, { useState, useEffect } from "react";
|
||||
import { useSelector } from "react-redux";
|
||||
import { useAppDispatch } from "../../../../../../redux/store";
|
||||
import { RootState } from "../../../../../../redux/store";
|
||||
import { fetchTDMDataBySlotThunk } from "../../../../../../redux/thunks/fetchTDMListBySlotThunk";
|
||||
import { fetchTDRChartDataByIdThunk } from "../../../../../../redux/thunks/fetchTDRChartDataByIdThunk";
|
||||
import { fetchReferenceCurveBySlotThunk } from "../../../../../../redux/thunks/fetchReferenceCurveBySlotThunk"; // ⬅ import ergänzen
|
||||
import { fetchTDMDataBySlotThunk } from "../../../../../../redux/thunks/getTDMListBySlotThunk";
|
||||
import { getTDRChartDataByIdThunk } from "../../../../../../redux/thunks/getTDRChartDataByIdThunk";
|
||||
import { getReferenceCurveBySlotThunk } from "../../../../../../redux/thunks/getReferenceCurveBySlotThunk"; // ⬅ import ergänzen
|
||||
|
||||
const TDRChartActionBar: React.FC = () => {
|
||||
const dispatch = useAppDispatch();
|
||||
@@ -33,7 +33,7 @@ const TDRChartActionBar: React.FC = () => {
|
||||
const handleSelectChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
|
||||
const id = parseInt(e.target.value);
|
||||
setSelectedId(id);
|
||||
dispatch(fetchTDRChartDataByIdThunk(id));
|
||||
dispatch(getTDRChartDataByIdThunk(id));
|
||||
};
|
||||
|
||||
// 📌 Referenz setzen (nutzt Slotnummer + 1 für die API)
|
||||
@@ -79,7 +79,7 @@ const TDRChartActionBar: React.FC = () => {
|
||||
JSON.stringify(currentChartData)
|
||||
);
|
||||
|
||||
dispatch(fetchReferenceCurveBySlotThunk(selectedSlot));
|
||||
dispatch(getReferenceCurveBySlotThunk(selectedSlot));
|
||||
|
||||
alert("Referenzkurve wurde erfolgreich gesetzt!");
|
||||
} catch (error) {
|
||||
@@ -96,7 +96,7 @@ const TDRChartActionBar: React.FC = () => {
|
||||
if (slotData?.length > 0) {
|
||||
const lastId = slotData[0].id;
|
||||
setSelectedId(lastId);
|
||||
dispatch(fetchTDRChartDataByIdThunk(lastId));
|
||||
dispatch(getTDRChartDataByIdThunk(lastId));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import { useAdminAuth } from "./hooks/useAdminAuth";
|
||||
import handleAdminLogin from "./handlers/handleAdminLogin";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { AppDispatch } from "../../../redux/store";
|
||||
import { fetchSystemSettingsThunk } from "../../../redux/thunks/fetchSystemSettingsThunk";
|
||||
import { getSystemSettingsThunk } from "../../../redux/thunks/getSystemSettingsThunk";
|
||||
import handleGeneralSubmit from "./handlers/handleGeneralSubmit";
|
||||
|
||||
const GeneralSettings: React.FC = () => {
|
||||
@@ -52,7 +52,7 @@ const GeneralSettings: React.FC = () => {
|
||||
|
||||
useEffect(() => {
|
||||
if (!systemSettings.deviceName) {
|
||||
dispatch(fetchSystemSettingsThunk());
|
||||
dispatch(getSystemSettingsThunk());
|
||||
}
|
||||
}, []);
|
||||
/*
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useSelector } from "react-redux";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { RootState, useAppDispatch } from "../../../redux/store";
|
||||
import KabelModulStatus from "./modulesStatus/KabelModulStatus";
|
||||
import { fetchKueDataThunk } from "../../../redux/thunks/fetchKueDataThunk";
|
||||
import { getKueDataThunk } from "../../../redux/thunks/getKueDataThunk";
|
||||
|
||||
const Baugruppentraeger: React.FC = () => {
|
||||
const dispatch = useAppDispatch();
|
||||
@@ -83,7 +83,7 @@ const Baugruppentraeger: React.FC = () => {
|
||||
}
|
||||
//--------------------------------------------
|
||||
useEffect(() => {
|
||||
dispatch(fetchKueDataThunk());
|
||||
dispatch(getKueDataThunk());
|
||||
}, [dispatch]);
|
||||
//--------------------------------------------
|
||||
return <>{baugruppen}</>;
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
import React, { useEffect } from "react";
|
||||
import { useSelector, useDispatch } from "react-redux";
|
||||
import { RootState, AppDispatch } from "../../../redux/store";
|
||||
import { fetchSystemSettingsThunk } from "../../../redux/thunks/fetchSystemSettingsThunk";
|
||||
import { fetchOpcUaSettingsThunk } from "../../../redux/thunks/fetchOpcUaSettingsThunk";
|
||||
import { getSystemSettingsThunk } from "../../../redux/thunks/getSystemSettingsThunk";
|
||||
import { getOpcUaSettingsThunk } from "../../../redux/thunks/getOpcUaSettingsThunk";
|
||||
|
||||
const NetworkInfo: React.FC = () => {
|
||||
const dispatch: AppDispatch = useDispatch();
|
||||
|
||||
// ✅ OPC UA Daten laden, wenn Komponente angezeigt wird
|
||||
useEffect(() => {
|
||||
dispatch(fetchSystemSettingsThunk());
|
||||
dispatch(fetchOpcUaSettingsThunk());
|
||||
dispatch(getSystemSettingsThunk());
|
||||
dispatch(getOpcUaSettingsThunk());
|
||||
}, [dispatch]);
|
||||
// Werte direkt aus Redux holen
|
||||
const ip =
|
||||
|
||||
Reference in New Issue
Block a user