mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
portable-service: better prompt message
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
@@ -232,6 +232,7 @@ class ChatBox: Reactor.Component {
|
||||
|
||||
/******************** start of msgbox ****************************************/
|
||||
var remember_password = false;
|
||||
var last_msgbox_tag = "";
|
||||
function msgbox(type, title, content, link="", callback=null, height=180, width=500, hasRetry=false, contentStyle="") {
|
||||
$(body).scrollTo(0, 0);
|
||||
if (!type) {
|
||||
@@ -264,6 +265,7 @@ function msgbox(type, title, content, link="", callback=null, height=180, width=
|
||||
} else if (type.indexOf("custom") < 0 && !is_port_forward && !callback) {
|
||||
callback = function() { view.close(); }
|
||||
}
|
||||
last_msgbox_tag = type + "-" + title + "-" + content + "-" + link;
|
||||
$(#msgbox).content(<MsgboxComponent width={width} height={height} auto_login={auto_login} type={type} title={title} content={content} link={link} remember={remember} callback={callback} contentStyle={contentStyle} hasRetry={hasRetry} />);
|
||||
}
|
||||
|
||||
@@ -276,6 +278,12 @@ handler.msgbox = function(type, title, text, link = "", hasRetry=false) {
|
||||
self.timer(60ms, function() { msgbox(type, title, text, link, null, 180, 500, hasRetry); });
|
||||
}
|
||||
|
||||
handler.cancel_msgbox = function(tag) {
|
||||
if (last_msgbox_tag == tag) {
|
||||
closeMsgbox();
|
||||
}
|
||||
}
|
||||
|
||||
var reconnectTimeout = 1000;
|
||||
handler.msgbox_retry = function(type, title, text, link, hasRetry) {
|
||||
handler.msgbox(type, title, text, link, hasRetry);
|
||||
|
||||
@@ -231,7 +231,14 @@ impl InvokeUiSession for SciterHandler {
|
||||
}
|
||||
|
||||
fn msgbox(&self, msgtype: &str, title: &str, text: &str, link: &str, retry: bool) {
|
||||
self.call2("msgbox_retry", &make_args!(msgtype, title, text, link, retry));
|
||||
self.call2(
|
||||
"msgbox_retry",
|
||||
&make_args!(msgtype, title, text, link, retry),
|
||||
);
|
||||
}
|
||||
|
||||
fn cancel_msgbox(&self, tag: &str) {
|
||||
self.call("cancel_msgbox", &make_args!(tag));
|
||||
}
|
||||
|
||||
fn new_message(&self, msg: String) {
|
||||
|
||||
Reference in New Issue
Block a user