From 15e0bbce6e5902f1565917022a8ab33c126a441c Mon Sep 17 00:00:00 2001 From: ISA Date: Fri, 18 Oct 2024 13:31:07 +0200 Subject: [PATCH] =?UTF-8?q?K=C3=9C705-FO=20Modulname=20von=20kueID=20und?= =?UTF-8?q?=20nicht=20von=20kueName=20nehmen,=20ID=20in=20Modal=20entferne?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/kabelueberwachung/page.jsx | 26 ++++++++++++++++++-------- components/modales/KueModal.jsx | 16 ++++++++++------ 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/app/kabelueberwachung/page.jsx b/app/kabelueberwachung/page.jsx index 3d0e561..9ba9dca 100644 --- a/app/kabelueberwachung/page.jsx +++ b/app/kabelueberwachung/page.jsx @@ -39,7 +39,7 @@ function Kabelueberwachung() { rack1: kueIso.slice(0, 8).map((value, index) => ({ isolationswert: value, // Isolation value for this slot schleifenwiderstand: schleifenwiderstand[index], // Resistance for this slot - modulName: kueName[index] || "Unknown", // Name for this slot + modulName: kueID[index] || "Unknown", // Name for this slot kueOnlineStatus: kueOnline[index], // Online status for this slot })), rack2: kueIso.slice(8, 16).map((value, index) => ({ @@ -107,8 +107,10 @@ function Kabelueberwachung() {
{/* Slots for the active rack */} -
+
{racks[`rack${activeRack}`].map((slot, index) => ( -
+
+ {" "} + {/* No gap */} { // Initialisierung mit Werten aus dem globalen `window`-Objekt + //ID statt Name if (window.kueID && Array.isArray(window.kueID)) { setIds(window.kueID.map((id) => id.trim() || "---")); } - if (window.kueName && Array.isArray(window.kueName)) { - setBezeichnungen(window.kueName.map((name) => name.trim() || "---")); + if (window.kueID && Array.isArray(window.kueID)) { + setBezeichnungen(window.kueID.map((name) => name.trim() || "---")); } if (window.kueLimit1 && Array.isArray(window.kueLimit1)) { setIsolationsgrenzwerte(window.kueLimit1); @@ -117,7 +118,7 @@ function KueModal({ showModal, onClose, slot, onModulNameChange }) { .then((response) => { if (response.ok) { alert("Daten erfolgreich gespeichert!"); - onModulNameChange(bezeichnungen[slot]); // Weitergabe der Änderung + onModulNameChange(ids[slot]); // Weitergabe der Änderung } else { alert("Fehler beim Speichern der Daten!"); } @@ -185,7 +186,8 @@ function KueModal({ showModal, onClose, slot, onModulNameChange }) { {/* ID und Modulname anzeigen */}
-
+ {/* +
handleChange(setIds, e, slot)} />
+ */} +
handleChange(setBezeichnungen, e, slot)} + value={ids[slot]} + onChange={(e) => handleChange(setIds, e, slot)} />