mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-19 19:21:13 +03:00
Refact. Flutter web, peer cards (#7525)
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -453,6 +453,16 @@ export default class Connection {
|
||||
}
|
||||
}
|
||||
|
||||
changePreferCodec() {
|
||||
const supported_decoding = message.SupportedDecoding.fromPartial({
|
||||
ability_vp9: 1,
|
||||
ability_h264: 1,
|
||||
});
|
||||
const option = message.OptionMessage.fromPartial({ supported_decoding });
|
||||
const misc = message.Misc.fromPartial({ option });
|
||||
this._ws?.sendMessage({ misc });
|
||||
}
|
||||
|
||||
async reconnect() {
|
||||
this.close();
|
||||
await this.start(this._id);
|
||||
@@ -549,7 +559,15 @@ export default class Connection {
|
||||
handlePeerInfo(pi: message.PeerInfo) {
|
||||
localStorage.setItem('last_remote_id', this._id);
|
||||
this._peerInfo = pi;
|
||||
if (pi.current_display > pi.displays.length) {
|
||||
pi.current_display = 0;
|
||||
}
|
||||
if (globals.getVersionNumber(pi.version) < globals.getVersionNumber("1.1.10")) {
|
||||
this.setPermission("restart", false);
|
||||
}
|
||||
if (pi.displays.length == 0) {
|
||||
this.setOption("info", pi);
|
||||
globals.pushEvent("update_privacy_mode", {});
|
||||
this.msgbox("error", "Remote Error", "No Display");
|
||||
return;
|
||||
}
|
||||
@@ -559,6 +577,7 @@ export default class Connection {
|
||||
if (p) this.inputOsPassword(p);
|
||||
const username = this.getOption("info")?.username;
|
||||
if (username && !pi.username) pi.username = username;
|
||||
globals.pushEvent("update_privacy_mode", {});
|
||||
this.setOption("info", pi);
|
||||
if (this.getRemember()) {
|
||||
if (this._password?.length) {
|
||||
@@ -573,6 +592,10 @@ export default class Connection {
|
||||
}
|
||||
}
|
||||
|
||||
setPermission(name: string, value: Boolean) {
|
||||
globals.pushEvent("permission", { [name]: value });
|
||||
}
|
||||
|
||||
shouldAutoLogin(): string {
|
||||
const l = this.getOption("lock-after-session-end");
|
||||
const a = !!this.getOption("auto-login");
|
||||
@@ -608,7 +631,7 @@ export default class Connection {
|
||||
default:
|
||||
return;
|
||||
}
|
||||
globals.pushEvent("permission", { [name]: p.enabled });
|
||||
this.setPermission(name, p.enabled);
|
||||
} else if (misc.switch_display) {
|
||||
this.loadVideoDecoder();
|
||||
globals.pushEvent("switch_display", misc.switch_display);
|
||||
|
||||
Reference in New Issue
Block a user