refactor
This commit is contained in:
parent
6fe4344cb0
commit
d069b73303
@ -15,6 +15,7 @@ use std::{
|
|||||||
pub const APP_NAME: &str = "RustDesk";
|
pub const APP_NAME: &str = "RustDesk";
|
||||||
pub const RENDEZVOUS_TIMEOUT: u64 = 12_000;
|
pub const RENDEZVOUS_TIMEOUT: u64 = 12_000;
|
||||||
pub const CONNECT_TIMEOUT: u64 = 18_000;
|
pub const CONNECT_TIMEOUT: u64 = 18_000;
|
||||||
|
pub const REG_INTERVAL: i64 = 12_000;
|
||||||
pub const COMPRESS_LEVEL: i32 = 3;
|
pub const COMPRESS_LEVEL: i32 = 3;
|
||||||
const SERIAL: i32 = 1;
|
const SERIAL: i32 = 1;
|
||||||
// 128x128
|
// 128x128
|
||||||
|
@ -941,7 +941,7 @@ impl LoginConfigHandler {
|
|||||||
if !pi.version.is_empty() {
|
if !pi.version.is_empty() {
|
||||||
self.support_press = true;
|
self.support_press = true;
|
||||||
self.support_refresh = true;
|
self.support_refresh = true;
|
||||||
self.version = crate::get_version_number(&pi.version);
|
self.version = hbb_common::get_version_number(&pi.version);
|
||||||
}
|
}
|
||||||
let serde = PeerInfoSerde {
|
let serde = PeerInfoSerde {
|
||||||
username,
|
username,
|
||||||
|
@ -4,7 +4,7 @@ use hbb_common::{
|
|||||||
anyhow::bail,
|
anyhow::bail,
|
||||||
compress::{compress as compress_func, decompress},
|
compress::{compress as compress_func, decompress},
|
||||||
config::{Config, COMPRESS_LEVEL, RENDEZVOUS_TIMEOUT},
|
config::{Config, COMPRESS_LEVEL, RENDEZVOUS_TIMEOUT},
|
||||||
log,
|
get_version_number, log,
|
||||||
message_proto::*,
|
message_proto::*,
|
||||||
protobuf::Message as _,
|
protobuf::Message as _,
|
||||||
protobuf::ProtobufEnum,
|
protobuf::ProtobufEnum,
|
||||||
@ -413,14 +413,6 @@ pub fn is_modifier(evt: &KeyEvent) -> bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_version_number(v: &str) -> i64 {
|
|
||||||
let mut n = 0;
|
|
||||||
for x in v.split(".") {
|
|
||||||
n = n * 1000 + x.parse::<i64>().unwrap_or(0);
|
|
||||||
}
|
|
||||||
n
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn check_software_update() {
|
pub fn check_software_update() {
|
||||||
std::thread::spawn(move || allow_err!(_check_software_update()));
|
std::thread::spawn(move || allow_err!(_check_software_update()));
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ use crate::server::{check_zombie, new as new_server, ServerPtr};
|
|||||||
use hbb_common::{
|
use hbb_common::{
|
||||||
allow_err,
|
allow_err,
|
||||||
anyhow::bail,
|
anyhow::bail,
|
||||||
config::{self, Config, RENDEZVOUS_PORT, RENDEZVOUS_TIMEOUT},
|
config::{self, Config, REG_INTERVAL, RENDEZVOUS_PORT, RENDEZVOUS_TIMEOUT},
|
||||||
futures::future::join_all,
|
futures::future::join_all,
|
||||||
log,
|
log,
|
||||||
protobuf::Message as _,
|
protobuf::Message as _,
|
||||||
@ -31,7 +31,6 @@ lazy_static::lazy_static! {
|
|||||||
static ref SOLVING_PK_MISMATCH: Arc<Mutex<String>> = Default::default();
|
static ref SOLVING_PK_MISMATCH: Arc<Mutex<String>> = Default::default();
|
||||||
}
|
}
|
||||||
static SHOULD_EXIT: AtomicBool = AtomicBool::new(false);
|
static SHOULD_EXIT: AtomicBool = AtomicBool::new(false);
|
||||||
const REG_INTERVAL: i64 = 12_000;
|
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct RendezvousMediator {
|
pub struct RendezvousMediator {
|
||||||
|
@ -23,7 +23,6 @@ use service::{GenericService, Service, ServiceTmpl, Subscriber};
|
|||||||
use std::{
|
use std::{
|
||||||
collections::HashMap,
|
collections::HashMap,
|
||||||
net::SocketAddr,
|
net::SocketAddr,
|
||||||
path::PathBuf,
|
|
||||||
sync::{Arc, Mutex, RwLock, Weak},
|
sync::{Arc, Mutex, RwLock, Weak},
|
||||||
time::Duration,
|
time::Duration,
|
||||||
};
|
};
|
||||||
|
@ -904,10 +904,12 @@ async fn start_ipc(
|
|||||||
mut rx_to_cm: mpsc::UnboundedReceiver<ipc::Data>,
|
mut rx_to_cm: mpsc::UnboundedReceiver<ipc::Data>,
|
||||||
tx_from_cm: mpsc::UnboundedSender<ipc::Data>,
|
tx_from_cm: mpsc::UnboundedSender<ipc::Data>,
|
||||||
) -> ResultType<()> {
|
) -> ResultType<()> {
|
||||||
if crate::platform::is_prelogin() {
|
loop {
|
||||||
return Ok(());
|
if !crate::platform::is_prelogin() {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
sleep(1.).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut stream = None;
|
let mut stream = None;
|
||||||
if let Ok(s) = crate::ipc::connect(1000, "_cm").await {
|
if let Ok(s) = crate::ipc::connect(1000, "_cm").await {
|
||||||
stream = Some(s);
|
stream = Some(s);
|
||||||
|
@ -287,7 +287,7 @@ class MultipleSessions: Reactor.Component {
|
|||||||
function onSize() {
|
function onSize() {
|
||||||
var w = this.$(.sessions-bar).box(#width) - 220;
|
var w = this.$(.sessions-bar).box(#width) - 220;
|
||||||
this.$(#sessions-type span).style.set{
|
this.$(#sessions-type span).style.set{
|
||||||
"max-width": (w / 2) + "px",
|
"max-width": (w / (handler.is_installed() ? 2 : 3)) + "px",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -233,7 +233,7 @@ class Header: Reactor.Component {
|
|||||||
event click $(#ctrl-alt-del) {
|
event click $(#ctrl-alt-del) {
|
||||||
handler.ctrl_alt_del();
|
handler.ctrl_alt_del();
|
||||||
}
|
}
|
||||||
|
|
||||||
event click $(#lock-screen) {
|
event click $(#lock-screen) {
|
||||||
handler.lock_screen();
|
handler.lock_screen();
|
||||||
}
|
}
|
||||||
|
@ -361,3 +361,21 @@ div#myid svg#menu {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
right: -1em;
|
right: -1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.remote-session svg#menu {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.install-me .button {
|
||||||
|
height: 2em;
|
||||||
|
line-height: 2em;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 1.6em;
|
||||||
|
margin-top: 1em;
|
||||||
|
border-color: white;
|
||||||
|
border: 1px;
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user