mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-27 14:59:02 +08:00
Merge pull request #5353 from dignow/refact/remove_login_device_info_in_sciter
refactor, remove login device info in sciter
This commit is contained in:
commit
53218409d7
@ -595,8 +595,8 @@ impl UI {
|
|||||||
handle_relay_id(id)
|
handle_relay_id(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_hostname(&self) -> String {
|
fn get_login_device_info(&self) -> String {
|
||||||
get_hostname()
|
get_login_device_info_json()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -682,7 +682,7 @@ impl sciter::EventHandler for UI {
|
|||||||
fn get_langs();
|
fn get_langs();
|
||||||
fn default_video_save_directory();
|
fn default_video_save_directory();
|
||||||
fn handle_relay_id(String);
|
fn handle_relay_id(String);
|
||||||
fn get_hostname();
|
fn get_login_device_info();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1323,18 +1323,5 @@ function getHttpHeaders() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getDeviceInfo() {
|
function getDeviceInfo() {
|
||||||
var os;
|
return JSON.parse(handler.get_login_device_info());
|
||||||
if (is_win) {
|
|
||||||
os = 'windows';
|
|
||||||
} else if (is_linux) {
|
|
||||||
os = 'linux';
|
|
||||||
} else if (is_osx) {
|
|
||||||
os = 'macos';
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
os: os,
|
|
||||||
type: 'client',
|
|
||||||
name: handler.get_hostname()
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
@ -974,10 +974,6 @@ pub fn get_fingerprint() -> String {
|
|||||||
return ipc::get_fingerprint();
|
return ipc::get_fingerprint();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_hostname() -> String {
|
|
||||||
crate::common::hostname()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn get_login_device_info() -> LoginDeviceInfo {
|
pub fn get_login_device_info() -> LoginDeviceInfo {
|
||||||
LoginDeviceInfo {
|
LoginDeviceInfo {
|
||||||
@ -990,7 +986,7 @@ pub fn get_login_device_info() -> LoginDeviceInfo {
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn get_login_device_info_json() -> String {
|
pub fn get_login_device_info_json() -> String {
|
||||||
serde_json::to_string(&get_login_device_info()).unwrap_or_default()
|
serde_json::to_string(&get_login_device_info()).unwrap_or("{}".to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
// notice: avoiding create ipc connection repeatedly,
|
// notice: avoiding create ipc connection repeatedly,
|
||||||
|
Loading…
Reference in New Issue
Block a user