feat(webui): internet sharing UI — exit-offer toggle + peer route-via selector
CellNetwork page (CellPanel): - Internet Sharing section below service toggles - Toggle: 'Offer my internet to <cell>' (calls PUT /api/cells/<n>/exit-offer) - Read-only indicator: whether remote cell offers internet back - Contextual hints explaining what each party needs to do next Peers page: - Fetches connected cells on mount - Edit modal: Internet Exit dropdown (route-via) showing all connected cells with ✓ marker for cells that have offered internet - Warning if selected cell hasn't offered internet yet - On save, calls PUT /api/peers/<n>/route-via only when value changed - Table badge shows 'via <cell>' for peers with active routing api.js: - cellLinkAPI.setExitOffer(cellName, offered) - peerRegistryAPI.setRouteVia(peerName, viaCell) Tests (vitest + @testing-library/react): - 19 new frontend tests in src/__tests__/ - CellNetworkInternetSharing.test.jsx (10 tests) - PeersRouteVia.test.jsx (9 tests) - make test-webui target runs them via docker node:18-alpine Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -242,6 +242,11 @@ test-integration:
|
||||
@echo "Running full integration tests (requires running PIC stack)..."
|
||||
PIC_HOST=$${PIC_HOST:-localhost} python3 -m pytest tests/integration/ -v
|
||||
|
||||
test-webui:
|
||||
@echo "Running webui unit tests (requires node; builds a disposable container)..."
|
||||
docker run --rm -v "$(PWD)/webui:/app" -w /app node:18-alpine \
|
||||
sh -c "npm install --silent && npm test"
|
||||
|
||||
test-integration-readonly:
|
||||
@echo "Running read-only integration tests (no peer creation)..."
|
||||
PIC_HOST=$${PIC_HOST:-localhost} python3 -m pytest tests/integration/test_live_api.py tests/integration/test_webui.py -v
|
||||
|
||||
Reference in New Issue
Block a user