Merge branch 'rustdesk:master' into master

This commit is contained in:
Sahil Yeole
2023-08-09 17:52:10 +05:30
committed by GitHub
84 changed files with 470 additions and 331 deletions

View File

@@ -1209,6 +1209,10 @@ impl LoginConfigHandler {
/// * `k` - key of option
/// * `v` - value of option
pub fn save_ui_flutter(&mut self, k: String, v: String) {
if self.version == 0 && k == "wm_" {
log::info!("skip saving {k}");
return;
}
let mut config = self.load_config();
config.ui_flutter.insert(k, v);
self.save_config(config);

View File

@@ -850,6 +850,11 @@ impl<T: InvokeUiSession> Remote<T> {
}
pub async fn sync_jobs_status_to_local(&mut self) -> bool {
let peer_version = self.handler.lc.read().unwrap().version;
if peer_version == 0 {
log::info!("skip saving job status");
return false;
}
log::info!("sync transfer job status");
let mut config: PeerConfig = self.handler.load_config();
let mut transfer_metas = TransferSerde::default();

View File

@@ -345,6 +345,14 @@ impl FlutterHandler {
*self.notify_rendered.write().unwrap() = false;
self.renderer.write().unwrap().set_size(width, height);
}
pub fn on_waiting_for_image_dialog_show(&self) {
#[cfg(any(feature = "flutter_texture_render"))]
{
*self.notify_rendered.write().unwrap() = false;
}
// rgba array render will notify every frame
}
}
impl InvokeUiSession for FlutterHandler {

View File

@@ -174,6 +174,12 @@ pub fn session_record_screen(session_id: SessionID, start: bool, width: usize, h
}
}
pub fn session_record_status(session_id: SessionID, status: bool) {
if let Some(session) = SESSIONS.read().unwrap().get(&session_id) {
session.record_status(status);
}
}
pub fn session_reconnect(session_id: SessionID, force_relay: bool) {
if let Some(session) = SESSIONS.read().unwrap().get(&session_id) {
session.reconnect(force_relay);
@@ -800,6 +806,12 @@ pub fn main_get_peer_option_sync(id: String, key: String) -> SyncReturn<String>
SyncReturn(get_peer_option(id, key))
}
// Sometimes we need to get the flutter config of a peer by reading the file.
// Because the session may not be established yet.
pub fn main_get_peer_flutter_config_sync(id: String, k: String) -> SyncReturn<String> {
SyncReturn(get_peer_flutter_config(id, k))
}
pub fn main_set_peer_option(id: String, key: String, value: String) {
set_peer_option(id, key, value)
}
@@ -1254,6 +1266,12 @@ pub fn session_change_prefer_codec(session_id: SessionID) {
}
}
pub fn session_on_waiting_for_image_dialog_show(session_id: SessionID) {
if let Some(session) = SESSIONS.read().unwrap().get(&session_id) {
session.ui_handler.on_waiting_for_image_dialog_show();
}
}
pub fn main_set_home_dir(_home: String) {
#[cfg(any(target_os = "android", target_os = "ios"))]
{

View File

@@ -1,8 +1,5 @@
use super::HbbHttpResponse;
use hbb_common::{
config::{Config, LocalConfig},
log, ResultType,
};
use hbb_common::{config::LocalConfig, log, ResultType};
use reqwest::blocking::Client;
use serde_derive::{Deserialize, Serialize};
use serde_repr::{Deserialize_repr, Serialize_repr};
@@ -14,8 +11,6 @@ use std::{
use url::Url;
lazy_static::lazy_static! {
static ref API_SERVER: String = crate::get_api_server(
Config::get_option("api-server"), Config::get_option("custom-rendezvous-server"));
static ref OIDC_SESSION: Arc<RwLock<OidcSession>> = Arc::new(RwLock::new(OidcSession::new()));
}
@@ -142,20 +137,30 @@ impl OidcSession {
}
}
fn auth(op: &str, id: &str, uuid: &str) -> ResultType<HbbHttpResponse<OidcAuthUrl>> {
fn auth(
api_server: &str,
op: &str,
id: &str,
uuid: &str,
) -> ResultType<HbbHttpResponse<OidcAuthUrl>> {
Ok(OIDC_SESSION
.read()
.unwrap()
.client
.post(format!("{}/api/oidc/auth", *API_SERVER))
.post(format!("{}/api/oidc/auth", api_server))
.json(&HashMap::from([("op", op), ("id", id), ("uuid", uuid)]))
.send()?
.try_into()?)
}
fn query(code: &str, id: &str, uuid: &str) -> ResultType<HbbHttpResponse<AuthBody>> {
fn query(
api_server: &str,
code: &str,
id: &str,
uuid: &str,
) -> ResultType<HbbHttpResponse<AuthBody>> {
let url = reqwest::Url::parse_with_params(
&format!("{}/api/oidc/auth-query", *API_SERVER),
&format!("{}/api/oidc/auth-query", api_server),
&[("code", code), ("id", id), ("uuid", uuid)],
)?;
Ok(OIDC_SESSION
@@ -189,8 +194,8 @@ impl OidcSession {
std::thread::sleep(std::time::Duration::from_secs_f32(secs));
}
fn auth_task(op: String, id: String, uuid: String, remember_me: bool) {
let auth_request_res = Self::auth(&op, &id, &uuid);
fn auth_task(api_server: String, op: String, id: String, uuid: String, remember_me: bool) {
let auth_request_res = Self::auth(&api_server, &op, &id, &uuid);
log::info!("Request oidc auth result: {:?}", &auth_request_res);
let code_url = match auth_request_res {
Ok(HbbHttpResponse::<_>::Data(code_url)) => code_url,
@@ -226,7 +231,7 @@ impl OidcSession {
let begin = Instant::now();
let query_timeout = OIDC_SESSION.read().unwrap().query_timeout;
while OIDC_SESSION.read().unwrap().keep_querying && begin.elapsed() < query_timeout {
match Self::query(&code_url.code, &id, &uuid) {
match Self::query(&api_server, &code_url.code, &id, &uuid) {
Ok(HbbHttpResponse::<_>::Data(auth_body)) => {
if remember_me {
LocalConfig::set_option(
@@ -289,12 +294,18 @@ impl OidcSession {
}
}
pub fn account_auth(op: String, id: String, uuid: String, remember_me: bool) {
pub fn account_auth(
api_server: String,
op: String,
id: String,
uuid: String,
remember_me: bool,
) {
Self::auth_cancel();
Self::wait_stop_querying();
OIDC_SESSION.write().unwrap().before_task();
std::thread::spawn(move || {
Self::auth_task(op, id, uuid, remember_me);
Self::auth_task(api_server, op, id, uuid, remember_me);
OIDC_SESSION.write().unwrap().after_task();
});
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""),
("Set one-time password length", ""),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", ""),
("Sort by", ""),
("New Connection", ""),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "无进行中的传输"),
("Set one-time password length", "设置一次性密码长度"),
("install_cert_tip", "安装 RustDesk 证书"),
("comfirm_install_cert_tip", "此证书为 RustDesk 测试证书,您可以信任此证书。证书将被用于信任和安装 RustDesk 驱动。"),
("confirm_install_cert_tip", "此证书为 RustDesk 测试证书,您可以信任此证书。证书将被用于信任和安装 RustDesk 驱动。"),
("RDP Settings", "RDP 设置"),
("Sort by", "排序方式"),
("New Connection", "新连接"),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", "管理的设备数已达到最大值"),
("Sync with recent sessions", "同步最近会话"),
("Sort tags", "对标签进行排序"),
("Separate remote windows", "使用独立远程窗口"),
("separate window", "独立窗口"),
("Open connection in new tab", "在选项卡中打开新连接"),
("Move tab to new window", "将标签页移至新窗口"),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""),
("Set one-time password length", ""),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", ""),
("Sort by", ""),
("New Connection", ""),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "Ingen overførsler i gang"),
("Set one-time password length", "Sæt engangsadgangskode længde"),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", "RDP indstillinger"),
("Sort by", "Sortér efter"),
("New Connection", "Ny forbindelse"),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "Keine Übertragungen im Gange"),
("Set one-time password length", "Länge des Einmalpassworts festlegen"),
("install_cert_tip", "RustDesk-Zertifikat installieren"),
("comfirm_install_cert_tip", "Dies ist ein RustDesk-Testzertifikat, dem vertraut werden kann. Das Zertifikat wird verwendet, um RustDesk-Treibern bei Bedarf zu vertrauen und diese zu installieren."),
("confirm_install_cert_tip", "Dies ist ein RustDesk-Testzertifikat, dem vertraut werden kann. Das Zertifikat wird verwendet, um RustDesk-Treibern bei Bedarf zu vertrauen und diese zu installieren."),
("RDP Settings", "RDP-Einstellungen"),
("Sort by", "Sortieren nach"),
("New Connection", "Neue Verbindung"),
@@ -506,7 +506,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable", "Aktivieren"),
("Disable", "Deaktivieren"),
("Options", "Einstellungen"),
("resolution_original_tip", "Originalauflösung"),
("resolution_original_tip", "Originale Auflösung"),
("resolution_fit_local_tip", "Lokale Auflösung anpassen"),
("resolution_custom_tip", "Benutzerdefinierte Auflösung"),
("Collapse toolbar", "Symbolleiste einklappen"),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", "Sie haben die maximale Anzahl der verwalteten Geräte erreicht."),
("Sync with recent sessions", "Synchronisierung mit den letzten Sitzungen"),
("Sort tags", "Tags sortieren"),
("Separate remote windows", "Separate entfernte Fenster"),
("separate window", "Separates Fenster"),
("Open connection in new tab", "Verbindung in neuem Tab öffnen"),
("Move tab to new window", "Tab in neues Fenster verschieben"),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "Δεν υπάρχει μεταφορά σε εξέλιξη"),
("Set one-time password length", "Μέγεθος κωδικού μιας χρήσης"),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", "Ρυθμίσεις RDP"),
("Sort by", "Ταξινόμηση κατά"),
("New Connection", "Νέα σύνδεση"),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -12,6 +12,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("not_close_tcp_tip", "Don't close this window while you are using the tunnel"),
("setup_server_tip", "For faster connection, please set up your own server"),
("Auto Login", "Auto Login (Only valid if you set \"Lock after session end\")"),
("Always connect via relay", "Always Connect via Relay"),
("whitelist_tip", "Only whitelisted IP can access me"),
("whitelist_sep", "Separated by comma, semicolon, spaces or new line"),
("Wrong credentials", "Wrong username or password"),
@@ -47,7 +48,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("relay_hint_tip", "It may not be possible to connect directly; you can try connecting via relay. Additionally, if you want to use a relay on your first attempt, you can add the \"/r\" suffix to the ID or select the option \"Always connect via relay\" in the card of recent sessions if it exists."),
("No transfers in progress", ""),
("install_cert_tip", "Install RustDesk certificate"),
("comfirm_install_cert_tip", "This is a RustDesk testing certificate, which can be trusted. The certificate will be used to trust and install RustDesk drivers when required."),
("confirm_install_cert_tip", "This is a RustDesk testing certificate, which can be trusted. The certificate will be used to trust and install RustDesk drivers when required."),
("empty_recent_tip", "Oops, no recent sessions!\nTime to plan a new one."),
("empty_favorite_tip", "No favorite peers yet?\nLet's find someone to connect with and add it to your favorites!"),
("empty_lan_tip", "Oh no, it looks like we haven't discovered any peers yet."),

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""),
("Set one-time password length", ""),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", ""),
("Sort by", ""),
("New Connection", ""),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "No hay transferencias en curso"),
("Set one-time password length", "Establecer contraseña de un solo uso"),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", "Ajustes RDP"),
("Sort by", "Ordenar por"),
("New Connection", "Nueva conexión"),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", "Has alcanzado el máximo número de dispositivos administrados."),
("Sync with recent sessions", "Sincronizar con sesiones recientes"),
("Sort tags", "Ordenar etiquetas"),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "هیچ انتقالی در حال انجام نیست"),
("Set one-time password length", "طول رمز یکبار مصرف را تعیین کنید"),
("install_cert_tip", "RustDesk نصب گواهی"),
("comfirm_install_cert_tip", "استفاده خواهد شد RustDesk است و شما می توانید به این گواهی اعتماد کنید. این گواهی برای اعتماد و نصب درایورهای RustDesk این گواهینامه یک گواهی تست"),
("confirm_install_cert_tip", "استفاده خواهد شد RustDesk است و شما می توانید به این گواهی اعتماد کنید. این گواهی برای اعتماد و نصب درایورهای RustDesk این گواهینامه یک گواهی تست"),
("RDP Settings", "RDP تنظیمات"),
("Sort by", "مرتب سازی بر اساس"),
("New Connection", "اتصال جدید"),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "Pas de transfert en cours"),
("Set one-time password length", "Définir la longueur du mot de passe à usage unique"),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", "Configuration RDP"),
("Sort by", "Trier par"),
("New Connection", "Nouvelle connexion"),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""),
("Set one-time password length", ""),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", ""),
("Sort by", ""),
("New Connection", ""),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""),
("Set one-time password length", ""),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", ""),
("Sort by", ""),
("New Connection", ""),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "Nessun trasferimento in corso"),
("Set one-time password length", "Imposta lunghezza password monouso"),
("install_cert_tip", "Installa certificato RustDesk"),
("comfirm_install_cert_tip", "Questo è un certificato di test RustDesk, che può essere considerato attendibile.\nIl certificato verrà usato per certificarsi ed installare i driver RustDesk quando richiesto."),
("confirm_install_cert_tip", "Questo è un certificato di test RustDesk, che può essere considerato attendibile.\nIl certificato verrà usato per certificarsi ed installare i driver RustDesk quando richiesto."),
("RDP Settings", "Impostazioni RDP"),
("Sort by", "Ordina per"),
("New Connection", "Nuova connessione"),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", "Hai raggiunto il numero massimo di dispositivi gestibili."),
("Sync with recent sessions", "Sincronizza con le sessioni recenti"),
("Sort tags", "Ordina etichette"),
("Separate remote windows", "Separa finestre remote"),
("separate window", "Separa finestra"),
("Open connection in new tab", "Apri connessione in una nuova scheda"),
("Move tab to new window", "Sposta scheda nella finestra successiva"),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""),
("Set one-time password length", ""),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", ""),
("Sort by", ""),
("New Connection", ""),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""),
("Set one-time password length", ""),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", ""),
("Sort by", ""),
("New Connection", ""),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""),
("Set one-time password length", ""),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", ""),
("Sort by", ""),
("New Connection", ""),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "Nevyksta jokių perdavimų"),
("Set one-time password length", "Nustatyti vienkartinio slaptažodžio ilgį"),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", "RDP nustatymai"),
("Sort by", "Rūšiuoti pagal"),
("New Connection", "Naujas ryšys"),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "Geen overdrachten in uitvoering"),
("Set one-time password length", "Stel de lengte van het eenmalige wachtwoord in"),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", "RDP Instellingen"),
("Sort by", "Sorteren op"),
("New Connection", "Nieuwe Verbinding"),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", "Het maximum aantal gecontroleerde apparaten is bereikt."),
("Sync with recent sessions", "Recente sessies synchroniseren"),
("Sort tags", "Labels sorteren"),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "Brak transferów w toku"),
("Set one-time password length", "Ustaw długość jednorazowego hasła"),
("install_cert_tip", "Instalacja certyfikatu RustDesk"),
("comfirm_install_cert_tip", "To jest certyfikat testowy RustDesk, któremu można zaufać. Certyfikat jest używany do zaufania i instalowania sterowników RustDesk w razie potrzeby."),
("confirm_install_cert_tip", "To jest certyfikat testowy RustDesk, któremu można zaufać. Certyfikat jest używany do zaufania i instalowania sterowników RustDesk w razie potrzeby."),
("RDP Settings", "Ustawienia RDP"),
("Sort by", "Sortuj wg"),
("New Connection", "Nowe połączenie"),
@@ -518,14 +518,13 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Exit", "Wyjście"),
("Open", "Otwórz"),
("logout_tip", "Na pewno chcesz się wylogować?"),
("Service", ""),
("Start", ""),
("Stop", ""),
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Move tab to new window", ""),
("Service", "Usługa"),
("Start", "Uruchom"),
("Stop", "Zatrzymaj"),
("exceed_max_devices", "Przekroczona maks. liczba urządzeń"),
("Sync with recent sessions", "Synchronizacja z ostatnimi sesjami"),
("Sort tags", "Znaczniki sortowania"),
("Open connection in new tab", ""),
("Move tab to new window", "Przenieś zakładkę do nowego okna"),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""),
("Set one-time password length", ""),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", ""),
("Sort by", ""),
("New Connection", ""),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "Nenhuma transferência em andamento"),
("Set one-time password length", "Definir comprimento de senha descartável"),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", "Configurações RDP"),
("Sort by", "Ordenar por"),
("New Connection", "Nova Conexão"),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "Niciun transfer nu este în desfășurare"),
("Set one-time password length", "Definește lungimea parolei unice"),
("install_cert_tip", "Instalează certificatul RustDesk"),
("comfirm_install_cert_tip", "Acesta este un certificat de testare RustDesk și este de încredere. Certificatul va fi utilizat pentru a acorda încredere și instala drivere RustDesk atunci când este necesar."),
("confirm_install_cert_tip", "Acesta este un certificat de testare RustDesk și este de încredere. Certificatul va fi utilizat pentru a acorda încredere și instala drivere RustDesk atunci când este necesar."),
("RDP Settings", "Setări RDP"),
("Sort by", "Sortează după"),
("New Connection", "Conexiune nouă"),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -299,7 +299,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Help", "Помощь"),
("Failed", "Не выполнено"),
("Succeeded", "Выполнено"),
("Someone turns on privacy mode, exit", "Кто-то включает режим конфиденциальности, выход"),
("Someone turns on privacy mode, exit", "Кто-то включил режим конфиденциальности, выход"),
("Unsupported", "Не поддерживается"),
("Peer denied", "Отклонено удалённым узлом"),
("Please install plugins", "Установите плагины"),
@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "Передача не осуществляется"),
("Set one-time password length", "Установить длину одноразового пароля"),
("install_cert_tip", "Установить сертификат RustDesk"),
("comfirm_install_cert_tip", "Это тестовый сертификат RustDesk, которому можно доверять. Он будет использоваться только по необходимости для установки драйверов RustDesk."),
("confirm_install_cert_tip", "Это тестовый сертификат RustDesk, которому можно доверять. Он будет использоваться только по необходимости для установки драйверов RustDesk."),
("RDP Settings", "Настройки RDP"),
("Sort by", "Сортировка"),
("New Connection", "Новое подключение"),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", "Достигнуто максимальне количество управляемых устройств."),
("Sync with recent sessions", "Синхронизация последних сессий"),
("Sort tags", "Сортировка меток"),
("Separate remote windows", "Отдельные удалённые окна"),
("separate window", "отдельное окно"),
("Open connection in new tab", "Открыть подключение в новой вкладке"),
("Move tab to new window", "Переместить вкладку в отдельное окно"),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""),
("Set one-time password length", ""),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", ""),
("Sort by", ""),
("New Connection", ""),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""),
("Set one-time password length", ""),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", ""),
("Sort by", ""),
("New Connection", ""),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""),
("Set one-time password length", ""),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", ""),
("Sort by", ""),
("New Connection", ""),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""),
("Set one-time password length", ""),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", ""),
("Sort by", ""),
("New Connection", ""),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""),
("Set one-time password length", ""),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", ""),
("Sort by", ""),
("New Connection", ""),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""),
("Set one-time password length", ""),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", ""),
("Sort by", ""),
("New Connection", ""),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""),
("Set one-time password length", ""),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", ""),
("Sort by", ""),
("New Connection", ""),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", ""),
("Set one-time password length", ""),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", ""),
("Sort by", ""),
("New Connection", ""),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "沒有正在進行的傳輸"),
("Set one-time password length", "設定一次性密碼長度"),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", "RDP 設定"),
("Sort by", "排序方式"),
("New Connection", "新連線"),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "Наразі нічого не пересилається"),
("Set one-time password length", "Вказати довжину одноразового пароля"),
("install_cert_tip", "Додати сертифікат Rustdesk"),
("comfirm_install_cert_tip", "Це сертифікат тестування Rustdesk, якому можна довіряти. За потреби сертифікат буде використано для погодження та встановлення драйверів Rustdesk."),
("confirm_install_cert_tip", "Це сертифікат тестування Rustdesk, якому можна довіряти. За потреби сертифікат буде використано для погодження та встановлення драйверів Rustdesk."),
("RDP Settings", "Налаштування RDP"),
("Sort by", "Сортувати за"),
("New Connection", "Нове підключення"),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("No transfers in progress", "Không có tệp tin nào đang được truyền"),
("Set one-time password length", "Thiết lập độ dài mật khẩu một lần"),
("install_cert_tip", ""),
("comfirm_install_cert_tip", ""),
("confirm_install_cert_tip", ""),
("RDP Settings", "Cài đặt RDP"),
("Sort by", "Sắp xếp theo"),
("New Connection", "Kết nối mới"),
@@ -524,8 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("exceed_max_devices", ""),
("Sync with recent sessions", ""),
("Sort tags", ""),
("Separate remote windows", ""),
("separate window", ""),
("Open connection in new tab", ""),
("Move tab to new window", ""),
].iter().cloned().collect();
}

