mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-25 05:09:04 +08:00
opt: support match user/hostname/id(sciter), case insensitive
Signed-off-by: Kingtous <kingtous@qq.com>
This commit is contained in:
parent
ff5e9a8ea5
commit
4e047f1bb2
@ -725,6 +725,7 @@ Future<bool> matchPeer(String searchText, Peer peer) async {
|
||||
}
|
||||
|
||||
Future<List<Peer>>? matchPeers(String searchText, List<Peer> peers) async {
|
||||
searchText = searchText.trim();
|
||||
if (searchText.isEmpty) {
|
||||
return peers;
|
||||
}
|
||||
@ -738,4 +739,4 @@ Future<List<Peer>>? matchPeers(String searchText, List<Peer> peers) async {
|
||||
}
|
||||
}
|
||||
return filteredList;
|
||||
}
|
||||
}
|
||||
|
@ -245,7 +245,7 @@ class SearchBar: Reactor.Component {
|
||||
}
|
||||
|
||||
event change $(input) (_, el) {
|
||||
this.onChange(el.value.trim());
|
||||
this.onChange(el.value.trim().toLowerCase());
|
||||
}
|
||||
|
||||
function onChange(v) {
|
||||
@ -297,8 +297,13 @@ class SessionList: Reactor.Component {
|
||||
if (!p) return this.sessions;
|
||||
var tmp = [];
|
||||
this.sessions.map(function(s) {
|
||||
var name = s[4] || s.alias || s[0] || s.id || "";
|
||||
if (name.indexOf(p) >= 0) tmp.push(s);
|
||||
var name = (s[4] || s.alias || "").toLowerCase();
|
||||
var id = (s[0] || s.id || "").toLowerCase();
|
||||
var user = (s[1] || "").toLowerCase();
|
||||
var hostname = (s[2] || "").toLowerCase();
|
||||
if (name.indexOf(p) >= 0 || id.indexOf(p) >= 0 || user.indexOf(p) >= 0 || hostname.indexOf(p) >= 0) {
|
||||
tmp.push(s);
|
||||
}
|
||||
});
|
||||
return tmp;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user