mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
add mobile restart remote device
This commit is contained in:
@@ -88,6 +88,15 @@ impl Session {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn restart_remote_device() {
|
||||
if let Some(session) = SESSION.write().unwrap().as_ref() {
|
||||
let mut lc = session.lc.write().unwrap();
|
||||
lc.restarting_remote_device = true;
|
||||
let msg = lc.restart_remote_device();
|
||||
session.send(Data::Message(msg));
|
||||
}
|
||||
}
|
||||
|
||||
fn send(data: Data) {
|
||||
if let Some(session) = SESSION.read().unwrap().as_ref() {
|
||||
session.send(data);
|
||||
@@ -605,8 +614,13 @@ impl Connection {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
log::info!("Reset by the peer");
|
||||
session.msgbox("error", "Connection Error", "Reset by the peer");
|
||||
if session.lc.read().unwrap().restarting_remote_device {
|
||||
log::info!("Restart remote device");
|
||||
session.msgbox("restarting", "Restarting Remote Device", "remote_restarting_tip");
|
||||
} else {
|
||||
log::info!("Reset by the peer");
|
||||
session.msgbox("error", "Connection Error", "Reset by the peer");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -876,6 +890,7 @@ impl Connection {
|
||||
Permission::Keyboard => "keyboard",
|
||||
Permission::Clipboard => "clipboard",
|
||||
Permission::Audio => "audio",
|
||||
Permission::Restart => "restart",
|
||||
_ => "",
|
||||
},
|
||||
&p.enabled.to_string(),
|
||||
|
||||
@@ -629,8 +629,9 @@ impl Handler {
|
||||
}
|
||||
|
||||
fn restart_remote_device(&mut self) {
|
||||
self.lc.write().unwrap().restarting_remote_device = true;
|
||||
let msg = self.lc.write().unwrap().restart_remote_device();
|
||||
let mut lc = self.lc.write().unwrap();
|
||||
lc.restarting_remote_device = true;
|
||||
let msg = lc.restart_remote_device();
|
||||
self.send(Data::Message(msg));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user