mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
@@ -1337,6 +1337,15 @@ impl LoginConfigHandler {
|
||||
self.password = Default::default();
|
||||
interface.msgbox("re-input-password", err, "Do you want to enter again?", "");
|
||||
true
|
||||
} else if err == "No Password Access" {
|
||||
self.password = Default::default();
|
||||
interface.msgbox(
|
||||
"wait-remote-accept-nook",
|
||||
"Prompt",
|
||||
"Please wait for the remote side to accept your session request...",
|
||||
"",
|
||||
);
|
||||
true
|
||||
} else {
|
||||
if err.contains(SCRAP_X11_REQUIRED) {
|
||||
interface.msgbox("error", "Login Error", err, SCRAP_X11_REF_URL);
|
||||
@@ -1434,11 +1443,7 @@ impl LoginConfigHandler {
|
||||
username: self.id.clone(),
|
||||
password: password.into(),
|
||||
my_id,
|
||||
my_name: if cfg!(windows) {
|
||||
crate::platform::get_active_username()
|
||||
} else {
|
||||
crate::username()
|
||||
},
|
||||
my_name: crate::username(),
|
||||
option: self.get_option_message(true).into(),
|
||||
session_id: self.session_id,
|
||||
version: crate::VERSION.to_string(),
|
||||
|
||||
@@ -226,6 +226,7 @@ pub fn core_main() -> Option<Vec<String>> {
|
||||
// meanwhile, return true to call flutter window to show control panel
|
||||
#[cfg(feature = "flutter")]
|
||||
crate::flutter::connection_manager::start_listen_ipc_thread();
|
||||
crate::ui_interface::start_option_status_sync();
|
||||
}
|
||||
}
|
||||
//_async_logger_holder.map(|x| x.flush());
|
||||
|
||||
@@ -562,7 +562,7 @@ pub fn main_get_connect_status() -> String {
|
||||
|
||||
pub fn main_check_connect_status() {
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
check_mouse_time(); // avoid multi calls
|
||||
start_option_status_sync(); // avoid multi calls
|
||||
}
|
||||
|
||||
pub fn main_is_using_public_server() -> bool {
|
||||
|
||||
@@ -389,5 +389,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("This PC", "Aquest PC"),
|
||||
("or", "o"),
|
||||
("Continue with", "Continuar amb"),
|
||||
("Accept sessions via password", ""),
|
||||
("Accept sessions via click", ""),
|
||||
("Accept sessions via both", ""),
|
||||
("Please wait for the remote side to accept your session request...", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -390,5 +390,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Continue with", "使用"),
|
||||
("Elevate", "提权"),
|
||||
("Zoom cursor", "缩放鼠标"),
|
||||
("Accept sessions via password", "只允许密码访问"),
|
||||
("Accept sessions via click", "只允许点击访问"),
|
||||
("Accept sessions via both", "允许密码或点击访问"),
|
||||
("Please wait for the remote side to accept your session request...", "请等待对方接受你的连接..."),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -390,5 +390,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Continue with", ""),
|
||||
("Elevate", ""),
|
||||
("Zoom cursor", ""),
|
||||
("Accept sessions via password", ""),
|
||||
("Accept sessions via click", ""),
|
||||
("Accept sessions via both", ""),
|
||||
("Please wait for the remote side to accept your session request...", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -390,5 +390,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Continue with", ""),
|
||||
("Elevate", ""),
|
||||
("Zoom cursor", ""),
|
||||
("Accept sessions via password", ""),
|
||||
("Accept sessions via click", ""),
|
||||
("Accept sessions via both", ""),
|
||||
("Please wait for the remote side to accept your session request...", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -390,5 +390,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Continue with", ""),
|
||||
("Elevate", ""),
|
||||
("Zoom cursor", ""),
|
||||
("Accept sessions via password", ""),
|
||||
("Accept sessions via click", ""),
|
||||
("Accept sessions via both", ""),
|
||||
("Please wait for the remote side to accept your session request...", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -390,5 +390,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Continue with", ""),
|
||||
("Elevate", ""),
|
||||
("Zoom cursor", ""),
|
||||
("Accept sessions via password", ""),
|
||||
("Accept sessions via click", ""),
|
||||
("Accept sessions via both", ""),
|
||||
("Please wait for the remote side to accept your session request...", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -390,5 +390,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Continue with", "Continuar con"),
|
||||
("Elevate", "Elevar"),
|
||||
("Zoom cursor", "Ampliar cursor"),
|
||||
("Accept sessions via password", ""),
|
||||
("Accept sessions via click", ""),
|
||||
("Accept sessions via both", ""),
|
||||
("Please wait for the remote side to accept your session request...", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -389,5 +389,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("or", "یا"),
|
||||
("Continue with", "ادامه با"),
|
||||
("Zoom cursor", ""),
|
||||
("Accept sessions via password", ""),
|
||||
("Accept sessions via click", ""),
|
||||
("Accept sessions via both", ""),
|
||||
("Please wait for the remote side to accept your session request...", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -390,5 +390,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Continue with", "Continuer avec"),
|
||||
("Elevate", ""),
|
||||
("Zoom cursor", ""),
|
||||
("Accept sessions via password", ""),
|
||||
("Accept sessions via click", ""),
|
||||
("Accept sessions via both", ""),
|
||||
("Please wait for the remote side to accept your session request...", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -390,5 +390,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Continue with", "Folytatás a következővel"),
|
||||
("Elevate", ""),
|
||||
("Zoom cursor", ""),
|
||||
("Accept sessions via password", ""),
|
||||
("Accept sessions via click", ""),
|
||||
("Accept sessions via both", ""),
|
||||
("Please wait for the remote side to accept your session request...", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -390,5 +390,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Continue with", ""),
|
||||
("Elevate", ""),
|
||||
("Zoom cursor", ""),
|
||||
("Accept sessions via password", ""),
|
||||
("Accept sessions via click", ""),
|
||||
("Accept sessions via both", ""),
|
||||
("Please wait for the remote side to accept your session request...", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -390,5 +390,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Continue with", "Continua con"),
|
||||
("Elevate", "Eleva"),
|
||||
("Zoom cursor", "Cursore zoom"),
|
||||
("Accept sessions via password", ""),
|
||||
("Accept sessions via click", ""),
|
||||
("Accept sessions via both", ""),
|
||||
("Please wait for the remote side to accept your session request...", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -390,5 +390,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Continue with", ""),
|
||||
("Elevate", ""),
|
||||
("Zoom cursor", ""),
|
||||
("Accept sessions via password", ""),
|
||||
("Accept sessions via click", ""),
|
||||
("Accept sessions via both", ""),
|
||||
("Please wait for the remote side to accept your session request...", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -390,5 +390,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Continue with", ""),
|
||||
("Elevate", ""),
|
||||
("Zoom cursor", ""),
|
||||
("Accept sessions via password", ""),
|
||||
("Accept sessions via click", ""),
|
||||
("Accept sessions via both", ""),
|
||||
("Please wait for the remote side to accept your session request...", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -390,5 +390,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Continue with", ""),
|
||||
("Elevate", ""),
|
||||
("Zoom cursor", ""),
|
||||
("Accept sessions via password", ""),
|
||||
("Accept sessions via click", ""),
|
||||
("Accept sessions via both", ""),
|
||||
("Please wait for the remote side to accept your session request...", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -390,5 +390,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Continue with", "Kontynuuj z"),
|
||||
("Elevate", ""),
|
||||
("Zoom cursor", ""),
|
||||
("Accept sessions via password", ""),
|
||||
("Accept sessions via click", ""),
|
||||
("Accept sessions via both", ""),
|
||||
("Please wait for the remote side to accept your session request...", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -390,5 +390,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Continue with", ""),
|
||||
("Elevate", ""),
|
||||
("Zoom cursor", ""),
|
||||
("Accept sessions via password", ""),
|
||||
("Accept sessions via click", ""),
|
||||
("Accept sessions via both", ""),
|
||||
("Please wait for the remote side to accept your session request...", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -390,5 +390,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Continue with", "Continuar com"),
|
||||
("Elevate", ""),
|
||||
("Zoom cursor", ""),
|
||||
("Accept sessions via password", ""),
|
||||
("Accept sessions via click", ""),
|
||||
("Accept sessions via both", ""),
|
||||
("Please wait for the remote side to accept your session request...", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -390,5 +390,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Continue with", "Продолжить с"),
|
||||
("Elevate", "Повысить"),
|
||||
("Zoom cursor", "Масштабировать курсор"),
|
||||
("Accept sessions via password", ""),
|
||||
("Accept sessions via click", ""),
|
||||
("Accept sessions via both", ""),
|
||||
("Please wait for the remote side to accept your session request...", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -390,5 +390,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Continue with", ""),
|
||||
("Elevate", ""),
|
||||
("Zoom cursor", ""),
|
||||
("Accept sessions via password", ""),
|
||||
("Accept sessions via click", ""),
|
||||
("Accept sessions via both", ""),
|
||||
("Please wait for the remote side to accept your session request...", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -390,5 +390,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Continue with", ""),
|
||||
("Elevate", ""),
|
||||
("Zoom cursor", ""),
|
||||
("Accept sessions via password", ""),
|
||||
("Accept sessions via click", ""),
|
||||
("Accept sessions via both", ""),
|
||||
("Please wait for the remote side to accept your session request...", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -390,5 +390,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Continue with", "bununla devam et"),
|
||||
("Elevate", "Yükseltme"),
|
||||
("Zoom cursor", ""),
|
||||
("Accept sessions via password", ""),
|
||||
("Accept sessions via click", ""),
|
||||
("Accept sessions via both", ""),
|
||||
("Please wait for the remote side to accept your session request...", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -390,5 +390,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Continue with", ""),
|
||||
("Elevate", "提權"),
|
||||
("Zoom cursor", ""),
|
||||
("Accept sessions via password", "只允許密碼訪問"),
|
||||
("Accept sessions via click", "只允許點擊訪問"),
|
||||
("Accept sessions via both", "允許密碼或點擊訪問"),
|
||||
("Please wait for the remote side to accept your session request...", "請等待對方接受你的連接..."),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -390,5 +390,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Continue with", ""),
|
||||
("Elevate", ""),
|
||||
("Zoom cursor", ""),
|
||||
("Accept sessions via password", ""),
|
||||
("Accept sessions via click", ""),
|
||||
("Accept sessions via both", ""),
|
||||
("Please wait for the remote side to accept your session request...", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -390,5 +390,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Continue with", ""),
|
||||
("Elevate", ""),
|
||||
("Zoom cursor", ""),
|
||||
("Accept sessions via password", ""),
|
||||
("Accept sessions via click", ""),
|
||||
("Accept sessions via both", ""),
|
||||
("Please wait for the remote side to accept your session request...", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -1046,6 +1046,14 @@ impl Connection {
|
||||
}
|
||||
if !crate::is_ip(&lr.username) && lr.username != Config::get_id() {
|
||||
self.send_login_error("Offline").await;
|
||||
} else if Config::get_option("approve-mode") == "click" {
|
||||
self.try_start_cm(lr.my_id, lr.my_name, false);
|
||||
if hbb_common::get_version_number(&lr.version)
|
||||
>= hbb_common::get_version_number("1.2.0")
|
||||
{
|
||||
self.send_login_error("No Password Access").await;
|
||||
}
|
||||
return true;
|
||||
} else if self.is_of_recent_session() {
|
||||
self.try_start_cm(lr.my_id, lr.my_name, true);
|
||||
self.send_logon_response().await;
|
||||
|
||||
@@ -135,6 +135,10 @@ impl SciterConnectionManager {
|
||||
fn elevate_portable(&self, id: i32) {
|
||||
crate::ui_cm_interface::elevate_portable(id);
|
||||
}
|
||||
|
||||
fn get_option(&self, key: String) -> String {
|
||||
crate::ui_interface::get_option(key)
|
||||
}
|
||||
}
|
||||
|
||||
impl sciter::EventHandler for SciterConnectionManager {
|
||||
@@ -155,5 +159,6 @@ impl sciter::EventHandler for SciterConnectionManager {
|
||||
fn send_msg(i32, String);
|
||||
fn can_elevate();
|
||||
fn elevate_portable(i32);
|
||||
fn get_option(String);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ class Body: Reactor.Component
|
||||
var right_style = show_chat ? "" : "display: none";
|
||||
var disconnected = c.disconnected;
|
||||
var show_elevation_btn = handler.can_elevate() && show_elevation;
|
||||
var show_accept_btn = handler.get_option('approve-mode') != 'password';
|
||||
// below size:* is work around for Linux, it alreayd set in css, but not work, shit sciter
|
||||
return <div .content style="size:*">
|
||||
<div .left-panel>
|
||||
@@ -58,16 +59,15 @@ class Body: Reactor.Component
|
||||
{c.port_forward ? <div>Port Forwarding: {c.port_forward}</div> : ""}
|
||||
<div style="size:*"/>
|
||||
<div .outer_buttons>
|
||||
{!auth && !disconnected && show_elevation_btn ? <button #elevate_accept .control .elevate .button><span><span><span>{svg_elevate}</span><span>{translate('Accept')}</span></span></span></button> : "" }
|
||||
{!auth && !disconnected && show_elevation_btn && show_accept_btn ? <button #elevate_accept .control .elevate .button><span><span><span>{svg_elevate}</span><span>{translate('Accept')}</span></span></span></button> : "" }
|
||||
{auth && !disconnected && show_elevation_btn ? <button #elevate .control .elevate .button><span><span><span>{svg_elevate}</span><span>{translate('Elevate')}</span></span></span></button> : "" }
|
||||
<div .inner_buttons style={auth ? "display:none;":""}>
|
||||
{!auth ? <button #accept .control .button>{translate('Accept')}</button> : "" }
|
||||
{!auth && show_accept_btn ? <button #accept .control .button>{translate('Accept')}</button> : "" }
|
||||
{!auth ? <button #dismiss .control .outline>{translate('Dismiss')}</button> : "" }
|
||||
</div>
|
||||
{auth && !disconnected ? <button #disconnect .control .button>{translate('Disconnect')}</button> : "" }
|
||||
{auth && disconnected ? <button #close .control .button>{translate('Close')}</button> : "" }
|
||||
</div>
|
||||
<div style={!show_elevation_btn ? "height:1 em;" : "display:none;"}></div>
|
||||
{c.is_file_transfer || c.port_forward ? "" : <div .chaticon>{svg_chat}</div>}
|
||||
</div>
|
||||
<div .right-panel style={right_style}>
|
||||
@@ -453,6 +453,21 @@ function getElaspsed(time, now) {
|
||||
return out;
|
||||
}
|
||||
|
||||
var ui_status_cache = [""];
|
||||
function check_update_ui() {
|
||||
self.timer(1s, function() {
|
||||
var approve_mode = handler.get_option('approve-mode');
|
||||
var changed = false;
|
||||
if (ui_status_cache[0] != approve_mode) {
|
||||
ui_status_cache[0] = approve_mode;
|
||||
changed = true;
|
||||
}
|
||||
if (changed) update();
|
||||
check_update_ui();
|
||||
});
|
||||
}
|
||||
check_update_ui();
|
||||
|
||||
function updateTime() {
|
||||
self.timer(1s, function() {
|
||||
var now = new Date();
|
||||
|
||||
@@ -264,6 +264,13 @@ 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(); }
|
||||
} else if (type == 'wait-remote-accept-nook') {
|
||||
callback = function (res) {
|
||||
if (!res) {
|
||||
view.close();
|
||||
return;
|
||||
}
|
||||
};
|
||||
}
|
||||
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} />);
|
||||
|
||||
@@ -824,7 +824,8 @@ function watch_screen_recording() {
|
||||
class PasswordEyeArea : Reactor.Component {
|
||||
render() {
|
||||
var method = handler.get_option('verification-method');
|
||||
var value = method != 'use-permanent-password' ? password_cache[0] : "-";
|
||||
var mode= handler.get_option('approve-mode');
|
||||
var value = mode == 'click' || method == 'use-permanent-password' ? "-" : password_cache[0];
|
||||
return
|
||||
<div .eye-area style="width: *">
|
||||
<input|text @{this.input} readonly value={value} />
|
||||
@@ -901,27 +902,46 @@ class PasswordArea: Reactor.Component {
|
||||
|
||||
function renderPop() {
|
||||
var method = handler.get_option('verification-method');
|
||||
var approve_mode= handler.get_option('approve-mode');
|
||||
var show_password = approve_mode != 'click';
|
||||
return <popup><menu.context #edit-password-context>
|
||||
<li #use-temporary-password><span>{svg_checkmark}</span>{translate('Use temporary password')}</li>
|
||||
<li #use-permanent-password><span>{svg_checkmark}</span>{translate('Use permanent password')}</li>
|
||||
<li #use-both-passwords><span>{svg_checkmark}</span>{translate('Use both passwords')}</li>
|
||||
<div .separator />
|
||||
<li #set-password disabled={ method == 'use-temporary-password' ? "true" : "false" }>{translate('Set permanent password')}</li>
|
||||
<TemporaryPasswordLengthMenu />
|
||||
<li #approve-mode-password><span>{svg_checkmark}</span>{translate('Accept sessions via password')}</li>
|
||||
<li #approve-mode-click><span>{svg_checkmark}</span>{translate('Accept sessions via click')}</li>
|
||||
<li #approve-mode-both><span>{svg_checkmark}</span>{translate('Accept sessions via both')}</li>
|
||||
{ !show_password ? '' : <div .separator /> }
|
||||
{ !show_password ? '' : <li #use-temporary-password><span>{svg_checkmark}</span>{translate('Use temporary password')}</li> }
|
||||
{ !show_password ? '' : <li #use-permanent-password><span>{svg_checkmark}</span>{translate('Use permanent password')}</li> }
|
||||
{ !show_password ? '' : <li #use-both-passwords><span>{svg_checkmark}</span>{translate('Use both passwords')}</li> }
|
||||
{ !show_password ? '' : <div .separator /> }
|
||||
{ !show_password ? '' : <li #set-password disabled={ method == 'use-temporary-password' ? "true" : "false" }>{translate('Set permanent password')}</li> }
|
||||
{ !show_password ? '' : <TemporaryPasswordLengthMenu /> }
|
||||
</menu></popup>;
|
||||
}
|
||||
|
||||
function toggleMenuState() {
|
||||
var id = handler.get_option('verification-method');
|
||||
if (id != 'use-temporary-password' && id != 'use-permanent-password')
|
||||
id = 'use-both-passwords';
|
||||
for (var el in [this.$(li#use-temporary-password), this.$(li#use-permanent-password), this.$(li#use-both-passwords)]) {
|
||||
el.attributes.toggleClass("selected", el.id == id);
|
||||
var mode= handler.get_option('approve-mode');
|
||||
var mode_id;
|
||||
if (mode == 'password')
|
||||
mode_id = 'approve-mode-password';
|
||||
else if (mode == 'click')
|
||||
mode_id = 'approve-mode-click';
|
||||
else
|
||||
mode_id = 'approve-mode-both';
|
||||
var pwd_id = handler.get_option('verification-method');
|
||||
if (pwd_id != 'use-temporary-password' && pwd_id != 'use-permanent-password')
|
||||
pwd_id = 'use-both-passwords';
|
||||
for (var el in this.$$(menu#edit-password-context>li)) {
|
||||
if (el.id.indexOf("approve-mode-") == 0)
|
||||
el.attributes.toggleClass("selected", el.id == mode_id);
|
||||
if (el.id.indexOf("use-") == 0)
|
||||
el.attributes.toggleClass("selected", el.id == pwd_id);
|
||||
}
|
||||
}
|
||||
|
||||
event click $(svg#edit) (_, me) {
|
||||
temporaryPasswordLengthMenu.update({show: true });
|
||||
var approve_mode= handler.get_option('approve-mode');
|
||||
var show_password = approve_mode != 'click';
|
||||
if(show_password && temporaryPasswordLengthMenu) temporaryPasswordLengthMenu.update({show: true });
|
||||
var menu = $(menu#edit-password-context);
|
||||
me.popup(menu);
|
||||
}
|
||||
@@ -954,16 +974,28 @@ class PasswordArea: Reactor.Component {
|
||||
handler.set_option('verification-method', me.id);
|
||||
this.toggleMenuState();
|
||||
passwordArea.update();
|
||||
} else if (me.id.indexOf('approve-mode') == 0) {
|
||||
var approve_mode;
|
||||
if (me.id == 'approve-mode-password')
|
||||
approve_mode = 'password';
|
||||
else if (me.id == 'approve-mode-click')
|
||||
approve_mode = 'click';
|
||||
else
|
||||
approve_mode = '';
|
||||
handler.set_option('approve-mode', approve_mode);
|
||||
this.toggleMenuState();
|
||||
passwordArea.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var password_cache = ["","",""];
|
||||
var password_cache = ["","","",""];
|
||||
function updatePasswordArea() {
|
||||
self.timer(1s, function() {
|
||||
var temporary_password = handler.temporary_password();
|
||||
var verification_method = handler.get_option('verification-method');
|
||||
var temporary_password_length = handler.get_option('temporary-password-length');
|
||||
var approve_mode = handler.get_option('approve-mode');
|
||||
var update = false;
|
||||
if (password_cache[0] != temporary_password) {
|
||||
password_cache[0] = temporary_password;
|
||||
@@ -977,6 +1009,10 @@ function updatePasswordArea() {
|
||||
password_cache[2] = temporary_password_length;
|
||||
update = true;
|
||||
}
|
||||
if (password_cache[3] != approve_mode) {
|
||||
password_cache[3] = approve_mode;
|
||||
update = true;
|
||||
}
|
||||
if (update) passwordArea.update();
|
||||
updatePasswordArea();
|
||||
});
|
||||
|
||||
@@ -874,7 +874,12 @@ pub fn check_zombie(children: Children) {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn check_connect_status(reconnect: bool) -> mpsc::UnboundedSender<ipc::Data> {
|
||||
pub fn start_option_status_sync() {
|
||||
let _sender = SENDER.lock().unwrap();
|
||||
}
|
||||
|
||||
// not call directly
|
||||
fn check_connect_status(reconnect: bool) -> mpsc::UnboundedSender<ipc::Data> {
|
||||
let (tx, rx) = mpsc::unbounded_channel::<ipc::Data>();
|
||||
std::thread::spawn(move || check_connect_status_(reconnect, rx));
|
||||
tx
|
||||
@@ -898,7 +903,7 @@ pub fn account_auth_result() -> String {
|
||||
// notice: avoiding create ipc connecton repeatly,
|
||||
// because windows named pipe has serious memory leak issue.
|
||||
#[tokio::main(flavor = "current_thread")]
|
||||
pub(crate) async fn check_connect_status_(reconnect: bool, rx: mpsc::UnboundedReceiver<ipc::Data>) {
|
||||
async fn check_connect_status_(reconnect: bool, rx: mpsc::UnboundedReceiver<ipc::Data>) {
|
||||
let mut key_confirmed = false;
|
||||
let mut rx = rx;
|
||||
let mut mouse_time = 0;
|
||||
|
||||
Reference in New Issue
Block a user