Version 1.0.11

fix: openInNewTab.js
This commit is contained in:
ISA
2024-12-06 07:33:35 +01:00
parent 1e0b201695
commit 6fa4d86cd1
2 changed files with 6 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
// /config/settings.js // /config/settings.js
// Definieren der grundlegenden Umgebungseinstellungen und Konfigurationen der Karte // Definieren der grundlegenden Umgebungseinstellungen und Konfigurationen der Karte
export const MAP_VERSION = "1.0.10"; export const MAP_VERSION = "1.0.11";
//export const STANDARD_SIDE_MENU = true; //export const STANDARD_SIDE_MENU = true;
//export const FULL_SIDE_MENU = false; //export const FULL_SIDE_MENU = false;

View File

@@ -1,8 +1,9 @@
// utils/openInNewTab.js // utils/openInNewTab.js
import SERVER_URL from "../config/urls";
export function openInNewTab(e, target) { export function openInNewTab(e, target) {
const BASE_URL = SERVER_URL; const url = new URL(window.location.origin);
const originWithoutPort = `${url.protocol}//${url.hostname}`; // Protokoll und Hostname, ohne Port
const BASE_URL = originWithoutPort;
let link; let link;
// Prüfen, ob der Kontextmenü-Eintrag aufgerufen wird, ohne dass ein Marker oder Polyline direkt angesprochen wird // Prüfen, ob der Kontextmenü-Eintrag aufgerufen wird, ohne dass ein Marker oder Polyline direkt angesprochen wird
@@ -15,12 +16,12 @@ export function openInNewTab(e, target) {
} }
if (target instanceof L.Marker && target.options.link) { if (target instanceof L.Marker && target.options.link) {
link = `${BASE_URL}${target.options.link}`; link = `${originWithoutPort}/talas5/devices/${target.options.link}`;
} else if (target instanceof L.Polyline) { } else if (target instanceof L.Polyline) {
const idLD = target.options.idLD; const idLD = target.options.idLD;
console.log("idLD der Linie", idLD); console.log("idLD der Linie", idLD);
if (idLD) { if (idLD) {
link = `${BASE_URL}cpl.aspx?id=${idLD}`; link = `${originWithoutPort}/talas5/devices/cpl.aspx?id=${idLD}`;
} else { } else {
console.error("Keine gültige 'idLD' für die Linie gefunden."); console.error("Keine gültige 'idLD' für die Linie gefunden.");
return; return;