KÜ705-FO Modulname von kueID und nicht von kueName nehmen, ID in Modal entfernen
This commit is contained in:
@@ -39,7 +39,7 @@ function Kabelueberwachung() {
|
|||||||
rack1: kueIso.slice(0, 8).map((value, index) => ({
|
rack1: kueIso.slice(0, 8).map((value, index) => ({
|
||||||
isolationswert: value, // Isolation value for this slot
|
isolationswert: value, // Isolation value for this slot
|
||||||
schleifenwiderstand: schleifenwiderstand[index], // Resistance 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
|
kueOnlineStatus: kueOnline[index], // Online status for this slot
|
||||||
})),
|
})),
|
||||||
rack2: kueIso.slice(8, 16).map((value, index) => ({
|
rack2: kueIso.slice(8, 16).map((value, index) => ({
|
||||||
@@ -107,8 +107,10 @@ function Kabelueberwachung() {
|
|||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<button
|
<button
|
||||||
onClick={() => changeRack(1)}
|
onClick={() => changeRack(1)}
|
||||||
className={`mr-2 ${
|
className={`mr-1 ${
|
||||||
activeRack === 1 ? "bg-blue-500 text-white" : "bg-gray-300"
|
activeRack === 1
|
||||||
|
? "bg-littwin-blue text-white p-1 rounded-sm "
|
||||||
|
: "bg-gray-300 p-1 text-sm"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
Rack 1
|
Rack 1
|
||||||
@@ -116,7 +118,9 @@ function Kabelueberwachung() {
|
|||||||
<button
|
<button
|
||||||
onClick={() => changeRack(2)}
|
onClick={() => changeRack(2)}
|
||||||
className={`mr-2 ${
|
className={`mr-2 ${
|
||||||
activeRack === 2 ? "bg-blue-500 text-white" : "bg-gray-300"
|
activeRack === 2
|
||||||
|
? "bg-littwin-blue text-white p-1 rounded-sm"
|
||||||
|
: "bg-gray-300 p-1 text-sm"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
Rack 2
|
Rack 2
|
||||||
@@ -124,7 +128,9 @@ function Kabelueberwachung() {
|
|||||||
<button
|
<button
|
||||||
onClick={() => changeRack(3)}
|
onClick={() => changeRack(3)}
|
||||||
className={`mr-2 ${
|
className={`mr-2 ${
|
||||||
activeRack === 3 ? "bg-blue-500 text-white" : "bg-gray-300"
|
activeRack === 3
|
||||||
|
? "bg-littwin-blue text-white p-1 rounded-sm"
|
||||||
|
: "bg-gray-300 p-1 text-sm"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
Rack 3
|
Rack 3
|
||||||
@@ -132,7 +138,9 @@ function Kabelueberwachung() {
|
|||||||
<button
|
<button
|
||||||
onClick={() => changeRack(4)}
|
onClick={() => changeRack(4)}
|
||||||
className={`mr-2 ${
|
className={`mr-2 ${
|
||||||
activeRack === 4 ? "bg-blue-500 text-white" : "bg-gray-300"
|
activeRack === 4
|
||||||
|
? "bg-littwin-blue text-white p-1 rounded-sm"
|
||||||
|
: "bg-gray-300 p-1 text-sm"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
Rack 4
|
Rack 4
|
||||||
@@ -140,9 +148,11 @@ function Kabelueberwachung() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Slots for the active rack */}
|
{/* Slots for the active rack */}
|
||||||
<div className="flex flex-row justify-between">
|
<div className="flex flex-row space-x-4">
|
||||||
{racks[`rack${activeRack}`].map((slot, index) => (
|
{racks[`rack${activeRack}`].map((slot, index) => (
|
||||||
<div key={index} className="flex-grow">
|
<div key={index} className="flex">
|
||||||
|
{" "}
|
||||||
|
{/* No gap */}
|
||||||
<Kue705FO
|
<Kue705FO
|
||||||
isolationswert={slot.isolationswert}
|
isolationswert={slot.isolationswert}
|
||||||
schleifenwiderstand={slot.schleifenwiderstand}
|
schleifenwiderstand={slot.schleifenwiderstand}
|
||||||
|
|||||||
@@ -35,11 +35,12 @@ function KueModal({ showModal, onClose, slot, onModulNameChange }) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Initialisierung mit Werten aus dem globalen `window`-Objekt
|
// Initialisierung mit Werten aus dem globalen `window`-Objekt
|
||||||
|
//ID statt Name
|
||||||
if (window.kueID && Array.isArray(window.kueID)) {
|
if (window.kueID && Array.isArray(window.kueID)) {
|
||||||
setIds(window.kueID.map((id) => id.trim() || "---"));
|
setIds(window.kueID.map((id) => id.trim() || "---"));
|
||||||
}
|
}
|
||||||
if (window.kueName && Array.isArray(window.kueName)) {
|
if (window.kueID && Array.isArray(window.kueID)) {
|
||||||
setBezeichnungen(window.kueName.map((name) => name.trim() || "---"));
|
setBezeichnungen(window.kueID.map((name) => name.trim() || "---"));
|
||||||
}
|
}
|
||||||
if (window.kueLimit1 && Array.isArray(window.kueLimit1)) {
|
if (window.kueLimit1 && Array.isArray(window.kueLimit1)) {
|
||||||
setIsolationsgrenzwerte(window.kueLimit1);
|
setIsolationsgrenzwerte(window.kueLimit1);
|
||||||
@@ -117,7 +118,7 @@ function KueModal({ showModal, onClose, slot, onModulNameChange }) {
|
|||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
alert("Daten erfolgreich gespeichert!");
|
alert("Daten erfolgreich gespeichert!");
|
||||||
onModulNameChange(bezeichnungen[slot]); // Weitergabe der Änderung
|
onModulNameChange(ids[slot]); // Weitergabe der Änderung
|
||||||
} else {
|
} else {
|
||||||
alert("Fehler beim Speichern der Daten!");
|
alert("Fehler beim Speichern der Daten!");
|
||||||
}
|
}
|
||||||
@@ -185,7 +186,8 @@ function KueModal({ showModal, onClose, slot, onModulNameChange }) {
|
|||||||
|
|
||||||
{/* ID und Modulname anzeigen */}
|
{/* ID und Modulname anzeigen */}
|
||||||
<div className="p-2 mb-4">
|
<div className="p-2 mb-4">
|
||||||
<div className="mb-2">
|
{/*
|
||||||
|
<div className="mb-2">
|
||||||
<label className="font-bold">ID:</label>
|
<label className="font-bold">ID:</label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
@@ -194,13 +196,15 @@ function KueModal({ showModal, onClose, slot, onModulNameChange }) {
|
|||||||
onChange={(e) => handleChange(setIds, e, slot)}
|
onChange={(e) => handleChange(setIds, e, slot)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
*/}
|
||||||
|
|
||||||
<div className="mb-2">
|
<div className="mb-2">
|
||||||
<label className="font-bold">Modulname:</label>
|
<label className="font-bold">Modulname:</label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
className="border rounded p-1 w-full text-sm"
|
className="border rounded p-1 w-full text-sm"
|
||||||
value={bezeichnungen[slot]}
|
value={ids[slot]}
|
||||||
onChange={(e) => handleChange(setBezeichnungen, e, slot)}
|
onChange={(e) => handleChange(setIds, e, slot)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user