refactor: basePath als Umgebungsvariable eingeführt (NEXT_PUBLIC_BASE_PATH)
- alle festen "/talas5/" Pfade entfernt - dynamischer basePath für API-Links und Station öffnen - README.md und CHANGELOG.md aktualisiert - Version erhöht auf 1.1.188
This commit is contained in:
@@ -8,6 +8,8 @@ import * as urls from "../config/urls.js";
|
||||
import * as layers from "../config/layers.js";
|
||||
|
||||
export const initializeMap = (mapRef, setMap, setOms, setMenuItemAdded, addItemsToMapContextMenu, hasRights, setPolylineEventsDisabled) => {
|
||||
const mode = process.env.NEXT_PUBLIC_API_PORT_MODE;
|
||||
const basePath = process.env.NEXT_PUBLIC_BASE_PATH || "";
|
||||
if (!mapRef.current) {
|
||||
console.error("❌ Fehler: mapRef.current ist nicht definiert.");
|
||||
return;
|
||||
@@ -84,7 +86,7 @@ export const initializeMap = (mapRef, setMap, setOms, setMenuItemAdded, addItems
|
||||
text: "Station öffnen (Tab)",
|
||||
icon: "/img/screen_new.png",
|
||||
callback: () => {
|
||||
const link = `http://${window.location.hostname}/talas5/devices/${selectedDevice.id}`;
|
||||
const link = `http://${window.location.hostname}${basePath}/devices/${selectedDevice.id}`;
|
||||
if (link) {
|
||||
console.log("🟢 Öffne Link in neuem Tab:", link);
|
||||
window.open(link, "_blank");
|
||||
|
||||
Reference in New Issue
Block a user