Merge branch 'master' into master-2

This commit is contained in:
RustDesk 2023-08-23 12:03:25 +08:00 committed by GitHub
commit b787734913
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
38 changed files with 91 additions and 25 deletions

View File

@ -579,6 +579,13 @@ class AddressBookTag extends StatelessWidget {
ColorPickerType.accent: false,
ColorPickerType.wheel: true,
},
pickerTypeLabels: {
ColorPickerType.primary: translate("Primary Color"),
ColorPickerType.wheel: translate("HSV Color"),
},
actionButtons: ColorPickerActionButtons(
dialogOkButtonLabel: translate("OK"),
dialogCancelButtonLabel: translate("Cancel")),
showColorCode: true,
);
if (oldColor != newColor) {

View File

@ -735,11 +735,12 @@ abstract class BasePeerCard extends StatelessWidget {
proc: () async {
bool result = gFFI.abModel.changePassword(id, '');
await bind.mainForgetPassword(id: id);
bool toast = false;
if (result) {
bool toast = tab == PeerTabIndex.ab;
toast = tab == PeerTabIndex.ab;
gFFI.abModel.pushAb(toastIfFail: toast, toastIfSucc: toast);
}
showToast(translate('Successful'));
if (!toast) showToast(translate('Successful'));
},
padding: menuPadding,
dismissOnClicked: true,

View File

@ -831,30 +831,19 @@ pub fn check_software_update() {
#[tokio::main(flavor = "current_thread")]
async fn check_software_update_() -> hbb_common::ResultType<()> {
sleep(3.).await;
let url = "https://github.com/rustdesk/rustdesk/releases/latest";
let latest_release_response = reqwest::get(url).await?;
let latest_release_version = latest_release_response
.url()
.path()
.rsplit('/')
.next()
.unwrap();
let rendezvous_server = format!("rs-sg.rustdesk.com:{}", config::RENDEZVOUS_PORT);
let (mut socket, rendezvous_server) =
socket_client::new_udp_for(&rendezvous_server, CONNECT_TIMEOUT).await?;
let response_url = latest_release_response.url().to_string();
let mut msg_out = RendezvousMessage::new();
msg_out.set_software_update(SoftwareUpdate {
url: crate::VERSION.to_owned(),
..Default::default()
});
socket.send(&msg_out, rendezvous_server).await?;
use hbb_common::protobuf::Message;
for _ in 0..2 {
if let Some(Ok((bytes, _))) = socket.next_timeout(READ_TIMEOUT).await {
if let Ok(msg_in) = RendezvousMessage::parse_from_bytes(&bytes) {
if let Some(rendezvous_message::Union::SoftwareUpdate(su)) = msg_in.union {
let version = hbb_common::get_version_from_url(&su.url);
if get_version_number(&version) > get_version_number(crate::VERSION) {
*SOFTWARE_UPDATE_URL.lock().unwrap() = su.url;
}
}
}
}
if get_version_number(&latest_release_version) > get_version_number(crate::VERSION) {
*SOFTWARE_UPDATE_URL.lock().unwrap() = response_url;
}
Ok(())
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", "未成功上传地址簿"),
("synced_peer_readded_tip", "最近会话中存在的设备将会被重新同步到地址簿。"),
("Change Color", "更改颜色"),
("Primary Color", "基本色"),
("HSV Color", "HSV 色"),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", "Nepodařilo se synchronizovat adresář se serverem"),
("synced_peer_readded_tip", "Zařízení, která byla přítomna v posledních relacích, budou synchronizována zpět do adresáře."),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", "Synchronisierung des Adressbuchs mit dem Server fehlgeschlagen"),
("synced_peer_readded_tip", "Die Geräte, die in den letzten Sitzungen vorhanden waren, werden erneut zum Adressbuch hinzugefügt."),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", "No se ha podido sincronizar el directorio con el servidor"),
("synced_peer_readded_tip", "Los dispositivos presentes en sesiones recientes se sincronizarán con el directorio."),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", "Échec de la synchronisation du carnet d'adresses"),
("synced_peer_readded_tip", "Les appareils qui étaient présents dans les sessions récentes seront synchronisés avec le carnet d'adresses."),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", "Gagal menyinkronkan buku alamat ke server"),
("synced_peer_readded_tip", "Perangkat yang terdaftar dalam sesi-sesi terbaru akan di-sinkronkan kembali ke buku alamat."),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", "Impossibile sincronizzare la rubrica con il server"),
("synced_peer_readded_tip", "I dispositivi presenti nelle sessioni recenti saranno sincronizzati di nuovo nella rubrica."),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", "Невозможно синхронизировать адресную книгу с сервером"),
("synced_peer_readded_tip", "Устройства, присутствовавшие в последних сеансах, будут синхронизированы с адресной книгой."),
("Change Color", "Изменить цвет"),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", "未成功上傳地址簿"),
("synced_peer_readded_tip", "最近會話中存在的設備將會被重新同步到地址簿。"),
("Change Color", "更改顏色"),
("Primary Color", "基本色"),
("HSV Color", "HSV 色"),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -539,5 +539,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("push_ab_failed_tip", ""),
("synced_peer_readded_tip", ""),
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
].iter().cloned().collect();
}

View File

@ -594,7 +594,8 @@ pub fn current_is_wayland() -> bool {
#[inline]
pub fn get_new_version() -> String {
hbb_common::get_version_from_url(&*SOFTWARE_UPDATE_URL.lock().unwrap())
// hbb_common::get_version_from_url(&*SOFTWARE_UPDATE_URL.lock().unwrap())
(*SOFTWARE_UPDATE_URL.lock().unwrap().rsplit('/').next().unwrap_or("")).to_string()
}
#[inline]