View File

@@ -1907,6 +1907,10 @@ impl Connection {
.lock()
.unwrap()
.user_auto_adjust_fps(self.inner.id(), fps),
Some(misc::Union::ClientRecordStatus(status)) => video_service::VIDEO_QOS
.lock()
.unwrap()
.user_record(self.inner.id(), status),
_ => {}
},
Some(message::Union::AudioFrame(frame)) => {

View File

@@ -36,6 +36,7 @@ struct UserData {
quality: Option<(i64, Quality)>, // (time, quality)
delay: Option<Delay>,
response_delayed: bool,
record: bool,
}
pub struct VideoQoS {
@@ -114,6 +115,10 @@ impl VideoQoS {
self.quality
}
pub fn record(&self) -> bool {
self.users.iter().any(|u| u.1.record)
}
pub fn abr_enabled() -> bool {
"N" != Config::get_option("enable-abr")
}
@@ -388,6 +393,12 @@ impl VideoQoS {
}
}
pub fn user_record(&mut self, id: i32, v: bool) {
if let Some(user) = self.users.get_mut(&id) {
user.record = v;
}
}
pub fn on_connection_close(&mut self, id: i32) {
self.users.remove(&id);
self.refresh(None);

View File

@@ -36,7 +36,7 @@ use hbb_common::{
use scrap::Capturer;
use scrap::{
aom::AomEncoderConfig,
codec::{Encoder, EncoderCfg, HwEncoderConfig},
codec::{Encoder, EncoderCfg, HwEncoderConfig, Quality},
record::{Recorder, RecorderContext},
vpxcodec::{VpxEncoderConfig, VpxVideoCodecId},
CodecName, Display, TraitCapturer,
@@ -518,37 +518,13 @@ fn run(sp: GenericService) -> ResultType<()> {
let mut spf;
let mut quality = video_qos.quality();
let abr = VideoQoS::abr_enabled();
drop(video_qos);
log::info!("init quality={:?}, abr enabled:{}", quality, abr);
let encoder_cfg = match Encoder::negotiated_codec() {
scrap::CodecName::H264(name) | scrap::CodecName::H265(name) => {
EncoderCfg::HW(HwEncoderConfig {
name,
width: c.width,
height: c.height,
quality,
})
}
name @ (scrap::CodecName::VP8 | scrap::CodecName::VP9) => {
EncoderCfg::VPX(VpxEncoderConfig {
width: c.width as _,
height: c.height as _,
timebase: [1, 1000], // Output timestamp precision
quality,
codec: if name == scrap::CodecName::VP8 {
VpxVideoCodecId::VP8
} else {
VpxVideoCodecId::VP9
},
})
}
scrap::CodecName::AV1 => EncoderCfg::AOM(AomEncoderConfig {
width: c.width as _,
height: c.height as _,
quality,
}),
};
let codec_name = Encoder::negotiated_codec();
let recorder = get_recorder(c.width, c.height, &codec_name);
let last_recording =
(recorder.lock().unwrap().is_some() || video_qos.record()) && codec_name != CodecName::AV1;
drop(video_qos);
let encoder_cfg = get_encoder_config(&c, quality, last_recording);
let mut encoder;
match Encoder::new(encoder_cfg) {
@@ -597,8 +573,6 @@ fn run(sp: GenericService) -> ResultType<()> {
let mut try_gdi = 1;
#[cfg(windows)]
log::info!("gdi: {}", c.is_gdi());
let codec_name = Encoder::negotiated_codec();
let recorder = get_recorder(c.width, c.height, &codec_name);
#[cfg(windows)]
start_uac_elevation_check();
@@ -617,6 +591,11 @@ fn run(sp: GenericService) -> ResultType<()> {
allow_err!(encoder.set_quality(quality));
video_qos.store_bitrate(encoder.bitrate());
}
let recording = (recorder.lock().unwrap().is_some() || video_qos.record())
&& codec_name != CodecName::AV1;
if recording != last_recording {
bail!("SWITCH");
}
drop(video_qos);
if *SWITCH.lock().unwrap() {
@@ -789,6 +768,41 @@ fn run(sp: GenericService) -> ResultType<()> {
Ok(())
}
fn get_encoder_config(c: &CapturerInfo, quality: Quality, recording: bool) -> EncoderCfg {
// https://www.wowza.com/community/t/the-correct-keyframe-interval-in-obs-studio/95162
let keyframe_interval = if recording { Some(240) } else { None };
match Encoder::negotiated_codec() {
scrap::CodecName::H264(name) | scrap::CodecName::H265(name) => {
EncoderCfg::HW(HwEncoderConfig {
name,
width: c.width,
height: c.height,
quality,
keyframe_interval,
})
}
name @ (scrap::CodecName::VP8 | scrap::CodecName::VP9) => {
EncoderCfg::VPX(VpxEncoderConfig {
width: c.width as _,
height: c.height as _,
quality,
codec: if name == scrap::CodecName::VP8 {
VpxVideoCodecId::VP8
} else {
VpxVideoCodecId::VP9
},
keyframe_interval,
})
}
scrap::CodecName::AV1 => EncoderCfg::AOM(AomEncoderConfig {
width: c.width as _,
height: c.height as _,
quality,
keyframe_interval,
}),
}
}
fn get_recorder(
width: usize,
height: usize,

View File

@@ -297,6 +297,7 @@ class Header: Reactor.Component {
event click $(span#recording) (_, me) {
recording = !recording;
header.update();
handler.record_status(recording);
if (recording)
handler.refresh_video();
else

View File

@@ -215,7 +215,7 @@ class Enhancements: Reactor.Component {
return <li>{translate('Enhancements')}
<menu #enhancements-menu>
{has_hwcodec ? <li #enable-hwcodec><span>{svg_checkmark}</span>{translate("Hardware Codec")} (beta)</li> : ""}
<li #enable-abr><span>{svg_checkmark}</span>{translate("Adaptive Bitrate")} (beta)</li>
<li #enable-abr><span>{svg_checkmark}</span>{translate("Adaptive bitrate")} (beta)</li>
<li #screen-recording>{translate("Recording")}</li>
</menu>
</li>;

View File

@@ -451,6 +451,7 @@ impl sciter::EventHandler for SciterSession {
fn save_custom_image_quality(i32);
fn refresh_video();
fn record_screen(bool, i32, i32);
fn record_status(bool);
fn get_toggle_option(String);
fn is_privacy_mode_supported();
fn toggle_option(String);

View File

@@ -201,6 +201,13 @@ pub fn get_peer_option(id: String, name: String) -> String {
c.options.get(&name).unwrap_or(&"".to_owned()).to_owned()
}
#[inline]
#[cfg(feature = "flutter")]
pub fn get_peer_flutter_config(id: String, name: String) -> String {
let c = PeerConfig::load(&id);
c.ui_flutter.get(&name).unwrap_or(&"".to_owned()).to_owned()
}
#[inline]
pub fn set_peer_option(id: String, name: String, value: String) {
let mut c = PeerConfig::load(&id);
@@ -912,7 +919,7 @@ fn check_connect_status(reconnect: bool) -> mpsc::UnboundedSender<ipc::Data> {
#[cfg(feature = "flutter")]
pub fn account_auth(op: String, id: String, uuid: String, remember_me: bool) {
account::OidcSession::account_auth(op, id, uuid, remember_me);
account::OidcSession::account_auth(get_api_server(), op, id, uuid, remember_me);
}
#[cfg(feature = "flutter")]

View File

@@ -202,7 +202,7 @@ impl<T: InvokeUiSession> Session<T> {
}
pub fn get_flutter_config(&self, k: String) -> String {
self.lc.write().unwrap().get_ui_flutter(&k)
self.lc.read().unwrap().get_ui_flutter(&k)
}
pub fn toggle_option(&mut self, name: String) {
@@ -240,6 +240,14 @@ impl<T: InvokeUiSession> Session<T> {
self.send(Data::RecordScreen(start, w, h, self.id.clone()));
}
pub fn record_status(&self, status: bool) {
let mut misc = Misc::new();
misc.set_client_record_status(status);
let mut msg = Message::new();
msg.set_misc(misc);
self.send(Data::Message(msg));
}
pub fn save_custom_image_quality(&mut self, custom_image_quality: i32) {
let msg = self
.lc