fix(control-ui): drop /ui alias
parent
c498348a34
commit
6b6f2b5414
|
|
@ -8,8 +8,7 @@ read_when:
|
||||||
|
|
||||||
The Control UI is a small **Vite + Lit** single-page app served by the Gateway under:
|
The Control UI is a small **Vite + Lit** single-page app served by the Gateway under:
|
||||||
|
|
||||||
- `http://<host>:18789/` (preferred)
|
- `http://<host>:18789/`
|
||||||
- `http://<host>:18789/ui/` (legacy alias)
|
|
||||||
|
|
||||||
It speaks **directly to the Gateway WebSocket** on the same port.
|
It speaks **directly to the Gateway WebSocket** on the same port.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ export type CanvasHostConfig = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export type GatewayControlUiConfig = {
|
export type GatewayControlUiConfig = {
|
||||||
/** If false, the Gateway will not serve the Control UI (/, /ui/). Default: true. */
|
/** If false, the Gateway will not serve the Control UI (/). Default: true. */
|
||||||
enabled?: boolean;
|
enabled?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -87,10 +87,8 @@ export function handleControlUiHttpRequest(
|
||||||
|
|
||||||
const url = new URL(urlRaw, "http://localhost");
|
const url = new URL(urlRaw, "http://localhost");
|
||||||
|
|
||||||
if (url.pathname === "/ui") {
|
if (url.pathname === "/ui" || url.pathname.startsWith("/ui/")) {
|
||||||
res.statusCode = 302;
|
respondNotFound(res);
|
||||||
res.setHeader("Location", "/");
|
|
||||||
res.end();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -106,7 +104,6 @@ export function handleControlUiHttpRequest(
|
||||||
|
|
||||||
const rel = (() => {
|
const rel = (() => {
|
||||||
if (url.pathname === ROOT_PREFIX) return "";
|
if (url.pathname === ROOT_PREFIX) return "";
|
||||||
if (url.pathname.startsWith(UI_PREFIX)) return url.pathname.slice(UI_PREFIX.length);
|
|
||||||
if (url.pathname.startsWith("/assets/")) return url.pathname.slice(1);
|
if (url.pathname.startsWith("/assets/")) return url.pathname.slice(1);
|
||||||
return url.pathname.slice(1);
|
return url.pathname.slice(1);
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue