From 231ccae10d2c0d15002c0a5d0b85c0615e24f341 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Wed, 2 Sep 2026 22:44:05 +0800 Subject: [PATCH] web: show the WebRTC toggle and transport in the web UI The web client now speaks WebRTC, but the desktop settings page hides the punch options on web and the remote page opens without the session tab that carries the transport name. Let the existing "Enable WebRTC P2P connection" checkbox through on web (the other punch options stay native-only), and add a Transport row to the quality monitor for WebRTC sessions only (with "(TURN)" when ICE relayed), on every platform. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01JXJJGEGdgu26wgCppvUXdZ --- flutter/lib/common/widgets/overlay.dart | 3 +++ flutter/lib/desktop/pages/desktop_setting_page.dart | 4 +++- flutter/lib/models/model.dart | 10 ++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/flutter/lib/common/widgets/overlay.dart b/flutter/lib/common/widgets/overlay.dart index 3fb63616d..fc21ef8a6 100644 --- a/flutter/lib/common/widgets/overlay.dart +++ b/flutter/lib/common/widgets/overlay.dart @@ -606,6 +606,9 @@ class QualityMonitor extends StatelessWidget { _row( "Codec", qualityMonitorModel.data.codecFormat ?? '-'), _row("Chroma", qualityMonitorModel.data.chroma ?? '-'), + if (qualityMonitorModel.webrtcTransport != null) + _row("Transport", + qualityMonitorModel.webrtcTransport!), ], ), ) diff --git a/flutter/lib/desktop/pages/desktop_setting_page.dart b/flutter/lib/desktop/pages/desktop_setting_page.dart index 3d71091e2..cb41d701e 100644 --- a/flutter/lib/desktop/pages/desktop_setting_page.dart +++ b/flutter/lib/desktop/pages/desktop_setting_page.dart @@ -590,12 +590,15 @@ class _GeneralState extends State<_General> { kOptionEnableIpv6Punch, isServer: false, ), + ], + if (!incomingOnly) _OptionCheckBox( context, 'Enable WebRTC P2P connection', kOptionEnableWebrtc, isServer: false, ), + if (!isWeb && !incomingOnly) Tooltip( message: translate('sync-clipboard-between-sessions-tip'), child: _OptionCheckBox( @@ -605,7 +608,6 @@ class _GeneralState extends State<_General> { isServer: false, ), ), - ], ]; // Add client-side wakelock option for desktop platforms diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index e22782034..56c4462ca 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -3597,6 +3597,16 @@ class QualityMonitorModel with ChangeNotifier { bool get show => _show; QualityMonitorData get data => _data; + // Only a WebRTC session names its transport here: web has no session tab + // to show it on, and WebRTC is the one path that can be direct or TURN. + String? get webrtcTransport { + final ffiModel = parent.target?.ffiModel; + if (ffiModel == null) return null; + final streamType = ffiModel.cachedPeerData.streamType; + if (!streamType.startsWith('WebRTC')) return null; + return ffiModel.direct == false ? '$streamType (TURN)' : streamType; + } + checkShowQualityMonitor(SessionID sessionId) async { final show = await bind.sessionGetToggleOption( sessionId: sessionId, arg: 'show-quality-monitor') ==