The Belkin firmware requires:
1. A hidden __templates__ field in all form POSTs
2. Image button actions submitted as name.x=0&name.y=0 (not name=value)
3. ECG_kvm_powerport_cnt hidden field
Without these, the device returns "Permission denied" on port config
saves. Also fixed the switch endpoint with the same pattern.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Backend (crates/ericrfb-proxy):
- Session cookie now persisted in AppState for device API calls
- New kvm.rs with three REST endpoints:
GET /api/kvm/ports — scrapes kvm.asp, returns port config as JSON
PUT /api/kvm/ports — saves port names, hotkeys, visibility, count
POST /api/kvm/switch — switches active KVM port via home2.asp
- HTML scraping extracts form values from predictable firmware HTML
Frontend (crates/ericrfb-frontend):
- New shell.ts: sidebar navigation with page routing pattern
(Console, Ports — extensible for Virtual Media, Users, etc.)
- Console refactored into pages/console.ts with mount/unmount lifecycle
- Port switcher dropdown in toolbar (fetches port list, switches on change)
- WebSocket auto-reconnects after port switch
- New pages/ports.ts: editable port configuration table
- Port count, key pause duration, per-port name/hotkey/show-in-console
- Save, reload, and per-port switch buttons
- Active port highlighted
- Dark theme sidebar with active state indicators
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>