TDR Messung starten
This commit is contained in:
@@ -31,10 +31,35 @@ function Kue705FO({
|
||||
return;
|
||||
}
|
||||
|
||||
// Bereite die URL mit den Slot-Informationen vor und leite weiter
|
||||
// Bereite die Slot-Informationen vor
|
||||
let slotFormat = slot < 10 ? `0${slot}` : `${slot}`;
|
||||
window.location.href = `../CPL?kabelueberwachung.ACP&KTT${slotFormat}=1&slot=${slot}`;
|
||||
console.log("TDR clicked for Slot", slot);
|
||||
const data = {
|
||||
[`KTT${slotFormat}`]: 1,
|
||||
slot: slot,
|
||||
};
|
||||
|
||||
// Die Basis-URL von der Umgebungsvariable holen
|
||||
const apiUrl = process.env.NEXT_PUBLIC_API_BASE_URL;
|
||||
|
||||
// Sende die POST-Anfrage an den Server mit der Basis-URL
|
||||
fetch(`${apiUrl}/CPL?Service/KUEdetailTDR.ACP`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(data), // Konvertiere die Daten in JSON-Format
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.ok) {
|
||||
console.log("POST erfolgreich gesendet für Slot", slot);
|
||||
// Hier kannst du zusätzliche Logik hinzufügen, z. B. eine Erfolgsnachricht anzeigen
|
||||
} else {
|
||||
console.error("Fehler beim Senden der POST-Anfrage");
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("Fehler:", error);
|
||||
});
|
||||
};
|
||||
|
||||
// Überprüfe, ob ein Modul im Slot vorhanden ist
|
||||
|
||||
Reference in New Issue
Block a user