mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-07-14 19:41:45 +08:00
fix: non-E2EE show dialog (#15514)
* fix: non-E2EE show dialog Signed-off-by: fufesou <linlong1266@gmail.com> * fix: build web, bridge Signed-off-by: fufesou <linlong1266@gmail.com> * fix: direct IP access, do not snow non-E2EE dialog Signed-off-by: fufesou <linlong1266@gmail.com> * fix: non E2EE dialog, update contents Signed-off-by: fufesou <linlong1266@gmail.com> * fix: non-E2EE, show dialog, port forward Signed-off-by: fufesou <linlong1266@gmail.com> * fix: non-E2EE dialog, port forward, ignore direct IP access Signed-off-by: fufesou <linlong1266@gmail.com> * fix: non-E2EE is_direct_ip_access() Signed-off-by: fufesou <linlong1266@gmail.com> * Simple refactor Signed-off-by: fufesou <linlong1266@gmail.com> * fix: non-E2EE dialog, port forward, close socket on disconnect Signed-off-by: fufesou <linlong1266@gmail.com> * fix: non-E2EE dialog, incorrect reuse of Data::Close Signed-off-by: fufesou <linlong1266@gmail.com> --------- Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
+10
-1
@@ -296,6 +296,15 @@ function msgbox(type, title, content, link="", callback=null, height=180, width=
|
||||
else msgbox("connecting", "Connecting...", "Logging in...");
|
||||
}
|
||||
};
|
||||
} else if (type.indexOf("insecure-connection") >= 0) {
|
||||
callback = function (res) {
|
||||
if (!res) {
|
||||
handler.continue_insecure_connection(false);
|
||||
view.close();
|
||||
return;
|
||||
}
|
||||
handler.continue_insecure_connection(true);
|
||||
};
|
||||
} else if (type.indexOf("custom") < 0 && !is_port_forward && !callback) {
|
||||
callback = function() { view.close(); }
|
||||
} else if (type == 'wait-remote-accept-nook') {
|
||||
@@ -479,4 +488,4 @@ class MultipleSessionComponent extends Reactor.Component {
|
||||
</select>
|
||||
</div>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+13
-3
@@ -152,6 +152,7 @@ class MsgboxComponent: Reactor.Component {
|
||||
var hasOk = this.type != "connecting" && this.type != "success" && this.type.indexOf("nook") < 0;
|
||||
var hasLink = this.link != "";
|
||||
var hasClose = this.type.indexOf("hasclose") >= 0;
|
||||
var isInsecureConnection = this.type.indexOf("insecure-connection") >= 0;
|
||||
var show_progress = this.type == "connecting";
|
||||
var me = this;
|
||||
self.timer(0, msgboxTimerFunc);
|
||||
@@ -176,11 +177,12 @@ class MsgboxComponent: Reactor.Component {
|
||||
<div style="text-align: right;">
|
||||
<span style="display:inline-block; max-width: 250px; font-size:12px;" #error />
|
||||
<progress #progress style={"color:" + color + "; display: " + (show_progress ? "inline-block" : "none")} />
|
||||
{isInsecureConnection && hasOk ? <button .button #submit .outline>{translate('Continue')}</button> : ""}
|
||||
{hasCancel || this.hasRetry ? <button .button #cancel .outline>{translate(this.hasRetry ? "OK" : "Cancel")}</button> : ""}
|
||||
{this.hasSkip() ? <button .button #skip .outline>{translate('Skip')}</button> : ""}
|
||||
{hasOk || this.hasRetry ? <button .button #submit>{translate(this.hasRetry ? "Retry" : "OK")}</button> : ""}
|
||||
{!isInsecureConnection && (hasOk || this.hasRetry) ? <button .button #submit>{translate(this.hasRetry ? "Retry" : "OK")}</button> : ""}
|
||||
{hasLink ? <button .button #jumplink .outline>{translate('JumpLink')}</button> : ""}
|
||||
{hasClose ? <button .button #cancel .outline>{translate('Close')}</button> : ""}
|
||||
{hasClose ? (isInsecureConnection ? <button .button #cancel>{translate('Disconnect')}</button> : <button .button #cancel .outline>{translate('Close')}</button>) : ""}
|
||||
{this.getScreenshotButtons()}
|
||||
</div>
|
||||
</div>
|
||||
@@ -193,6 +195,10 @@ class MsgboxComponent: Reactor.Component {
|
||||
}
|
||||
|
||||
function submit() {
|
||||
if (this.type.indexOf("insecure-connection") >= 0) {
|
||||
this.cancel();
|
||||
return;
|
||||
}
|
||||
var submit_btn = this.$(button#submit);
|
||||
if (submit_btn) {
|
||||
if (submit_btn.state.disabled) return;
|
||||
@@ -376,7 +382,11 @@ class MsgboxComponent: Reactor.Component {
|
||||
var el = me.$(.outline-focus);
|
||||
if (el) view.focus = el;
|
||||
else {
|
||||
el = me.$(#submit);
|
||||
if (me.type.indexOf("insecure-connection") >= 0) {
|
||||
el = me.$(#cancel);
|
||||
} else {
|
||||
el = me.$(#submit);
|
||||
}
|
||||
if (el) {
|
||||
view.focus = el;
|
||||
}
|
||||
|
||||
@@ -513,6 +513,7 @@ impl sciter::EventHandler for SciterSession {
|
||||
fn is_rdp();
|
||||
fn login(String, String, String, bool);
|
||||
fn send2fa(String, bool);
|
||||
fn continue_insecure_connection(bool);
|
||||
fn get_enable_trusted_devices();
|
||||
fn new_rdp();
|
||||
fn send_mouse(i32, i32, i32, bool, bool, bool, bool);
|
||||
|
||||
Reference in New Issue
Block a user