feat: OPC-UA Status lesbar darstellen

- OPC-UA Zustand wird jetzt als "Server betriebsbereit" oder "Server außer Betrieb" ausgegeben
- Unbekannte Werte werden explizit als "Unbekannt" angezeigt
- Code-Struktur optimiert für bessere Lesbarkeit
This commit is contained in:
ISA
2025-03-17 07:25:06 +01:00
parent c2568a7505
commit a823bd609e
2 changed files with 11 additions and 4 deletions

View File

@@ -13,12 +13,19 @@ const NetworkInfo: React.FC = () => {
const gateway =
useSelector((state: RootState) => state.systemSettings.gateway) ||
"Unbekannt";
const opcUaZustand =
useSelector((state: RootState) => state.opcuaSettings.opcUaZustand) ||
"Unbekannt";
const opcUaZustandRaw = useSelector(
(state: RootState) => state.opcuaSettings.opcUaZustand
);
const opcUaNodesetName =
useSelector((state: RootState) => state.opcuaSettings.opcUaNodesetName) ||
"Unbekannt";
// OPC-UA Zustand in lesbaren Text umwandeln
const opcUaZustand =
Number(opcUaZustandRaw) === 1
? "Server betriebsbereit"
: Number(opcUaZustandRaw) === 0
? "Server außer Betrieb"
: "Unbekannt";
return (
<div className="w-full flex-direction: row flex">