fix: topology container height

This commit is contained in:
2025-08-30 20:41:00 +02:00
parent 9fba644a18
commit c05a2b6c30
26 changed files with 147 additions and 4574 deletions

View File

@@ -2,7 +2,20 @@
class ApiClient {
constructor() {
this.baseUrl = (typeof window !== 'undefined' && window.API_BASE_URL) || 'http://localhost:3001'; // Backend server URL
// Auto-detect server URL based on current location
const currentHost = window.location.hostname;
const currentPort = window.location.port;
// If accessing from localhost, use localhost:3001
// If accessing from another device, use the same hostname but port 3001
if (currentHost === 'localhost' || currentHost === '127.0.0.1') {
this.baseUrl = 'http://localhost:3001';
} else {
// Use the same hostname but port 3001
this.baseUrl = `http://${currentHost}:3001`;
}
console.log('API Client initialized with base URL:', this.baseUrl);
}
async request(path, { method = 'GET', headers = {}, body = undefined, query = undefined, isForm = false } = {}) {