relay hint msgbox
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
parent
6f106251f9
commit
d2e0cb396f
@ -298,6 +298,8 @@ class FfiModel with ChangeNotifier {
|
||||
showWaitUacDialog(id, dialogManager, type);
|
||||
} else if (type == 'elevation-error') {
|
||||
showElevationError(id, type, title, text, dialogManager);
|
||||
} else if (type == "relay-hint") {
|
||||
showRelayHintDialog(id, type, title, text, dialogManager);
|
||||
} else {
|
||||
var hasRetry = evt['hasRetry'] == 'true';
|
||||
showMsgBox(id, type, title, text, link, hasRetry, dialogManager);
|
||||
@ -312,7 +314,7 @@ class FfiModel with ChangeNotifier {
|
||||
_timer?.cancel();
|
||||
if (hasRetry) {
|
||||
_timer = Timer(Duration(seconds: _reconnects), () {
|
||||
bind.sessionReconnect(id: id);
|
||||
bind.sessionReconnect(id: id, forceRelay: false);
|
||||
clearPermissions();
|
||||
dialogManager.showLoading(translate('Connecting...'),
|
||||
onCancel: closeConnection);
|
||||
@ -323,6 +325,44 @@ class FfiModel with ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
void showRelayHintDialog(String id, String type, String title, String text,
|
||||
OverlayDialogManager dialogManager) {
|
||||
dialogManager.show(tag: '$id-$type', (setState, close) {
|
||||
onClose() {
|
||||
closeConnection();
|
||||
close();
|
||||
}
|
||||
|
||||
reconnect(bool forceRelay) {
|
||||
bind.sessionReconnect(id: id, forceRelay: forceRelay);
|
||||
clearPermissions();
|
||||
dialogManager.showLoading(translate('Connecting...'),
|
||||
onCancel: closeConnection);
|
||||
}
|
||||
|
||||
final style =
|
||||
ElevatedButton.styleFrom(backgroundColor: Colors.green[700]);
|
||||
return CustomAlertDialog(
|
||||
title: null,
|
||||
content: msgboxContent(type, title,
|
||||
"${translate(text)}\n\n${translate('relay_hint_tip')}"),
|
||||
actions: [
|
||||
dialogButton('Close', onPressed: onClose, isOutline: true),
|
||||
dialogButton('Retry', onPressed: () => reconnect(false)),
|
||||
dialogButton('Connect via relay',
|
||||
onPressed: () => reconnect(true), buttonStyle: style),
|
||||
dialogButton('Always connect via relay', onPressed: () {
|
||||
const option = 'force-always-relay';
|
||||
bind.sessionPeerOption(
|
||||
id: id, name: option, value: bool2option(option, true));
|
||||
reconnect(true);
|
||||
}, buttonStyle: style),
|
||||
],
|
||||
onCancel: onClose,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/// Handle the peer info event based on [evt].
|
||||
handlePeerInfo(Map<String, dynamic> evt, String peerId) async {
|
||||
// recent peer updated by handle_peer_info(ui_session_interface.rs) --> handle_peer_info(client.rs) --> save_config(client.rs)
|
||||
|
@ -916,6 +916,8 @@ pub struct LoginConfigHandler {
|
||||
pub direct: Option<bool>,
|
||||
pub received: bool,
|
||||
switch_uuid: Option<String>,
|
||||
pub success_time: Option<hbb_common::tokio::time::Instant>,
|
||||
pub direct_error_counter: usize,
|
||||
}
|
||||
|
||||
impl Deref for LoginConfigHandler {
|
||||
@ -962,6 +964,8 @@ impl LoginConfigHandler {
|
||||
self.direct = None;
|
||||
self.received = false;
|
||||
self.switch_uuid = switch_uuid;
|
||||
self.success_time = None;
|
||||
self.direct_error_counter = 0;
|
||||
}
|
||||
|
||||
/// Check if the client should auto login.
|
||||
|
@ -25,9 +25,8 @@ use hbb_common::{allow_err, get_time, message_proto::*, sleep};
|
||||
use hbb_common::{fs, log, Stream};
|
||||
|
||||
use crate::client::{
|
||||
new_voice_call_request, Client, CodecFormat, MediaData, MediaSender,
|
||||
QualityStatus, MILLI1, SEC30, SERVER_CLIPBOARD_ENABLED, SERVER_FILE_TRANSFER_ENABLED,
|
||||
SERVER_KEYBOARD_ENABLED,
|
||||
new_voice_call_request, Client, CodecFormat, MediaData, MediaSender, QualityStatus, MILLI1,
|
||||
SEC30, SERVER_CLIPBOARD_ENABLED, SERVER_FILE_TRANSFER_ENABLED, SERVER_KEYBOARD_ENABLED,
|
||||
};
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
use crate::common::{check_clipboard, update_clipboard, ClipboardContext, CLIPBOARD_INTERVAL};
|
||||
@ -148,7 +147,15 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
Err(err) => {
|
||||
log::error!("Connection closed: {}", err);
|
||||
self.handler.set_force_relay(direct, received);
|
||||
self.handler.msgbox("error", "Connection Error", &err.to_string(), "");
|
||||
let msgtype = "error";
|
||||
let title = "Connection Error";
|
||||
let text = err.to_string();
|
||||
let show_relay_hint = self.handler.show_relay_hint(last_recv_time, msgtype, title, &text);
|
||||
if show_relay_hint{
|
||||
self.handler.msgbox("relay-hint", title, &text, "");
|
||||
} else {
|
||||
self.handler.msgbox(msgtype, title, &text, "");
|
||||
}
|
||||
break;
|
||||
}
|
||||
Ok(ref bytes) => {
|
||||
@ -754,7 +761,8 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
Data::CloseVoiceCall => {
|
||||
self.stop_voice_call();
|
||||
let msg = new_voice_call_request(false);
|
||||
self.handler.on_voice_call_closed("Closed manually by the peer");
|
||||
self.handler
|
||||
.on_voice_call_closed("Closed manually by the peer");
|
||||
allow_err!(peer.send(&msg).await);
|
||||
}
|
||||
_ => {}
|
||||
|
@ -1,4 +1,3 @@
|
||||
use crate::ui_session_interface::InvokeUiSession;
|
||||
use crate::{
|
||||
client::file_trait::FileManager,
|
||||
common::make_fd_to_json,
|
||||
@ -7,7 +6,7 @@ use crate::{
|
||||
flutter::{session_add, session_start_},
|
||||
ui_interface::{self, *},
|
||||
};
|
||||
use flutter_rust_bridge::{StreamSink, SyncReturn, ZeroCopyBuffer};
|
||||
use flutter_rust_bridge::{StreamSink, SyncReturn};
|
||||
use hbb_common::{
|
||||
config::{self, LocalConfig, PeerConfig, ONLINE},
|
||||
fs, log,
|
||||
@ -157,9 +156,9 @@ pub fn session_record_screen(id: String, start: bool, width: usize, height: usiz
|
||||
}
|
||||
}
|
||||
|
||||
pub fn session_reconnect(id: String) {
|
||||
pub fn session_reconnect(id: String, force_relay: bool) {
|
||||
if let Some(session) = SESSIONS.read().unwrap().get(&id) {
|
||||
session.reconnect();
|
||||
session.reconnect(force_relay);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "Tancat manualment pel peer"),
|
||||
("Enable remote configuration modification", "Habilitar modificació remota de configuració"),
|
||||
("Run without install", "Executar sense instal·lar"),
|
||||
("Always connected via relay", "Connectat sempre a través de relay"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Connecta sempre a través de relay"),
|
||||
("whitelist_tip", ""),
|
||||
("Login", "Inicia sessió"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "被对方手动关闭"),
|
||||
("Enable remote configuration modification", "允许远程修改配置"),
|
||||
("Run without install", "无安装运行"),
|
||||
("Always connected via relay", "强制走中继连接"),
|
||||
("Connect via relay", "中继连接"),
|
||||
("Always connect via relay", "强制走中继连接"),
|
||||
("whitelist_tip", "只有白名单里的ip才能访问我"),
|
||||
("Login", "登录"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", "语音通话"),
|
||||
("Text chat", "文字聊天"),
|
||||
("Stop voice call", "停止语音聊天"),
|
||||
("relay_hint_tip", "可能无法直连,可以尝试中继连接。\n另外,如果想直接使用中继连接,可以在ID后面添加/r,或者在卡片选项里选择强制走中继连接。"),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "Ručně ukončeno protějškem"),
|
||||
("Enable remote configuration modification", "Umožnit upravování nastavení vzdáleného"),
|
||||
("Run without install", "Spustit bez instalování"),
|
||||
("Always connected via relay", "Vždy spojováno prostřednictvím brány pro předávání (relay)"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Vždy se spojovat prostřednictvím brány pro předávání (relay)"),
|
||||
("whitelist_tip", "Přístup je umožněn pouze z IP adres, nacházejících se na seznamu povolených"),
|
||||
("Login", "Přihlásit se"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "Manuelt lukket af peer"),
|
||||
("Enable remote configuration modification", "Tillad at ændre afstandskonfigurationen"),
|
||||
("Run without install", "Kør uden installation"),
|
||||
("Always connected via relay", "Tilslut altid via relæ-server"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Forbindelse via relæ-server"),
|
||||
("whitelist_tip", "Kun IP'er på udgivelseslisten kan få adgang til mig"),
|
||||
("Login", "Login"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "Von der Gegenstelle manuell geschlossen"),
|
||||
("Enable remote configuration modification", "Änderung der Konfiguration aus der Ferne zulassen"),
|
||||
("Run without install", "Ohne Installation ausführen"),
|
||||
("Always connected via relay", "Immer über Relay-Server verbunden"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Immer über Relay-Server verbinden"),
|
||||
("whitelist_tip", "Nur IPs auf der Whitelist können zugreifen."),
|
||||
("Login", "Anmelden"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", "Sprachanruf"),
|
||||
("Text chat", "Text-Chat"),
|
||||
("Stop voice call", "Sprachanruf beenden"),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -42,6 +42,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("request_elevation_tip","You can also request elevation if there is someone on the remote side."),
|
||||
("wait_accept_uac_tip","Please wait for the remote user to accept the UAC dialog."),
|
||||
("still_click_uac_tip", "Still requires the remote user to click OK on the UAC window of running RustDesk."),
|
||||
("config_microphone", "In order to speak remotely, you need to grant RustDesk \"Record Audio\" permissions.")
|
||||
("config_microphone", "In order to speak remotely, you need to grant RustDesk \"Record Audio\" permissions."),
|
||||
("relay_hint_tip", "It may not be possible to connect directly, you can try to connect via relay. \nIn addition, if you want to use relay on your first try, you can add the \"/r\" suffix to the ID, or select the option \"Always connect via relay\" in the peer card."),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "Manuale fermita de la samtavolano"),
|
||||
("Enable remote configuration modification", "Permesi foran redaktadon de la konfiguracio"),
|
||||
("Run without install", "Plenumi sen instali"),
|
||||
("Always connected via relay", "Ĉiam konektata per relajso"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Ĉiam konekti per relajso"),
|
||||
("whitelist_tip", "Nur la IP en la blanka listo povas kontroli mian komputilon"),
|
||||
("Login", "Konekti"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "Cerrado manualmente por el par"),
|
||||
("Enable remote configuration modification", "Habilitar modificación remota de configuración"),
|
||||
("Run without install", "Ejecutar sin instalar"),
|
||||
("Always connected via relay", "Siempre conectado a través de relay"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Conéctese siempre a través de relay"),
|
||||
("whitelist_tip", "Solo las direcciones IP autorizadas pueden conectarse a este escritorio"),
|
||||
("Login", "Iniciar sesión"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", "Llamada de voz"),
|
||||
("Text chat", "Chat de texto"),
|
||||
("Stop voice call", "Detener llamada de voz"),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "به صورت دستی توسط میزبان بسته شد"),
|
||||
("Enable remote configuration modification", "فعال بودن اعمال تغییرات پیکربندی از راه دور"),
|
||||
("Run without install", "بدون نصب اجرا شود"),
|
||||
("Always connected via relay", "متصل است Relay همیشه با"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "برای اتصال استفاده شود Relay از"),
|
||||
("whitelist_tip", "های مجاز می توانند به این دسکتاپ متصل شوند IP فقط"),
|
||||
("Login", "ورود"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", "تماس صوتی"),
|
||||
("Text chat", "گفتگو متنی (چت متنی)"),
|
||||
("Stop voice call", "توقف تماس صوتی"),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "Fermé manuellement par le pair"),
|
||||
("Enable remote configuration modification", "Autoriser la modification de la configuration à distance"),
|
||||
("Run without install", "Exécuter sans installer"),
|
||||
("Always connected via relay", "Forcer la connexion relais"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Forcer la connexion relais"),
|
||||
("whitelist_tip", "Seule une IP de la liste blanche peut accéder à mon appareil"),
|
||||
("Login", "Connexion"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "Έκλεισε από τον απομακρυσμένο σταθμό"),
|
||||
("Enable remote configuration modification", "Ενεργοποίηση απομακρυσμένης τροποποίησης ρυθμίσεων"),
|
||||
("Run without install", "Εκτέλεση χωρίς εγκατάσταση"),
|
||||
("Always connected via relay", "Πάντα συνδεδεμένο μέσω αναμετάδοσης"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Σύνδεση πάντα μέσω αναμετάδοσης"),
|
||||
("whitelist_tip", "Μόνο οι IP της λίστας επιτρεπόμενων έχουν πρόσβαση"),
|
||||
("Login", "Σύνδεση"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "A kapcsolatot a másik fél manuálisan bezárta"),
|
||||
("Enable remote configuration modification", "Távoli konfiguráció módosítás engedélyezése"),
|
||||
("Run without install", "Futtatás feltelepítés nélkül"),
|
||||
("Always connected via relay", "Mindig közvetítőn keresztül csatlakozik"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Mindig közvetítőn keresztüli csatlakozás"),
|
||||
("whitelist_tip", "Csak az engedélyezési listán szereplő címek csatlakozhatnak"),
|
||||
("Login", "Belépés"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "Ditutup secara manual oleh peer"),
|
||||
("Enable remote configuration modification", "Aktifkan modifikasi konfigurasi jarak jauh"),
|
||||
("Run without install", "Jalankan tanpa menginstal"),
|
||||
("Always connected via relay", "Selalu terhubung melalui relai"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Selalu terhubung melalui relai"),
|
||||
("whitelist_tip", "Hanya whitelisted IP yang dapat mengakses saya"),
|
||||
("Login", "Masuk"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "Chiuso manualmente dal peer"),
|
||||
("Enable remote configuration modification", "Abilita la modifica remota della configurazione"),
|
||||
("Run without install", "Esegui senza installare"),
|
||||
("Always connected via relay", "Connesso sempre tramite relay"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Collegati sempre tramite relay"),
|
||||
("whitelist_tip", "Solo gli indirizzi IP autorizzati possono connettersi a questo desktop"),
|
||||
("Login", "Accedi"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", "Chiamata vocale"),
|
||||
("Text chat", "Chat testuale"),
|
||||
("Stop voice call", "Interrompi la chiamata vocale"),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "相手が手動で切断しました"),
|
||||
("Enable remote configuration modification", "リモート設定変更を有効化"),
|
||||
("Run without install", "インストールせずに実行"),
|
||||
("Always connected via relay", "常に中継サーバー経由で接続"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "常に中継サーバー経由で接続"),
|
||||
("whitelist_tip", "ホワイトリストに登録されたIPからのみ接続を許可します"),
|
||||
("Login", "ログイン"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "다른 사용자에 의해 종료됨"),
|
||||
("Enable remote configuration modification", "원격 구성 변경 활성화"),
|
||||
("Run without install", "설치 없이 실행"),
|
||||
("Always connected via relay", "항상 relay를 통해 접속됨"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "항상 relay를 통해 접속하기"),
|
||||
("whitelist_tip", "화이트리스트에 있는 IP만 현 데스크탑에 접속 가능합니다"),
|
||||
("Login", "로그인"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "Пир қолымен жабылған"),
|
||||
("Enable remote configuration modification", "Қашықтан қалыптарды өзгертуді іске қосу"),
|
||||
("Run without install", "Орнатпай-ақ Іске қосу"),
|
||||
("Always connected via relay", "Әрқашан да релай сербері арқылы қосулы"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Әрқашан да релай сербері арқылы қосылу"),
|
||||
("whitelist_tip", "Маған тек ақ-тізімделген IP қол жеткізе алады"),
|
||||
("Login", "Кіру"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "Połączenie zakończone ręcznie przez peer"),
|
||||
("Enable remote configuration modification", "Włącz zdalną modyfikację konfiguracji"),
|
||||
("Run without install", "Uruchom bez instalacji"),
|
||||
("Always connected via relay", "Zawsze połączony pośrednio"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Zawsze łącz pośrednio"),
|
||||
("whitelist_tip", "Zezwalaj na łączenie z tym komputerem tylko z adresów IP znajdujących się na białej liście"),
|
||||
("Login", "Zaloguj"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "Fechada manualmente pelo destino"),
|
||||
("Enable remote configuration modification", "Habilitar modificações de configuração remotas"),
|
||||
("Run without install", "Executar sem instalar"),
|
||||
("Always connected via relay", "Sempre conectado via relay"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Sempre conectar via relay"),
|
||||
("whitelist_tip", "Somente IPs na whitelist podem me acessar"),
|
||||
("Login", "Login"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "Fechada manualmente pelo parceiro"),
|
||||
("Enable remote configuration modification", "Habilitar modificações de configuração remotas"),
|
||||
("Run without install", "Executar sem instalar"),
|
||||
("Always connected via relay", "Sempre conectado via relay"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Sempre conectar via relay"),
|
||||
("whitelist_tip", "Somente IPs confiáveis podem me acessar"),
|
||||
("Login", "Login"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "Închis manual de dispozitivul pereche"),
|
||||
("Enable remote configuration modification", "Activează modificarea configurației de la distanță"),
|
||||
("Run without install", "Rulează fără instalare"),
|
||||
("Always connected via relay", "Se conectează mereu prin retransmisie"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Se conectează mereu prin retransmisie"),
|
||||
("whitelist_tip", "Doar adresele IP autorizate pot accesa acest dispozitiv"),
|
||||
("Login", "Conectare"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "Закрыто удалённым узлом вручную"),
|
||||
("Enable remote configuration modification", "Разрешить удалённое изменение конфигурации"),
|
||||
("Run without install", "Запустить без установки"),
|
||||
("Always connected via relay", "Всегда подключается через ретрансляционный сервер"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Всегда подключаться через ретрансляционный сервер"),
|
||||
("whitelist_tip", "Только IP-адреса из белого списка могут получить доступ ко мне"),
|
||||
("Login", "Войти"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", "Голосовой вызов"),
|
||||
("Text chat", "Текстовый чат"),
|
||||
("Stop voice call", "Завершить голосовой вызов"),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "Manuálne ukončené opačnou stranou pripojenia"),
|
||||
("Enable remote configuration modification", "Povoliť zmeny konfigurácie zo vzdialeného PC"),
|
||||
("Run without install", "Spustiť bez inštalácie"),
|
||||
("Always connected via relay", "Vždy pripojené cez prepájací server"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Vždy pripájať cez prepájací server"),
|
||||
("whitelist_tip", "Len vymenované IP adresy majú oprávnenie sa pripojiť k vzdialenej správe"),
|
||||
("Login", "Prihlásenie"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "Povezavo ročno prekinil odjemalec"),
|
||||
("Enable remote configuration modification", "Omogoči oddaljeno spreminjanje nastavitev"),
|
||||
("Run without install", "Zaženi brez namestitve"),
|
||||
("Always connected via relay", "Vedno povezan preko posrednika"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Vedno poveži preko posrednika"),
|
||||
("whitelist_tip", "Dostop je možen samo iz dovoljenih IPjev"),
|
||||
("Login", "Prijavi"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "E mbyllur manualisht nga peer"),
|
||||
("Enable remote configuration modification", "Aktivizoni modifikimin e konfigurimit në distancë"),
|
||||
("Run without install", "Ekzekuto pa instaluar"),
|
||||
("Always connected via relay", "Gjithmonë i ldihur me transmetues"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Gjithmonë lidheni me transmetues"),
|
||||
("whitelist_tip", "Vetëm IP e listës së bardhë mund të më aksesoj."),
|
||||
("Login", "Hyrje"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "Klijent ručno raskinuo konekciju"),
|
||||
("Enable remote configuration modification", "Dozvoli modifikaciju udaljene konfiguracije"),
|
||||
("Run without install", "Pokreni bez instalacije"),
|
||||
("Always connected via relay", "Uvek spojne preko posrednika"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Uvek se spoj preko posrednika"),
|
||||
("whitelist_tip", "Samo dozvoljene IP mi mogu pristupiti"),
|
||||
("Login", "Prijava"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "Stängd manuellt av klienten"),
|
||||
("Enable remote configuration modification", "Tillåt fjärrkonfigurering"),
|
||||
("Run without install", "Kör utan installation"),
|
||||
("Always connected via relay", "Anslut alltid via relay"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Anslut alltid via relay"),
|
||||
("whitelist_tip", "Bara vitlistade IPs kan koppla upp till mig"),
|
||||
("Login", "Logga in"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", ""),
|
||||
("Enable remote configuration modification", ""),
|
||||
("Run without install", ""),
|
||||
("Always connected via relay", ""),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", ""),
|
||||
("whitelist_tip", ""),
|
||||
("Login", ""),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "ถูกปิดโดยอีกฝั่งการการเชื่อมต่อ"),
|
||||
("Enable remote configuration modification", "เปิดการใช้งานการแก้ไขการตั้งค่าปลายทาง"),
|
||||
("Run without install", "ใช้งานโดยไม่ต้องติดตั้ง"),
|
||||
("Always connected via relay", "เชื่อมต่อผ่านรีเลย์เสมอ"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "เชื่อมต่อผ่านรีเลย์เสมอ"),
|
||||
("whitelist_tip", "อนุญาตเฉพาะการเชื่อมต่อจาก IP ที่ไวท์ลิสต์"),
|
||||
("Login", "เข้าสู่ระบบ"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "Eş tarafından manuel olarak kapatıldı"),
|
||||
("Enable remote configuration modification", "Uzaktan yapılandırma değişikliğini etkinleştir"),
|
||||
("Run without install", "Yüklemeden çalıştır"),
|
||||
("Always connected via relay", "Her zaman röle ile bağlı"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Always connect via relay"),
|
||||
("whitelist_tip", "Bu masaüstüne yalnızca yetkili IP adresleri bağlanabilir"),
|
||||
("Login", "Giriş yap"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "由對方手動關閉"),
|
||||
("Enable remote configuration modification", "啟用遠端更改設定"),
|
||||
("Run without install", "跳過安裝直接執行"),
|
||||
("Always connected via relay", "一律透過轉送連線"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "一律透過轉送連線"),
|
||||
("whitelist_tip", "只有白名單中的 IP 可以存取"),
|
||||
("Login", "登入"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "Закрито вузлом вручну"),
|
||||
("Enable remote configuration modification", "Дозволити віддалену зміну конфігурації"),
|
||||
("Run without install", "Запустити без установки"),
|
||||
("Always connected via relay", "Завжди підключений через ретрансляційний сервер"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Завжди підключатися через ретрансляційний сервер"),
|
||||
("whitelist_tip", "Тільки IP-адреси з білого списку можуть отримати доступ до мене"),
|
||||
("Login", "Увійти"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by the peer", "Đóng thủ công bởi peer"),
|
||||
("Enable remote configuration modification", "Cho phép thay đổi cấu hình bên từ xa"),
|
||||
("Run without install", "Chạy mà không cần cài"),
|
||||
("Always connected via relay", "Luôn đuợc kết nối qua relay"),
|
||||
("Connect via relay", ""),
|
||||
("Always connect via relay", "Luôn kết nối qua relay"),
|
||||
("whitelist_tip", "Chỉ có những IP đựoc cho phép mới có thể truy cập"),
|
||||
("Login", "Đăng nhập"),
|
||||
@ -449,5 +449,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", ""),
|
||||
("Text chat", ""),
|
||||
("Stop voice call", ""),
|
||||
("relay_hint_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
use std::sync::RwLock;
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
ops::{Deref, DerefMut},
|
||||
@ -15,7 +14,6 @@ use sciter::{
|
||||
Value,
|
||||
};
|
||||
|
||||
use hbb_common::tokio::io::AsyncReadExt;
|
||||
use hbb_common::{
|
||||
allow_err, fs::TransferJobMeta, log, message_proto::*, rendezvous_proto::ConnType,
|
||||
};
|
||||
@ -348,7 +346,7 @@ impl sciter::EventHandler for SciterSession {
|
||||
let site = AssetPtr::adopt(ptr as *mut video_destination);
|
||||
log::debug!("[video] start video");
|
||||
*VIDEO.lock().unwrap() = Some(site);
|
||||
self.reconnect();
|
||||
self.reconnect(false);
|
||||
}
|
||||
}
|
||||
BEHAVIOR_EVENTS::VIDEO_INITIALIZED => {
|
||||
@ -397,7 +395,7 @@ impl sciter::EventHandler for SciterSession {
|
||||
fn transfer_file();
|
||||
fn tunnel();
|
||||
fn lock_screen();
|
||||
fn reconnect();
|
||||
fn reconnect(bool);
|
||||
fn get_chatbox();
|
||||
fn get_icon();
|
||||
fn get_home_dir();
|
||||
|
@ -1,29 +1,30 @@
|
||||
use std::collections::HashMap;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use std::str::FromStr;
|
||||
use std::sync::{Arc, Mutex, RwLock};
|
||||
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
|
||||
use std::sync::{Arc, Mutex, RwLock};
|
||||
use std::time::Duration;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use bytes::Bytes;
|
||||
use rdev::{Event, EventType::*};
|
||||
use uuid::Uuid;
|
||||
|
||||
use hbb_common::{allow_err, message_proto::*};
|
||||
use hbb_common::{fs, get_version_number, log, Stream};
|
||||
use hbb_common::config::{Config, LocalConfig, PeerConfig, RS_PUB_KEY};
|
||||
use hbb_common::rendezvous_proto::ConnType;
|
||||
use hbb_common::tokio::{self, sync::mpsc};
|
||||
use hbb_common::{allow_err, message_proto::*};
|
||||
use hbb_common::{fs, get_version_number, log, Stream};
|
||||
|
||||
use crate::{client::Data, client::Interface};
|
||||
use crate::client::{
|
||||
check_if_retry, FileManager, handle_hash, handle_login_error, handle_login_from_ui,
|
||||
handle_test_delay, input_os_password, Key, KEY_MAP, load_config, LoginConfigHandler,
|
||||
QualityStatus, send_mouse, start_video_audio_threads,
|
||||
};
|
||||
use crate::client::io_loop::Remote;
|
||||
use crate::client::{
|
||||
check_if_retry, handle_hash, handle_login_error, handle_login_from_ui, handle_test_delay,
|
||||
input_os_password, load_config, send_mouse, start_video_audio_threads, FileManager, Key,
|
||||
LoginConfigHandler, QualityStatus, KEY_MAP,
|
||||
};
|
||||
use crate::common::{self, GrabState};
|
||||
use crate::keyboard;
|
||||
use crate::{client::Data, client::Interface};
|
||||
|
||||
pub static IS_IN: AtomicBool = AtomicBool::new(false);
|
||||
|
||||
@ -531,9 +532,13 @@ impl<T: InvokeUiSession> Session<T> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn reconnect(&self) {
|
||||
pub fn reconnect(&self, force_relay: bool) {
|
||||
self.send(Data::Close);
|
||||
let cloned = self.clone();
|
||||
// override only if true
|
||||
if true == force_relay {
|
||||
cloned.lc.write().unwrap().force_relay = true;
|
||||
}
|
||||
let mut lock = self.thread.lock().unwrap();
|
||||
lock.take().map(|t| t.join());
|
||||
*lock = Some(std::thread::spawn(move || {
|
||||
@ -674,10 +679,42 @@ impl<T: InvokeUiSession> Session<T> {
|
||||
pub fn request_voice_call(&self) {
|
||||
self.send(Data::NewVoiceCall);
|
||||
}
|
||||
|
||||
|
||||
pub fn close_voice_call(&self) {
|
||||
self.send(Data::CloseVoiceCall);
|
||||
}
|
||||
|
||||
pub fn show_relay_hint(
|
||||
&mut self,
|
||||
last_recv_time: tokio::time::Instant,
|
||||
msgtype: &str,
|
||||
title: &str,
|
||||
text: &str,
|
||||
) -> bool {
|
||||
let duration = Duration::from_secs(3);
|
||||
let counter_interval = 3;
|
||||
let lock = self.lc.read().unwrap();
|
||||
let success_time = lock.success_time;
|
||||
let direct = lock.direct.unwrap_or(false);
|
||||
let received = lock.received;
|
||||
drop(lock);
|
||||
if let Some(success_time) = success_time {
|
||||
if direct && last_recv_time.duration_since(success_time) < duration {
|
||||
let retry_for_relay = direct && !received;
|
||||
let retry = check_if_retry(msgtype, title, text, retry_for_relay);
|
||||
if retry && !retry_for_relay {
|
||||
self.lc.write().unwrap().direct_error_counter += 1;
|
||||
if self.lc.read().unwrap().direct_error_counter % counter_interval == 0 {
|
||||
#[cfg(feature = "flutter")]
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
self.lc.write().unwrap().direct_error_counter = 0;
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
pub trait InvokeUiSession: Send + Sync + Clone + 'static + Sized + Default {
|
||||
@ -813,6 +850,7 @@ impl<T: InvokeUiSession> Interface for Session<T> {
|
||||
"Connected, waiting for image...",
|
||||
"",
|
||||
);
|
||||
self.lc.write().unwrap().success_time = Some(tokio::time::Instant::now());
|
||||
}
|
||||
self.on_connected(self.lc.read().unwrap().conn_type);
|
||||
#[cfg(windows)]
|
||||
@ -958,7 +996,7 @@ pub async fn io_loop<T: InvokeUiSession>(handler: Session<T>) {
|
||||
let frame_count = Arc::new(AtomicUsize::new(0));
|
||||
let frame_count_cl = frame_count.clone();
|
||||
let ui_handler = handler.ui_handler.clone();
|
||||
let (video_sender, audio_sender) = start_video_audio_threads(move |data: &mut Vec<u8> | {
|
||||
let (video_sender, audio_sender) = start_video_audio_threads(move |data: &mut Vec<u8>| {
|
||||
frame_count_cl.fetch_add(1, Ordering::Relaxed);
|
||||
ui_handler.on_rgba(data);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user