Seperater CHeck inserver auf Port 3334
This commit is contained in:
@@ -115,14 +115,25 @@
|
||||
}
|
||||
}
|
||||
|
||||
// URLs mit aktueller Domain aktualisieren
|
||||
// URLs mit aktueller Domain aktualisieren (Port 3334 für Check-in)
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const userId = '<%= user.id %>';
|
||||
const baseUrl = window.location.origin;
|
||||
// Check-in URLs verwenden Port 3334
|
||||
// Ersetze Port in URL oder füge Port hinzu falls nicht vorhanden
|
||||
let checkinBaseUrl;
|
||||
if (baseUrl.match(/:\d+$/)) {
|
||||
// Port vorhanden - ersetze ihn
|
||||
checkinBaseUrl = baseUrl.replace(/:\d+$/, ':3334');
|
||||
} else {
|
||||
// Kein Port - füge Port hinzu
|
||||
const url = new URL(baseUrl);
|
||||
checkinBaseUrl = `${url.protocol}//${url.hostname}:3334`;
|
||||
}
|
||||
const checkinInput = document.getElementById('checkinUrl');
|
||||
const checkoutInput = document.getElementById('checkoutUrl');
|
||||
if (checkinInput) checkinInput.value = `${baseUrl}/api/checkin/${userId}`;
|
||||
if (checkoutInput) checkoutInput.value = `${baseUrl}/api/checkout/${userId}`;
|
||||
if (checkinInput) checkinInput.value = `${checkinBaseUrl}/api/checkin/${userId}`;
|
||||
if (checkoutInput) checkoutInput.value = `${checkinBaseUrl}/api/checkout/${userId}`;
|
||||
|
||||
// Rollenwechsel-Handler
|
||||
const roleSwitcher = document.getElementById('roleSwitcher');
|
||||
|
||||
Reference in New Issue
Block a user