feat: support reverse-proxy URL subpaths (llama-swap, SwarmUI) (#1122)

This commit is contained in:
Will Miao
2026-09-24 08:04:00 +08:00
parent 755e1a5bca
commit 2f9bd3ee7d
42 changed files with 731 additions and 103 deletions
+16
View File
@@ -0,0 +1,16 @@
/**
* Base-path helpers for the manager pages.
*
* `window.LM_BASE_PATH` is set by the inline bootstrap in
* templates/components/base_path_bootstrap.html: it is the reverse-proxy
* subpath the manager is served under (e.g. "/comfyui"), or "" for normal
* and standalone deployments.
*/
export function getBasePath() {
return window.LM_BASE_PATH || '';
}
export function withBasePath(path) {
return `${getBasePath()}${path}`;
}