fix(factory): Use same-origin API calls for HAProxy compatibility
Change API base URL to use relative /factory/ path instead of absolute URL with port 7331. HAProxy routes /factory/* API paths to the factory backend while serving UI from luci backend. This fixes mixed content blocking when accessing via HTTPS. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
9d46ff51f3
commit
f9a26f1351
@ -140,10 +140,8 @@
|
|||||||
let tools = [];
|
let tools = [];
|
||||||
let refreshInterval = null;
|
let refreshInterval = null;
|
||||||
|
|
||||||
// API helpers - API runs on port 7331
|
// API helpers - use same origin (HAProxy routes /factory/* to API)
|
||||||
const apiBase = window.location.port === '7331'
|
const apiBase = '/factory/';
|
||||||
? '/factory/'
|
|
||||||
: 'http://' + window.location.hostname + ':7331/factory/';
|
|
||||||
|
|
||||||
const api = {
|
const api = {
|
||||||
get: async (path) => {
|
get: async (path) => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user