fix: Darstellung der Isolationsanzeige angepasst

- ">200 MOhm" wird nun als neutraler Wert angezeigt und nicht in Rot, da es auf eine gute Kabelisolation hinweist.
- Rote Textfarbe bleibt auf Fehlerbeschränkungen wie Aderbruch, Erdschluss, Isolations- und Schleifenfehler begrenzt.
- Code-Bedingungen für die Prioritätsanzeige optimiert, um korrekte Farbzuordnung und Alarmauslösung sicherzustellen.
This commit is contained in:
ISA
2024-10-29 13:25:13 +01:00
parent 580452574d
commit b1a24a3f4e
8 changed files with 139 additions and 181 deletions

View File

@@ -94,21 +94,22 @@ function Kabelueberwachung() {
useEffect(() => {
const script = document.createElement("script");
// Dynamischer Pfad basierend auf der Umgebung
const environment = process.env.NEXT_PUBLIC_NODE_ENV || "production";
if (environment === "production") {
script.src = `CPL?/CPL/SERVICE/kueData.js`; // Produktions-Pfad
} else {
script.src = `/CPLmockData/SERVICE/kueData.js`; // Mock-Daten-Pfad
}
script.src =
environment === "production"
? "CPL?/CPL/SERVICE/kueData.js"
: "/CPLmockData/SERVICE/kueData.js";
script.async = true;
document.body.appendChild(script);
// Cleanup the script if the component unmounts
// Cleanup function mit Überprüfung
return () => {
document.body.removeChild(script);
if (script.parentNode === document.body) {
document.body.removeChild(script);
}
};
}, []);
//----------------------------------------------
useEffect(() => {
const fetchData = () => {