Repository navigation
Run Dev Tools on Virtual Control (VC-4) - #55
Conversation
On VC-4 the app is served at /VirtualControl/Rooms/<RoomId>/cws/debug/ and the room's API is at <prefix>/cws/api, but the app assumed /cws/debug everywhere: its assets were requested from /cws/debug/assets at the server root (404, blank page), and every API call went to /cws/appNN/api. - shared/functions/hostPaths works out the layout from the page path: the prefix before /cws/, whether it's a VC-4 room, and the room ID. - The build uses relative asset paths, and index.html sets <base> to <prefix>/cws/debug/ at load so deep links still resolve. The dev server keeps its absolute /cws/debug/ base. - The router basename and the API base come from the layout. On VC-4 the room ID is the single "app ID", and /<RoomId>/api/... is mapped to VC-4's /api/... base, so routes and endpoints are otherwise unchanged. - Sign-in probes app01..app10 on an appliance and just the room on VC-4. - A program answering "Authentication is not currently enabled" counts as available instead of failing sign-in. VC-4 rooms answer this way (the VC-4 web server signs users in), as does a 4-series with auth disabled. - TopNav's app switcher no longer assumes appNN names, and the routing feedback session URL goes through the same helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The document base breaks Help fragment links, and mount detection produces incorrect paths for VC-4 rooms named cws.
2 open issues
What changed in this PR
Adds VC-4 room support to Dev Tools while preserving appliance behavior, complementing the server-side deployment of Dev Tools into each room’s HTML folder.
Changes:
- Derives asset, router, and API paths from the hosting location.
- Uses room IDs for VC-4 app selection and accepts authentication-disabled login responses.
- Adds host-layout and sign-in regression tests.
| File | Description |
|---|---|
| vite.config.ts | Uses relative asset paths for production builds. |
| src/store/auth/authErrors.ts | Recognizes authentication-disabled responses. |
| src/store/auth/authErrors.test.ts | Tests login-error classification. |
| src/store/apiSlice.ts | Applies host-aware API paths. |
| src/shared/functions/hostPaths.ts | Centralizes appliance and VC-4 path handling. |
| src/shared/functions/hostPaths.test.ts | Tests host detection and URL mapping. |
| src/services/httpService.ts | Supports request-path rewriting. |
| src/index.tsx | Sets a host-aware router basename. |
| src/features/TopNav.tsx | Supports room IDs when identifying app routes. |
| src/features/Routing.tsx | Uses the shared routing-session URL helper. |
| src/features/LoginForm.tsx | Adjusts login discovery and availability handling. |
| src/features/LoginForm.test.tsx | Tests VC-4 sign-in with authentication disabled. |
| index.html | Sets the asset base dynamically for deep links. |
Review effort: Balanced
New how-to, "Use Dev Tools on Virtual Control (VC-4)": the per-room Dev Tools address, signing in when the room has Crestron authentication off, and the firewall ports the VC-4 host must open: - 65435-65534/tcp for the Debug Console WebSocket - 65335-65433/tcp for the routing feedback WebSocket - the Mobile Control direct server port (50002 by default), per room with firewalld commands, accepting the WebSocket certificate per port, and troubleshooting for blank pages, failed sessions and blocked ports. Linked from the how-to index, the README's program-slot section, and the connection troubleshooting guide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Added a how-to, Use Dev Tools on Virtual Control (VC-4) (
It's linked from the how-to index, the README and the connection troubleshooting guide, so it shows up in the in-app Help. Verified on bosd-vc401 (DEMOV3) with PepperDash/Essentials#1532 and #1533: the page loads, and with those ports open both WebSockets complete a TLS upgrade ( 🤖 Generated with Claude Code |
…n the article - index.html and getHostLayout split the path at the first /cws/, which for a VC-4 room named CWS is the room ID. Both now match the /cws/debug mount. - The <base> tag made same-article Help links such as [Get API Paths](#get-api-paths) resolve to the app root. DocLink now routes them with React Router, keeping the article's path. - Tests run the real inline <base> script from index.html against sample paths. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On VC-4 the program ID is the room ID, so a room can be named help or login. getRouteAppId rejected those names outright, so Start Debug Session in such a room saw the response as stale, stopped the server session and left the button on "Connecting...". It now decides by the second segment: a path whose second segment is a program page belongs to the program in the first. The lookup moves to shared/functions/routeAppId.ts with tests for both room names, and a test that its page list covers every page routed under :appId in App.tsx. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
End-to-end check on Virtual Control. This answers the review's note about pending VC-4 browser validation. Setup:
The only HTTP error in the run was 🤖 Generated with Claude Code |


Pairs with PepperDash/Essentials#1532, which puts the Dev Tools in each VC-4 room's own
Htmlfolder.Problem
On VC-4,
https://<server>/VirtualControl/Rooms/<RoomId>/cws/debug/loaded a blank page (confirmed on bosd-vc401, room DEMOV3):/cws/debug/, so the browser requested/cws/debug/assets/index-*.jsfrom the server root: 404. The same file is served under the room path./cws/appNN/api/.... On VC-4 the room's API is at<prefix>/cws/api/..., with noappNN./cws/app01..app10/api/login. A VC-4 room answers its own login with500 "Authentication is not currently enabled on the controller"(the VC-4 web server does the signing in), which the form treated as wrong credentials.Changes
shared/functions/hostPathsworks out the layout from the page path: the prefix before/cws/, whether it's a VC-4 room, and the room ID. Everything below uses it.index.htmlsets<base>to<prefix>/cws/debug/before any asset tag, so deep links (.../cws/debug/app01/versions) still resolve after a reload.npm startkeeps the absolute/cws/debug/base.<prefix>/cws/debug.<prefix>/cws. On VC-4 the room ID acts as the single app ID (routes like/DEMOV3/versions), and/<RoomId>/api/...is mapped to VC-4's/api/.... Appliance URLs are unchanged.app01..app10on an appliance and only the room on VC-4. A program answering "Authentication is not currently enabled" now counts as available, which also covers a 4-series with authentication turned off.appNNnames; the routing-feedback session URL uses the same helper.Testing
hostPaths(appliance, VC-4, casing, deep links, API mapping) andauthErrors, plus aLoginFormtest that signs in from a VC-4 room path against an auth-disabled response and checks it posts to/VirtualControl/Rooms/DEMOV3/cws/api/login(verified to fail without the change).tsc -b, lint, prettier andnpm run buildare clean. The builtindex.htmlhas the base script ahead of every asset tag and only relative asset URLs.essentials-devtools.zip, the page, its bundle under/cws/debug/assets/, and a deep link all return 200.Not covered: the debug-console and routing-feedback WebSockets connect to URLs the server returns; whether those ports are reachable on a VC-4 host is a server-side matter, like the Mobile Control port.
🤖 Generated with Claude Code