IP von window und nicht von .env.local, weil in CHIPTOOL kann die IP geändert werden
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user