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

@@ -22,7 +22,6 @@ function MyApp({ Component, pageProps }) {
datetime: window.datetime,
kueOnline: window.kueOnline,
kueIso: window.kueIso,
kueValid: window.kueValid,
kueAlarm1: window.kueAlarm1,
kueAlarm2: window.kueAlarm2,
kueRes: window.kueRes,
@@ -30,16 +29,12 @@ function MyApp({ Component, pageProps }) {
kueGroundFault: window.kueGroundFault,
kueLimit1: window.kueLimit1,
kueLimit2Low: window.kueLimit2Low,
kueLimit2High: window.kueLimit2High,
kueDelay1: window.kueDelay1,
kueLoopInterval: window.kueLoopInterval,
kueID: window.kueID,
kueName: window.kueName,
kueVersion: window.kueVersion,
kueOverflow: window.kueOverflow,
kue100V: window.kue100V,
kueResidence: window.kueResidence,
kueBooting: window.kueBooting,
tdrAtten: window.tdrAtten,
tdrPulse: window.tdrPulse,
tdrSpeed: window.tdrSpeed,
@@ -49,6 +44,7 @@ function MyApp({ Component, pageProps }) {
tdrActive: window.tdrActive,
tdrLast: window.tdrLast,
});
localStorage.setItem("variablesLoaded", "true");
})
.catch((error) => {
console.error("Error loading window variables:", error);

View File

@@ -148,19 +148,19 @@ function Dashboard() {
<table className="min-w-full border border-gray-200 text-left">
<thead className="bg-gray-100 border-b border-gray-300">
<tr>
<th className="py-3 px-4 text-gray-700 text-sm font-medium">
<th className="py-1 px-4 text-gray-700 text-sm font-medium">
ID
</th>
<th className="py-3 px-4 text-gray-700 text-sm font-medium">
<th className="py-1 px-4 text-gray-700 text-sm font-medium">
Modul
</th>
<th className="py-3 px-4 text-gray-700 text-sm font-medium">
<th className="py-1 px-4 text-gray-700 text-sm font-medium">
Zeitstempel
</th>
<th className="py-3 px-4 text-gray-700 text-sm font-medium w-2/3">
<th className="py-1 px-4 text-gray-700 text-sm font-medium w-2/3">
Meldung
</th>
<th className="py-3 px-4 text-gray-700 text-sm font-medium">
<th className="py-1 px-4 text-gray-700 text-sm font-medium">
Status
</th>
</tr>
@@ -172,21 +172,21 @@ function Dashboard() {
key={index}
className="border-b border-gray-200 hover:bg-gray-50"
>
<td className="py-1 px-4 w-1/7">{columns[0]}</td>
<td className="py-1 px-4 w-1/7">{columns[1]}</td>
<td className="py-1 px-4 w-3/7 whitespace-nowrap">
<td className="px-4 w-1/7">{columns[0]}</td>
<td className="px-4 w-1/7">{columns[1]}</td>
<td className="px-4 w-3/7 whitespace-nowrap">
<div className="flex flex-row space-x-2">
<span>{columns[2].split(" ")[0]}</span>
<span>{columns[2].split(" ")[1]}</span>
</div>
</td>
<td className="py-1 px-4 w-2/7">{columns[3]}</td>
<td className="py-1 px-4 w-1/7">{columns[4]}</td>
<td className="px-4 w-2/7">{columns[3]}</td>
<td className="px-4 w-1/7">{columns[4]}</td>
</tr>
))
) : (
<tr>
<td className="py-3 px-4 text-center" colSpan="5">
<td className="px-4 text-center" colSpan="5">
Keine Meldungen verfügbar.
</td>
</tr>

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 = () => {