mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Improved use of Windows Security Center.
This commit is contained in:
parent
2c72c6b7c1
commit
9a4a9791ee
3 changed files with 1251 additions and 1114 deletions
|
@ -2515,7 +2515,7 @@
|
|||
|
||||
function onSearchInputChanged() {
|
||||
var x = Q('SearchInput').value.toLowerCase().trim(); putstore('_search', Q('SearchInput').value);
|
||||
var userSearch = null, ipSearch = null, groupSearch = null, tagSearch = null;
|
||||
var userSearch = null, ipSearch = null, groupSearch = null, tagSearch = null, agentTagSearch = null, wscSearch = null;
|
||||
if (x.startsWith("user:".toLowerCase())) { userSearch = x.substring("user:".length); }
|
||||
else if (x.startsWith("u:".toLowerCase())) { userSearch = x.substring("u:".length); }
|
||||
else if (x.startsWith("ip:".toLowerCase())) { ipSearch = x.substring("ip:".length); }
|
||||
|
@ -2523,6 +2523,13 @@
|
|||
else if (x.startsWith("g:".toLowerCase())) { groupSearch = x.substring("g:".length); }
|
||||
else if (x.startsWith("tag:".toLowerCase())) { tagSearch = Q('SearchInput').value.trim().substring("tag:".length); }
|
||||
else if (x.startsWith("t:".toLowerCase())) { tagSearch = Q('SearchInput').value.trim().substring("t:".length); }
|
||||
else if (x.startsWith("atag:".toLowerCase())) { agentTagSearch = Q('SearchInput').value.trim().substring("atag:".length).toLowerCase(); }
|
||||
else if (x.startsWith("a:".toLowerCase())) { agentTagSearch = Q('SearchInput').value.trim().substring("a:".length).toLowerCase(); }
|
||||
else if (x == 'wsc:ok') { wscSearch = 1; }
|
||||
else if (x == 'wsc:noav') { wscSearch = 2; }
|
||||
else if (x == 'wsc:noupdate') { wscSearch = 3; }
|
||||
else if (x == 'wsc:nofirewall') { wscSearch = 4; }
|
||||
else if (x == 'wsc:any') { wscSearch = 5; }
|
||||
|
||||
if (x == '') {
|
||||
// No search
|
||||
|
@ -2538,12 +2545,28 @@
|
|||
for (var d in nodes) {
|
||||
nodes[d].v = ((nodes[d].tags == null) && (tagSearch == '')) || ((nodes[d].tags != null) && (nodes[d].tags.indexOf(tagSearch) >= 0));
|
||||
}
|
||||
} else if (agentTagSearch != null) {
|
||||
// Agent Tag filter
|
||||
for (var d in nodes) {
|
||||
nodes[d].v = (((nodes[d].agent != null) && (nodes[d].agent.tag == null)) && (agentTagSearch == '')) || ((nodes[d].agent != null) && (nodes[d].agent.tag != null) && (nodes[d].agent.tag.toLowerCase().indexOf(agentTagSearch) >= 0));
|
||||
}
|
||||
} else if (userSearch != null) {
|
||||
// User search
|
||||
for (var d in nodes) {
|
||||
nodes[d].v = false;
|
||||
if (nodes[d].users && nodes[d].users.length > 0) { for (var i in nodes[d].users) { if (nodes[d].users[i].toLowerCase().indexOf(userSearch) >= 0) { nodes[d].v = true; } } }
|
||||
}
|
||||
} else if (wscSearch != null) {
|
||||
// Windows Security Center
|
||||
for (var d in nodes) {
|
||||
nodes[d].v = false;
|
||||
if (nodes[d].wsc) {
|
||||
if ((wscSearch == 1) && (nodes[d].wsc.antiVirus == 'OK') && (nodes[d].wsc.autoUpdate == 'OK') && (nodes[d].wsc.firewall == 'OK')) { nodes[d].v = true; }
|
||||
else if (((wscSearch == 2) || (wscSearch == 5)) && (nodes[d].wsc.antiVirus != 'OK')) { nodes[d].v = true; }
|
||||
else if (((wscSearch == 3) || (wscSearch == 5)) && (nodes[d].wsc.autoUpdate != 'OK')) { nodes[d].v = true; }
|
||||
else if (((wscSearch == 4) || (wscSearch == 5)) && (nodes[d].wsc.firewall != 'OK')) { nodes[d].v = true; }
|
||||
}
|
||||
}
|
||||
} else if (x == '*') {
|
||||
// Star filter
|
||||
for (var d in nodes) { nodes[d].v = (stars[nodes[d]._id] == 1); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue