feat: Kontextmenü-Link für Marker, Linien und GMA vereinheitlicht – openInNewTab verwendet, Port entfernt, /devices/ ergänzt
This commit is contained in:
@@ -1,23 +1,15 @@
|
||||
// /config/urls.js
|
||||
|
||||
// Dynamische Bestimmung der URLs basierend auf window.location.origin ohne Port
|
||||
let BASE_URL, SERVER_URL, PROXY_TARGET, OFFLINE_TILE_LAYER, MAP_TILES_LAYER;
|
||||
const basePath = process.env.NEXT_PUBLIC_BASE_PATH || "";
|
||||
let BASE_URL, SERVER_URL;
|
||||
const basePath = process.env.NEXT_PUBLIC_BASE_PATH;
|
||||
|
||||
if (typeof window !== "undefined") {
|
||||
// Client-seitige Logik
|
||||
const url = new URL(window.location.origin);
|
||||
const originWithoutPort = `${url.protocol}//${url.hostname}`; // Protokoll und Hostname, ohne Port
|
||||
const originWithoutPort = `${url.protocol}//${url.hostname}`; // z. B. http://10.10.0.13
|
||||
|
||||
BASE_URL = `${originWithoutPort}/api`; // Dynamische Basis-URL
|
||||
SERVER_URL = originWithoutPort; // Dynamisch ermittelt, ohne Port
|
||||
PROXY_TARGET = `${originWithoutPort}:4000`; // Dynamisch für einen Proxy
|
||||
|
||||
OFFLINE_TILE_LAYER = `${originWithoutPort}${basePath}/TileMap/mapTiles/{z}/{x}/{y}.png`; //Map von Talas_v5 Server
|
||||
//console.log("OFFLINE_TILE_LAYER: ", OFFLINE_TILE_LAYER);
|
||||
|
||||
MAP_TILES_LAYER = OFFLINE_TILE_LAYER; // Standardwert
|
||||
BASE_URL = `${originWithoutPort}/api`;
|
||||
SERVER_URL = originWithoutPort;
|
||||
}
|
||||
|
||||
// Export der dynamischen Werte
|
||||
export { BASE_URL, SERVER_URL, PROXY_TARGET, OFFLINE_TILE_LAYER, MAP_TILES_LAYER };
|
||||
export { BASE_URL, SERVER_URL };
|
||||
|
||||
Reference in New Issue
Block a user