feat: UI test mode + per-game port configuration

- Settings: UI test mode toggle generates simulated telemetry data (speed/RPM/gear/laps...)
- Simulated data broadcasts via WebSocket and forwards to downstream devices
- game_ports config: per-game independent port overrides (shown when unified port off)
- Settings UI: game port list with save button, hidden when unified port enabled
- Sidebar: switch game reads game_ports[gameId] fallback to default_port
This commit is contained in:
2026-07-26 17:49:18 +08:00
parent bbaef43cfd
commit b00e59d5bf
5 changed files with 130 additions and 4 deletions
+3 -3
View File
@@ -83,9 +83,9 @@ const Sidebar = {
async _selectGame(gameId) {
await API.updateConfig({ selected_game_id: gameId });
const cfg = await API.getConfig();
const game = this._gameData.find(g => g.id === gameId);
if (game && !cfg.use_unified_port && game.default_port) {
await API.updateConfig({ telemetry_port: game.default_port });
if (!cfg.use_unified_port) {
const gamePort = (cfg.game_ports || {})[gameId] || this._gameData.find(g => g.id === gameId)?.default_port || 20777;
await API.updateConfig({ telemetry_port: gamePort });
}
await API.stopTelemetry();
await API.startTelemetry();