feat: fetchKueData mit vollständiger Extraktion aus kueData.js ersetzt loadWindowVariables

- Dynamisches Laden von kueData.js nur bei Bedarf
- Alle benötigten Variablen wie kueAlarm1, kueCableBreak etc. extrahiert
- Fehleranzeige in KabelModulStatus funktioniert wieder korrekt
- loadWindowVariables.ts für KUE vollständig ersetzt
This commit is contained in:
ISA
2025-03-26 15:37:11 +01:00
parent 9e282c9ae5
commit c8619f96de
7 changed files with 104 additions and 176 deletions

View File

@@ -1,7 +1,7 @@
// /pages/einstellungen.tsx
import React, { useState, useEffect } from "react";
import { useAppDispatch } from "../redux/store";
import { setSystemSettings } from "../redux/slices/systemSettingsSlice";
import { loadWindowVariables } from "../utils/loadWindowVariables";
import { fetchSystemSettingsThunk } from "../redux/thunks/fetchSystemSettingsThunk";
import GeneralSettings from "../components/main/settingsPageComponents/GeneralSettings";
import OPCUAInterfaceSettings from "../components/main/settingsPageComponents/OPCUAInterfaceSettings";
@@ -10,42 +10,7 @@ export default function Settings() {
const dispatch = useAppDispatch();
useEffect(() => {
const loadSettings = async () => {
const vars = await loadWindowVariables();
if (!vars) return;
const {
deviceName,
mac1,
ip,
subnet,
gateway,
cplInternalTimestamp,
ntp1,
ntp2,
ntp3,
ntpTimezone,
ntpActive,
} = vars;
dispatch(
setSystemSettings({
deviceName,
mac1,
ip,
subnet,
gateway,
cplInternalTimestamp,
ntp1,
ntp2,
ntp3,
ntpTimezone,
ntpActive,
})
);
};
loadSettings();
dispatch(fetchSystemSettingsThunk());
}, [dispatch]);
return (