hermes-bsd/web/src/components
wesleysimplicio 74031e1e2a fix(dashboard): respect HERMES_BASE_PATH in WebSocket URLs (#25547)
When the dashboard is reverse-proxied under a path prefix
(`X-Forwarded-Prefix: /dashboard`), the SPA already routes its
`/api/...` REST traffic through `HERMES_BASE_PATH` via
`web/src/lib/api.ts`. Three WebSocket URLs constructed elsewhere
were still hardcoded to root `/api/...` and so opened
`wss://host/api/...` instead of `wss://host/dashboard/api/...`,
forcing operators to forward selected root API/WS paths through the
reverse proxy as a workaround (see issue #25547).

Add `HERMES_BASE_PATH` between `host` and `/api/...` in the
three constructed WebSocket URLs:

- `web/src/pages/ChatPage.tsx` — PTY WebSocket
- `web/src/components/ChatSidebar.tsx` — events subscriber
- `web/src/lib/gatewayClient.ts` — JSON-RPC gateway WebSocket

When the dashboard is served at root, `HERMES_BASE_PATH === """
and the URLs are bit-for-bit identical to before. Under a prefix,
the WebSocket connections now go through the same proxy path the
REST calls already use.

Note: bundled dashboard plugins (kanban, hermes-achievements) embed
`"/api/plugins/..."` in their compiled `dist/index.js` and
remain out of scope here — those need source-side fixes per plugin.

Fixes #25547.
2026-05-17 11:39:37 -07:00
..
ui fix(dashboard): UI polish — modals, layout, consistency, test fixes 2026-05-12 13:59:22 -04:00
AutoField.tsx fix(dashboard): keep ui imports browser-safe after rebase 2026-04-29 01:47:13 -04:00
Backdrop.tsx chore: remove comments 2026-04-28 12:28:08 -04:00
ChatSidebar.tsx fix(dashboard): respect HERMES_BASE_PATH in WebSocket URLs (#25547) 2026-05-17 11:39:37 -07:00
DeleteConfirmDialog.tsx
LanguageSwitcher.tsx feat(i18n): localize all gateway commands + web dashboard, add 8 new locales (16 total) (#22914) 2026-05-10 07:14:14 -07:00
Markdown.tsx feat(web): add /api/pty WebSocket bridge to embed TUI in dashboard 2026-04-24 10:51:49 -04:00
ModelInfoCard.tsx fix(dashboard): keep ui imports browser-safe after rebase 2026-04-29 01:47:13 -04:00
ModelPickerDialog.tsx Merge upstream/main and address Copilot review feedback 2026-04-30 06:43:22 -04:00
NouiTypography.tsx Merge upstream/main and address Copilot review feedback 2026-04-30 06:43:22 -04:00
OAuthLoginModal.tsx fix(dashboard): avoid node-only ui imports in browser 2026-04-29 01:42:50 -04:00
OAuthProvidersCard.tsx fix(dashboard): UI polish — modals, layout, consistency, test fixes 2026-05-12 13:59:22 -04:00
PlatformsCard.tsx fix(dashboard): keep ui imports browser-safe after rebase 2026-04-29 01:47:13 -04:00
SidebarFooter.tsx fix(dashboard): avoid node-only ui imports in browser 2026-04-29 01:42:50 -04:00
SidebarStatusStrip.tsx
SlashPopover.tsx fix(dashboard): keep ui imports browser-safe after rebase 2026-04-29 01:47:13 -04:00
ThemeSwitcher.tsx fix(dashboard): show custom theme palette swatches 2026-05-04 04:43:27 -07:00
Toast.tsx
ToolCall.tsx fix(dashboard): keep ui imports browser-safe after rebase 2026-04-29 01:47:13 -04:00