new ui 8
This commit is contained in:
@@ -7,18 +7,19 @@
|
|||||||
|
|
||||||
class HomeAutomationClient {
|
class HomeAutomationClient {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.baseUrl = window.API_BASE || '';
|
|
||||||
this.eventSource = null;
|
this.eventSource = null;
|
||||||
this.eventListeners = [];
|
this.eventListeners = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper to construct full API URLs
|
* Helper to construct full API URLs
|
||||||
|
* Reads window.API_BASE at runtime to support dynamic configuration
|
||||||
* @param {string} path - API path (e.g., '/devices')
|
* @param {string} path - API path (e.g., '/devices')
|
||||||
* @returns {string} Full URL
|
* @returns {string} Full URL
|
||||||
*/
|
*/
|
||||||
api(path) {
|
api(path) {
|
||||||
return `${this.baseUrl}${path}`;
|
const baseUrl = window.API_BASE || '';
|
||||||
|
return `${baseUrl}${path}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user