📝 "Refactor admin UI components for improved consistency and performance" 🌈
This commit is contained in:
@ -4,6 +4,28 @@
|
||||
let dashboardData = {};
|
||||
let updateInterval;
|
||||
|
||||
// API Base URL Detection
|
||||
function detectApiBaseUrl() {
|
||||
const currentPort = window.location.port;
|
||||
const currentProtocol = window.location.protocol;
|
||||
const currentHost = window.location.hostname;
|
||||
|
||||
// Development-Umgebung (Port 5000)
|
||||
if (currentPort === '5000') {
|
||||
return `${currentProtocol}//${currentHost}:${currentPort}`;
|
||||
}
|
||||
|
||||
// Production-Umgebung (Port 443 oder kein Port)
|
||||
if (currentPort === '443' || currentPort === '') {
|
||||
return `${currentProtocol}//${currentHost}`;
|
||||
}
|
||||
|
||||
// Fallback für andere Ports
|
||||
return window.location.origin;
|
||||
}
|
||||
|
||||
const API_BASE_URL = detectApiBaseUrl();
|
||||
|
||||
// DOM-Elemente
|
||||
const elements = {
|
||||
activeJobs: null,
|
||||
|
Reference in New Issue
Block a user