Deployment vorbereitet mit URI-Prefix

This commit is contained in:
concierge committed 2026-10-29 16:22:46 +01:00
1 parent b41c3bc3a6
commit fa02a7ade0
11 files changed
+183 -22

No files matched your search

+3 -2
View File
@@ -1,5 +1,6 @@
const tenant = window.location.pathname.split('/')[1];
const apiBase = `/${tenant}/admin/api`;
const appUrl = window.CMBNET_APP_URL || ((path) => `/${String(path || '').replace(/^\/+/, '')}`);
const tenant = window.CMBNET_TENANT || '';
const apiBase = appUrl(`${tenant}/admin/api`);
function changeRole(accountId, role) {
fetch(`${apiBase}/accounts/${accountId}/role`, {
+4 -2
View File
@@ -1,8 +1,10 @@
const tenantCode = window.location.pathname.split('/')[1];
const appUrl = window.CMBNET_APP_URL || ((path) => `/${String(path || '').replace(/^\/+/, '')}`);
const tenantCode = window.CMBNET_TENANT || '';
const apiBase = appUrl(`${tenantCode}/admin/api`);
async function loadBrokerStatus() {
try {
const response = await fetch(`/${tenantCode}/admin/api/broker/status`);
const response = await fetch(`${apiBase}/broker/status`);
if (!response.ok) {
throw new Error('Failed to load status');
}
+3 -2
View File
@@ -1,5 +1,6 @@
const tenant = window.location.pathname.split('/')[1];
const apiBase = `/${tenant}/admin/api`;
const appUrl = window.CMBNET_APP_URL || ((path) => `/${String(path || '').replace(/^\/+/, '')}`);
const tenant = window.CMBNET_TENANT || '';
const apiBase = appUrl(`${tenant}/admin/api`);
const GROUP_STATES = ['offen', 'unterwegs', 'online', 'pausierend', 'fertig'];
let currentGroupId = null;
+3 -2
View File
@@ -1,5 +1,6 @@
const tenant = window.location.pathname.split('/')[1];
const apiBase = `/${tenant}/admin/api`;
const appUrl = window.CMBNET_APP_URL || ((path) => `/${String(path || '').replace(/^\/+/, '')}`);
const tenant = window.CMBNET_TENANT || '';
const apiBase = appUrl(`${tenant}/admin/api`);
let currentStreetId = null;
let editMode = false;
+4 -3
View File
@@ -7,9 +7,10 @@
* 3. Karte, Polylines, Marker und Kontrollansicht aufbauen
*/
const tenant = window.CMBNET_TENANT || window.location.pathname.split('/')[1];
const apiBase = `/${tenant}/api`;
const wsUrl = `${window.location.protocol === 'https:' ? 'wss' : 'ws'}://${window.location.host}/${tenant}/ws`;
const appUrl = window.CMBNET_APP_URL || ((path) => `/${String(path || '').replace(/^\/+/, '')}`);
const tenant = window.CMBNET_TENANT || '';
const apiBase = appUrl(`${tenant}/api`);
const wsUrl = `${window.location.protocol === 'https:' ? 'wss' : 'ws'}://${window.location.host}${appUrl(`${tenant}/ws`)}`;
const storageKey = `cmbnet:${tenant}:map`;
const themeStorageKey = 'cmbnet:theme';
const currentAccountId = Number(window.CMBNET_ACCOUNT_ID) || null;
+5 -4
View File
@@ -1,9 +1,10 @@
/*
* Mobile Views: Dispatcher-Mobil & Gruppen
*/
const tenant = window.CMBNET_TENANT || window.location.pathname.split('/')[1];
const apiBase = `/${tenant}/api`;
const wsUrl = `${window.location.protocol === 'https:' ? 'wss' : 'ws'}://${window.location.host}/${tenant}/ws`;
const appUrl = window.CMBNET_APP_URL || ((path) => `/${String(path || '').replace(/^\/+/, '')}`);
const tenant = window.CMBNET_TENANT || '';
const apiBase = appUrl(`${tenant}/api`);
const wsUrl = `${window.location.protocol === 'https:' ? 'wss' : 'ws'}://${window.location.host}${appUrl(`${tenant}/ws`)}`;
const storageKey = `cmbnet:${tenant}:mobile`;
const viewMode = window.CMBNET_VIEW_MODE || 'mobile_dispatcher';
const currentAccountId = Number(window.CMBNET_ACCOUNT_ID) || null;
@@ -315,7 +316,7 @@ function bindTabs() {
function bindButtons() {
const logout = document.getElementById('mobileLogout');
if (logout) logout.addEventListener('click', () => {window.location.href = window.CMBNET_LOGOUT_URL || '/';});
if (logout) logout.addEventListener('click', () => {window.location.href = window.CMBNET_LOGOUT_URL || appUrl('');});
const todoBtn = document.getElementById('mobileTodoBtn');
if (todoBtn) todoBtn.addEventListener('click', openStreetSelectDialog);