Fixed multi-desktop with filter, added tag:xxx filter.

This commit is contained in:
Ylian Saint-Hilaire 2019-12-23 16:11:08 -08:00
parent 2da3061efb
commit 097eb6cd9d
2 changed files with 11 additions and 6 deletions

View File

@ -1,6 +1,6 @@
{
"name": "meshcentral",
"version": "0.4.6-l",
"version": "0.4.6-m",
"keywords": [
"Remote Management",
"Intel AMT",

View File

@ -3068,7 +3068,7 @@
if ((meshrights & 8) || (meshrights & 256)) { // Requires remote control rights or desktop view only rights
//var conn = 0;
//if ((node.conn & 1) != 0) { conn = 1; } else if ((node.conn & 6) != 0) { conn = 2; } // Check what type of connect we can do (Agent vs AMT)
if (node.conn & 1) { count++; }
if ((node.conn & 1) && (node.v == true)) { count++; }
}
}
}
@ -3077,7 +3077,7 @@
// Perform connect all
for (var i in nodes) {
if ((multiDesktop[nodes[i]._id] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodes[i]._id) >= 0))) {
if ((nodes[i].v == true) && (multiDesktop[nodes[i]._id] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodes[i]._id) >= 0))) {
toggleKvmDevice(nodes[i]._id);
}
}
@ -3638,13 +3638,15 @@
function onConsoleFocus(x) { consoleFocus = x; }
function onSearchInputChanged() {
var x = Q('SearchInput').value.toLowerCase().trim(); putstore('_search', x);
var userSearch = null, ipSearch = null, groupSearch = null;
var x = Q('SearchInput').value.toLowerCase().trim(); putstore('_search', Q('SearchInput').value);
var userSearch = null, ipSearch = null, groupSearch = null, tagSearch = null;
if (x.startsWith("user:")) { userSearch = x.substring(5); }
else if (x.startsWith("u:")) { userSearch = x.substring(2); }
else if (x.startsWith("ip:")) { ipSearch = x.substring(3); }
else if (x.startsWith("group:")) { groupSearch = x.substring(6); }
else if (x.startsWith("g:")) { groupSearch = x.substring(2); }
else if (x.startsWith("tag:")) { tagSearch = Q('SearchInput').value.trim().substring(4); }
else if (x.startsWith("t:")) { tagSearch = Q('SearchInput').value.trim().substring(2); }
if (x == '') {
// No search
@ -3655,7 +3657,10 @@
} else if (groupSearch != null) {
// Group filter
for (var d in nodes) { nodes[d].v = (meshes[nodes[d].meshid].name.toLowerCase().indexOf(groupSearch) >= 0); }
} else if (userSearch != null) {
} else if (tagSearch != null) {
// Tag filter
for (var d in nodes) { nodes[d].v = ((nodes[d].tags != null) && (nodes[d].tags.indexOf(tagSearch) >= 0)); }
} else if (userSearch != null) {
// User search
for (var d in nodes) {
nodes[d].v = false;