Füge Alert für Rückmeldung der Schleifenmessung hinzu.

This commit is contained in:
ISA
2024-10-22 09:25:28 +02:00
parent 65803294cc
commit 3b0a559d3c

View File

@@ -162,7 +162,9 @@ function Kue705FO({
let slotFormat = slot < 10 ? `0${slot}` : `${slot}`; let slotFormat = slot < 10 ? `0${slot}` : `${slot}`;
const apiUrl = process.env.NEXT_PUBLIC_API_BASE_URL; const apiUrl = process.env.NEXT_PUBLIC_API_BASE_URL;
setLoading(true); setLoading(true); // Setze den Ladezustand auf true
alert(`Schleifenmessung wird für Slot ${slot} gestartet...`);
fetch( fetch(
`${apiUrl}/CPL?Service/KUEdetail.HTML&KS_${slotFormat}=1&slot=${slot}`, `${apiUrl}/CPL?Service/KUEdetail.HTML&KS_${slotFormat}=1&slot=${slot}`,
{ {
@@ -171,15 +173,18 @@ function Kue705FO({
) )
.then((response) => { .then((response) => {
if (response.ok) { if (response.ok) {
alert(`Schleifenmessung erfolgreich gestartet für Slot ${slot}`);
console.log("Schleifenmessung erfolgreich gestartet für Slot", slot); console.log("Schleifenmessung erfolgreich gestartet für Slot", slot);
} else { } else {
alert("Fehler beim Starten der Schleifenmessung.");
console.error("Fehler beim Senden der Schleifen-Anfrage"); console.error("Fehler beim Senden der Schleifen-Anfrage");
} }
}) })
.catch((error) => { .catch((error) => {
alert("Ein Fehler ist aufgetreten.");
console.error("Fehler:", error); console.error("Fehler:", error);
}) })
.finally(() => setLoading(false)); .finally(() => setLoading(false)); // Ladezustand zurücksetzen
}; };
const handleModulNameChange = (newName) => { const handleModulNameChange = (newName) => {