cm: update a port-forward row's targets as tunnel channels come and go

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EZ49AbZJYfm8NTp5yDPMab
This commit is contained in:
rustdesk
2026-09-04 01:05:06 +08:00
parent 3fdbaf5006
commit 5daa020516
8 changed files with 46 additions and 1 deletions

View File

@@ -768,6 +768,16 @@ class ServerModel with ChangeNotifier {
}
}
void updatePortForward(Map<String, dynamic> evt) {
final id = int.tryParse(evt['id']?.toString() ?? '');
final portForward = evt['port_forward']?.toString() ?? '';
if (id == null || portForward.isEmpty) return;
final index = _clients.indexWhere((c) => c.id == id);
if (index < 0) return;
_clients[index].portForward = portForward;
notifyListeners();
}
void androidUpdatekeepScreenOn() async {
if (!isAndroid) return;
var floatingWindowDisabled =