- Thunk `fetchOpcUaSettingsThunk` wird jetzt nur bei Anzeige von NetworkInfo ausgeführt - Reduzierte Netzwerklast und bessere Trennung von Zuständigkeiten - Entfernt globalen OPC UA-Aufruf aus _app.tsx
22 lines
618 B
TypeScript
22 lines
618 B
TypeScript
// ✅ 1. Service: /services/fetchOpcUaSettings.ts
|
|
export const fetchOpcUaSettings = async () => {
|
|
try {
|
|
const win = window as any;
|
|
|
|
if (!win) return null;
|
|
|
|
const data = {
|
|
zustand: win.win_opcUaZustand || "Offline",
|
|
encryption: win.win_opcUaEncryption || "None",
|
|
clientCount: win.win_opcUaActiveClientCount || 0,
|
|
nodesetName: win.win_opcUaNodesetName || "DefaultNodeset",
|
|
users: Array.isArray(win.win_opcUaUsers) ? win.win_opcUaUsers : [],
|
|
};
|
|
|
|
return data;
|
|
} catch (error) {
|
|
console.error("Fehler beim Laden der OPC UA Daten:", error);
|
|
return null;
|
|
}
|
|
};
|