diff --git a/components/modules/Kue705FO.jsx b/components/modules/Kue705FO.jsx index 48296af..b8eaf6b 100644 --- a/components/modules/Kue705FO.jsx +++ b/components/modules/Kue705FO.jsx @@ -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}`);