feat: systemSettingsSlice hinzugefügt und Header sowie Einstellungen angepasst
- Neuen Redux Slice `systemSettingsSlice` erstellt, um Systemdaten zentral zu verwalten. - Header-Icon für Systemeinstellungen holt jetzt Daten aus `systemSettingsSlice` statt `variablesSlice`. - Die Einstellungen-Seite (`Allgemeine Einstellungen`) wurde umgestellt und liest nun ebenfalls aus `systemSettingsSlice`. - UI-Optimierungen für die Einstellungen-Seite, um alle Eingabefelder kompakter darzustellen.
This commit is contained in:
@@ -8,6 +8,7 @@ import Footer from "../components/footer/Footer";
|
||||
import "../styles/globals.css";
|
||||
import { Provider } from "react-redux";
|
||||
import { setVariables } from "../redux/slices/variablesSlice";
|
||||
import { setSystemSettings } from "../redux/slices/systemSettingsSlice"; // ✅ Für System-Settings
|
||||
import store from "../redux/store";
|
||||
import { AppProps } from "next/app";
|
||||
import WindowVariablesInitializer from "../components/WindowVariablesInitializer";
|
||||
@@ -21,10 +22,43 @@ function MyApp({ Component, pageProps }: AppProps) {
|
||||
const variables = await loadWindowVariables();
|
||||
if (!variables) throw new Error("Sitzungsfehler");
|
||||
|
||||
// last20Messages entfernen, falls es noch in variables existiert
|
||||
const { last20Messages, ...restVariables } = variables;
|
||||
// ✅ System-Settings und last20Messages separat speichern
|
||||
const {
|
||||
last20Messages, // Entfernen für eigenes Redux-Slice
|
||||
deviceName,
|
||||
mac1,
|
||||
ip,
|
||||
subnet,
|
||||
gateway,
|
||||
cplInternalTimestamp,
|
||||
ntp1,
|
||||
ntp2,
|
||||
ntp3,
|
||||
ntpTimezone,
|
||||
ntpActive,
|
||||
...restVariables
|
||||
} = variables;
|
||||
|
||||
// ✅ Speichere System-Settings in systemSettingsSlice
|
||||
store.dispatch(
|
||||
setSystemSettings({
|
||||
deviceName,
|
||||
mac1,
|
||||
ip,
|
||||
subnet,
|
||||
gateway,
|
||||
cplInternalTimestamp,
|
||||
ntp1,
|
||||
ntp2,
|
||||
ntp3,
|
||||
ntpTimezone,
|
||||
ntpActive,
|
||||
})
|
||||
);
|
||||
|
||||
// ✅ Speichere alle anderen Variablen in variablesSlice
|
||||
store.dispatch(setVariables(restVariables));
|
||||
|
||||
setSessionExpired(false);
|
||||
} catch (error) {
|
||||
console.error("Fehler beim Laden der Sitzung:", error);
|
||||
|
||||
Reference in New Issue
Block a user