add configurable cloud api url and subpath routing support for reverse proxies
This commit is contained in:
@@ -3432,9 +3432,16 @@
|
||||
}
|
||||
|
||||
// === Configuration ===
|
||||
const API_BASE = window.location.origin + '/api';
|
||||
function getAppPrefix() {
|
||||
const p = window.location.pathname;
|
||||
if (p.includes('/api/')) return p.substring(0, p.indexOf('/api/'));
|
||||
if (p.includes('/dashboard')) return p.substring(0, p.indexOf('/dashboard'));
|
||||
return '';
|
||||
}
|
||||
const APP_PREFIX = getAppPrefix();
|
||||
const API_BASE = window.location.origin + APP_PREFIX + '/api';
|
||||
const POLL_INTERVAL = 2000; // 2 seconds
|
||||
const WS_URL = `${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}/ws/vitals`;
|
||||
const WS_URL = `${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}${APP_PREFIX}/ws/vitals`;
|
||||
|
||||
// === Vital ranges for status calculation ===
|
||||
const VITAL_RANGES = {
|
||||
|
||||
Reference in New Issue
Block a user