Fix dashboard: detect /lakehouse/ nginx prefix for API calls

dashboard.ts now checks if running behind the nginx proxy (path
starts with /lakehouse) and prepends the prefix to all API calls.
Without this, the browser called /sql instead of /lakehouse/sql
and got 404s from the LLM Team Flask app.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
root 2026-04-17 13:04:24 -05:00
parent 7367e5f71d
commit 48c7c1c5e6

View File

@ -1,4 +1,6 @@
const GW = window.location.origin;
// Detect if we're behind nginx (/lakehouse/ prefix) or direct (:3700)
const base = window.location.pathname.startsWith("/lakehouse") ? "/lakehouse" : "";
const GW = window.location.origin + base;
let simData: any = null;
let currentDay = 0;