Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
Relay's POST /admin actions (save, mod-add, mod-remove, pause, resume, end, take) are handled in src/admin-routes.ts - no behaviour change #169
Merged 43d 8h ago
POST /admin handling now lives in src/admin-routes.ts as handleAdmin(lobby, req, res, url, readBody), with no behaviour change. It carries the 16 KiB form limit and all seven actions: save, mod-add, mod-remove, pause, resume, end and take.
-
Reviews
ApprovedA faithful move of the POST /admin handler from relay.ts into admin-routes.ts. The action switch, the 16 KB cap (counted by the bytes read), the 403 for non-editors, the 303 redirect and the AdminError mapping are the same as before. relay.ts keeps readBody and passes it in, so no new dependency and no behaviour change. The preview answers /admin with 401 when anonymous, so the identity gate is intact. The existing admin-relay tests already drive every action through the relay, so they cover the moved code. The page has no mobile or keyboard surface changes.
Two things I would do next:
- Replace the inline 405 JSON in handleAdmin with a shared helper. It duplicates relay.ts json() by hand.
- Add a direct unit test of handleAdmin with a stub readBody, so the module does not depend on the relay to be tested.
-
Checks
shipped merged
-
History
- POST /admin handling and every action move from relay.ts into admin-routes.ts - no behaviour change (#122) f417f4f
- src/camera-socket.ts fans one JPEG source out to many sockets, latest frame wins - a pure module with tests, no route (#142) 8ca26ab
- STOP is at least 56 px tall and red on touch, and the stopped banner spans the full width (#141) cc9c7b5
- src/lobby.security.test.ts proves non-drivers are refused, chat HTML stays text, floods collapse, and a mute survives a reconnect (#134) bafea10
- The page's metrics panel script lives in src/ui/metrics-panel.js - no behaviour change (#118) b4a6aaa
- A test proves the served page has exactly one STOP, no layout rule hides it, and it stops on pointerdown (#135) 97d3f3e
- A test proves /admin settings and moderators survive a relay restart on the same FORGE_APP_DATA (#143) 0db24cf
- bench/launch-check.ts checks a deployed URL as an anonymous visitor and prints PASS/FAIL per item - against today's main (#149) 8efb73f
- Relay's GET /admin page is served from src/admin-routes.ts - no behaviour change (#133) 7cc02d9
- forge.json: drop the check block the steward added (a check section needs check.run; limits alone broke every arm check). app.limits keeps the 6 cores the browser tests need. 1142ee6
- forge.json: health is the page itself, not /status - the app must serve (showing the arm offline) while the Pi is unreachable 044b88b
- forge.json: the app and its checks get 6 cores and 6 GiB - browser tests died at the 2-core step default (9 of 23 deploys) 8190a91
- TOP: the joint sliders follow your finger and stay where you put them - no snapping back (#79) c89e816
- /follow: size and rate checks (#78) ff3968f
- forge.json: the overhead camera on the Pi (100.89.95.68:8081) is a declared egress destination 3311805
- SAFETY P0: pressing STOP never makes the arm move - commands sent while held are dropped, never buffered and replayed (#72) 87dd4e8
- The machine, not a magic box: a Machine panel shows the raw arm state and every command in and out, live (#71) 21032a6
- Fast on a phone over 4G: first view under 2 s, the camera adapts to the connection, nothing loads until it is needed (#69) 56e9837
- Leader teleop: with the leader connected in Chrome, moving it moves the real arm - live, during your turn (#65) 896e52f
- Mobile driving: pick a joint and drag one big slider (portrait), two thumb sticks (landscape); zero motion the instant a finger lifts (#60) 058825d
POST
/adminhandling now lives insrc/admin-routes.tsashandleAdmin(lobby, req, res, url, readBody), with no behaviour change. It carries the 16 KiB form limit and all seven actions: save, mod-add, mod-remove, pause, resume, end and take.relay.tsno longer has the admin handler, theMAX_FORMconstant or theAdminError/changeFromFormimports. It keeps one call,handleAdmin(..., readBody), and passes its ownreadBodyso the body-reading logic stays in one place.admin-relay.test.ts,relay.test.tsandadmin.test.tspass untouched: 26 pass, 0 fail.bun x tsc --noEmitstill reports one error, insrc/ui/metrics-panel.js(11,64). It appears the same with my change stashed, so it isn't from this change. I left it alone.Closes #122