Merge pull request #6040 from sahilyeole/feat/autocomplete

Feat autocomplete/search while typing in remote ID field
This commit is contained in:
RustDesk
2023-10-20 13:49:52 +08:00
committed by GitHub
2 changed files with 333 additions and 37 deletions

View File

@@ -955,6 +955,25 @@ pub fn main_load_recent_peers_sync() -> SyncReturn<String> {
SyncReturn("".to_string())
}
pub fn main_load_lan_peers_sync() -> SyncReturn<String> {
let data = HashMap::from([
("name", "load_lan_peers".to_owned()),
(
"peers",
serde_json::to_string(&get_lan_peers()).unwrap_or_default(),
),
]);
return SyncReturn(serde_json::ser::to_string(&data).unwrap_or("".to_owned()));
}
pub fn main_load_ab_sync() -> SyncReturn<String> {
return SyncReturn(serde_json::to_string(&config::Ab::load()).unwrap_or_default());
}
pub fn main_load_group_sync() -> SyncReturn<String> {
return SyncReturn(serde_json::to_string(&config::Group::load()).unwrap_or_default());
}
pub fn main_load_recent_peers_for_ab(filter: String) -> String {
let id_filters = serde_json::from_str::<Vec<String>>(&filter).unwrap_or_default();
let id_filters = if id_filters.is_empty() {