mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-09-07 21:11:05 +03:00
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:
@@ -436,6 +436,8 @@ class FfiModel with ChangeNotifier {
|
||||
parent.target?.chatModel.onVoiceCallIncoming();
|
||||
} else if (name == 'update_voice_call_state') {
|
||||
parent.target?.serverModel.updateVoiceCallState(evt);
|
||||
} else if (name == 'update_port_forward') {
|
||||
parent.target?.serverModel.updatePortForward(evt);
|
||||
} else if (name == 'fingerprint') {
|
||||
FingerprintState.find(peerId).value = evt['fingerprint'] ?? '';
|
||||
} else if (name == "sync_peer_hash_password_to_personal_ab") {
|
||||
|
||||
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user