Schleifen und TDR Messung starten ohne apiURL

This commit is contained in:
ISA
2024-10-22 11:59:12 +02:00
parent f5293947f1
commit 009a54bd6a

View File

@@ -116,7 +116,7 @@ function Kue705FO({
// Funktion für die TDR-Messung
const goTDR = () => {
//-------------------------------------------------
const [isClient, setIsClient] = useState(false);
/* const [isClient, setIsClient] = useState(false);
useEffect(() => {
// This will only run in the client/browser, not on the server
@@ -125,7 +125,7 @@ function Kue705FO({
if (!isClient) {
return null; // or a loading spinner
}
} */
//-------------------------------------------------
let slot = slotIndex;
@@ -135,16 +135,10 @@ function Kue705FO({
let slotFormat = slot < 10 ? `0${slot}` : `${slot}`;
//const apiUrl = process.env.NEXT_PUBLIC_API_BASE_URL;
const apiUrl = `https://${window.ip}:443`;
setLoading(true);
fetch(
`${apiUrl}/CPL?Service/KUEdetailTDR.ACP&KTT${slotFormat}=1&slot=${slot}`,
{
method: "GET",
}
)
fetch(`/CPL?Service/KUEdetailTDR.ACP&KTT${slotFormat}=1&slot=${slot}`, {
method: "GET",
})
.then((response) => {
if (response.ok) {
console.log("TDR erfolgreich gestartet für Slot", slot);
@@ -167,17 +161,13 @@ function Kue705FO({
}
let slotFormat = slot < 10 ? `0${slot}` : `${slot}`;
const apiUrl = process.env.NEXT_PUBLIC_API_BASE_URL;
setLoading(true); // Setze den Ladezustand auf true
alert(`Schleifenmessung wird für Slot ${slot} gestartet...`);
fetch(
`${apiUrl}/CPL?Service/KUEdetail.HTML&KS_${slotFormat}=1&slot=${slot}`,
{
method: "GET",
}
)
fetch(`/CPL?Service/KUEdetail.HTML&KS_${slotFormat}=1&slot=${slot}`, {
method: "GET",
})
.then((response) => {
if (response.ok) {
alert(`Schleifenmessung erfolgreich gestartet für Slot ${slot}`);