mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
@@ -1224,26 +1224,6 @@ impl Connection {
|
||||
}
|
||||
}
|
||||
|
||||
/// Parse [`FileDirectory`] to json.
|
||||
pub fn make_fd_to_json(fd: FileDirectory) -> String {
|
||||
use serde_json::json;
|
||||
let mut fd_json = serde_json::Map::new();
|
||||
fd_json.insert("id".into(), json!(fd.id));
|
||||
fd_json.insert("path".into(), json!(fd.path));
|
||||
|
||||
let mut entries = vec![];
|
||||
for entry in fd.entries {
|
||||
let mut entry_map = serde_json::Map::new();
|
||||
entry_map.insert("entry_type".into(), json!(entry.entry_type.value()));
|
||||
entry_map.insert("name".into(), json!(entry.name));
|
||||
entry_map.insert("size".into(), json!(entry.size));
|
||||
entry_map.insert("modified_time".into(), json!(entry.modified_time));
|
||||
entries.push(entry_map);
|
||||
}
|
||||
fd_json.insert("entries".into(), json!(entries));
|
||||
serde_json::to_string(&fd_json).unwrap_or("".into())
|
||||
}
|
||||
|
||||
// Server Side
|
||||
// TODO connection_manager need use struct and trait,impl default method
|
||||
#[cfg(not(any(target_os = "ios")))]
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use crate::client::file_trait::FileManager;
|
||||
use crate::flutter::connection_manager::{self, get_clients_length, get_clients_state};
|
||||
use crate::flutter::{self, make_fd_to_json, Session, SESSIONS};
|
||||
use crate::flutter::{self, Session, SESSIONS};
|
||||
use crate::common::make_fd_to_json;
|
||||
use crate::start_server;
|
||||
use crate::ui_interface;
|
||||
use flutter_rust_bridge::{StreamSink, SyncReturn, ZeroCopyBuffer};
|
||||
|
||||
@@ -195,7 +195,7 @@ fn main() {
|
||||
.about("RustDesk command line tool")
|
||||
.args_from_usage(&args)
|
||||
.get_matches();
|
||||
use hbb_common::env_logger::*;
|
||||
use hbb_common::{env_logger::*, config::LocalConfig};
|
||||
init_from_env(Env::default().filter_or(DEFAULT_FILTER_ENV, "info"));
|
||||
if let Some(p) = matches.value_of("port-forward") {
|
||||
let options: Vec<String> = p.split(":").map(|x| x.to_owned()).collect();
|
||||
@@ -222,6 +222,7 @@ fn main() {
|
||||
remote_host = options[3].clone();
|
||||
}
|
||||
let key = matches.value_of("key").unwrap_or("").to_owned();
|
||||
cli::start_one_port_forward(options[0].clone(), port, remote_host, remote_port, key);
|
||||
let token = LocalConfig::get_option("access_token");
|
||||
cli::start_one_port_forward(options[0].clone(), port, remote_host, remote_port, key, token);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ impl UI {
|
||||
}
|
||||
|
||||
fn install_me(&mut self, _options: String, _path: String) {
|
||||
install_me(_options, _path);
|
||||
install_me(_options, _path, false, false);
|
||||
}
|
||||
|
||||
fn update_me(&self, _path: String) {
|
||||
|
||||
@@ -69,10 +69,10 @@ pub fn goto_install() {
|
||||
allow_err!(crate::run_me(vec!["--install"]));
|
||||
}
|
||||
|
||||
pub fn install_me(_options: String, _path: String) {
|
||||
pub fn install_me(_options: String, _path: String, silent: bool, debug: bool) {
|
||||
#[cfg(windows)]
|
||||
std::thread::spawn(move || {
|
||||
allow_err!(crate::platform::windows::install_me(&_options, _path));
|
||||
allow_err!(crate::platform::windows::install_me(&_options, _path, silent, debug));
|
||||
std::process::exit(0);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user