diff --git a/app/dashboard/page.jsx b/app/dashboard/page.jsx index e0a3899..07e212e 100644 --- a/app/dashboard/page.jsx +++ b/app/dashboard/page.jsx @@ -13,7 +13,8 @@ import XioPM2Status from "../../components/modulesStatus/XioPM2Status"; import { Icon } from "@iconify/react"; function Dashboard() { - const apiUrl = process.env.NEXT_PUBLIC_API_BASE_URL; + //const apiUrl = process.env.NEXT_PUBLIC_API_BASE_URL; + const apiUrl = `https://${window.ip}:443`; const [last20Messages, setLast20Messages] = useState([]); const [kueOnline, setkueOnline] = useState([]); const [ip, setIp] = useState(""); diff --git a/app/kabelueberwachung/page.jsx b/app/kabelueberwachung/page.jsx index 4bcd56c..d35211d 100644 --- a/app/kabelueberwachung/page.jsx +++ b/app/kabelueberwachung/page.jsx @@ -3,7 +3,8 @@ import React, { useState, useEffect } from "react"; import Kue705FO from "../../components/modules/Kue705FO"; function Kabelueberwachung() { - const apiUrl = process.env.NEXT_PUBLIC_API_BASE_URL; + //const apiUrl = process.env.NEXT_PUBLIC_API_BASE_URL; + const apiUrl = `https://${window.ip}:443`; const [activeRack, setActiveRack] = useState(1); // Track the active rack const [kueIso, setKueIso] = useState([]); // State to store isolation values const [kueName, setKueName] = useState([]); // State to store the KUE names diff --git a/components/Header.jsx b/components/Header.jsx index d9aec7c..b28bf89 100644 --- a/components/Header.jsx +++ b/components/Header.jsx @@ -7,7 +7,8 @@ import { loadWindowVariables } from "../utils/loadWindowVariables"; // Importier import SettingsModal from "./modales/SettingsModal"; function Header() { - const apiUrl = process.env.NEXT_PUBLIC_API_BASE_URL; + // const apiUrl = process.env.NEXT_PUBLIC_API_BASE_URL; + const apiUrl = `https://${window.ip}:443`; const [stationsname, setStationsname] = useState("Lädt..."); // Platzhalter const [cplStatus, setCplStatus] = useState("Lädt..."); const [showSettingsModal, setShowSettingsModal] = useState(false); diff --git a/components/modales/KueModal.jsx b/components/modales/KueModal.jsx index fd40324..f0c817b 100644 --- a/components/modales/KueModal.jsx +++ b/components/modales/KueModal.jsx @@ -108,7 +108,7 @@ function KueModal({ showModal, onClose, slot, onModulNameChange }) { // Falls Änderungen vorhanden sind, die fetch-Requests auslösen if (Object.keys(changes).length > 0) { - let url = `${process.env.NEXT_PUBLIC_API_BASE_URL}/cpl?Service/kueDetail.HTML&slot=${slot}`; + let url = `https://${window.ip}:443/cpl?Service/kueDetail.HTML&slot=${slot}`; Object.keys(changes).forEach((paramKey) => { url += `&${paramKey}${slot}=${encodeURIComponent(changes[paramKey])}`; @@ -136,7 +136,7 @@ function KueModal({ showModal, onClose, slot, onModulNameChange }) { }; const handleDisplayEinschalten = () => { - const url = `${process.env.NEXT_PUBLIC_API_BASE_URL}/cpl?Service/kueDetail.HTML&KSD${slot}=1`; + const url = `https://${window.ip}:443/cpl?Service/kueDetail.HTML&KSD${slot}=1`; fetch(url, { method: "GET" }) .then((response) => { if (response.ok) { diff --git a/components/modules/Kue705FO.jsx b/components/modules/Kue705FO.jsx index f006a20..c1a4ec4 100644 --- a/components/modules/Kue705FO.jsx +++ b/components/modules/Kue705FO.jsx @@ -114,7 +114,9 @@ function Kue705FO({ } 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; + const apiUrl = `https://${window.ip}:443`; setLoading(true); fetch(