1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-02-12 11:01:52 +00:00

Added DeviceSearchBarServerAndClientName option, #3260

This commit is contained in:
Ylian Saint-Hilaire 2021-11-08 11:04:32 -08:00
parent 72b92284d4
commit 966392b779
4 changed files with 18 additions and 13 deletions

View file

@ -306,6 +306,7 @@
"loginfooter": { "type": "string", "default": null, "description": "This is a HTML string displayed at the bottom of the web page when a user is not logged in." }, "loginfooter": { "type": "string", "default": null, "description": "This is a HTML string displayed at the bottom of the web page when a user is not logged in." },
"guestDeviceSharing": { "type": "boolean", "default": true, "description": "When set to false, the desktop/terminal sharing link feature is not available." }, "guestDeviceSharing": { "type": "boolean", "default": true, "description": "When set to false, the desktop/terminal sharing link feature is not available." },
"autoRemoveInactiveDevices": { "type": "integer", "default": 0, "minimum": 0, "maximum": 2000, "description": "Number of days a device can be inactive before it's removed. 0 disables this feature. Device group setting will override this value." }, "autoRemoveInactiveDevices": { "type": "integer", "default": 0, "minimum": 0, "maximum": 2000, "description": "Number of days a device can be inactive before it's removed. 0 disables this feature. Device group setting will override this value." },
"DeviceSearchBarServerAndClientName": { "type": "boolean", "default": false, "description": "When set to true, the devices search box will match on both the server name and client name of a device." },
"altMessenging": { "altMessenging": {
"type": "object", "type": "object",
"properties": { "properties": {

View file

@ -2055,6 +2055,7 @@
updateNaggleFlags |= flags; updateNaggleFlags |= flags;
if (updateNaggleTimer == null) { if (updateNaggleTimer == null) {
updateNaggleTimer = setTimeout(function () { updateNaggleTimer = setTimeout(function () {
if (updateNaggleFlags & 1) { onSearchInputChanged(); }
if (updateNaggleFlags & 4) { updateDevices(); updateDeviceDetails(); } if (updateNaggleFlags & 4) { updateDevices(); updateDeviceDetails(); }
if (updateNaggleFlags & 128) { updateMeshes(); } if (updateNaggleFlags & 128) { updateMeshes(); }
updateNaggleTimer = null; updateNaggleTimer = null;
@ -2674,7 +2675,7 @@
function onRealNameCheckBox() { function onRealNameCheckBox() {
showRealNames = Q('RealNameCheckBox').checked; showRealNames = Q('RealNameCheckBox').checked;
putstore('showRealNames', showRealNames ? 1 : 0); putstore('showRealNames', showRealNames ? 1 : 0);
mainUpdate(4); mainUpdate(5);
} }
function onOnlineCheckBox(e) { function onOnlineCheckBox(e) {
@ -2763,15 +2764,13 @@
try { try {
var rs = x.split(/\s+/).join('|'), rx = new RegExp(rs); // In some cases (like +), this can throw an exception. var rs = x.split(/\s+/).join('|'), rx = new RegExp(rs); // In some cases (like +), this can throw an exception.
for (var d in nodes) { for (var d in nodes) {
nodes[d].v = (rx.test(nodes[d].name.toLowerCase())) || (nodes[d].rnamel != null && rx.test(nodes[d].rnamel.toLowerCase())); if (features2 & 0x00008000) {
if ((nodes[d].v == false) && nodes[d].tags) { nodes[d].v = (rx.test(nodes[d].name.toLowerCase())) || ((nodes[d].rnamel != null) && rx.test(nodes[d].rnamel.toLowerCase()));
for (var s in nodes[d].tags) {
if (rx.test(nodes[d].tags[s].toLowerCase())) {
nodes[d].v = true;
break;
} else { } else {
nodes[d].v = false; if (showRealNames) {
} nodes[d].v = (nodes[d].rnamel != null) && rx.test(nodes[d].rnamel.toLowerCase());
} else {
nodes[d].v = rx.test(nodes[d].name.toLowerCase());
} }
} }
} }

View file

@ -5577,12 +5577,16 @@
try { try {
var rs = x.split(/\s+/).join('|'), rx = new RegExp(rs); // In some cases (like +), this can throw an exception. var rs = x.split(/\s+/).join('|'), rx = new RegExp(rs); // In some cases (like +), this can throw an exception.
for (var d in nodes) { for (var d in nodes) {
if (features2 & 0x00008000) { // Both server and client names must match
if (rx.test(nodes[d].name.toLowerCase()) || ((nodes[d].rnamel != null) && rx.test(nodes[d].rnamel.toLowerCase()))) { r.push(d); }
} else {
if (showRealNames) { if (showRealNames) {
if (nodes[d].rnamel != null && rx.test(nodes[d].rnamel.toLowerCase())) { r.push(d); } if (nodes[d].rnamel != null && rx.test(nodes[d].rnamel.toLowerCase())) { r.push(d); }
} else { } else {
if (rx.test(nodes[d].name.toLowerCase())) { r.push(d); } if (rx.test(nodes[d].name.toLowerCase())) { r.push(d); }
} }
} }
}
} catch (ex) { for (var d in nodes) { r.push(d); } } } catch (ex) { for (var d in nodes) { r.push(d); } }
} }

View file

@ -2846,6 +2846,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
if (domain.clipboardset == false) { features2 += 0x00001000; } // Disable clipboard set if (domain.clipboardset == false) { features2 += 0x00001000; } // Disable clipboard set
if ((typeof domain.desktop == 'object') && (domain.desktop.viewonly == true)) { features2 += 0x00002000; } // Indicates remote desktop is viewonly if ((typeof domain.desktop == 'object') && (domain.desktop.viewonly == true)) { features2 += 0x00002000; } // Indicates remote desktop is viewonly
if (domain.mailserver != null) { features2 += 0x00004000; } // Indicates email server is active if (domain.mailserver != null) { features2 += 0x00004000; } // Indicates email server is active
if (domain.devicesearchbarserverandclientname) { features2 += 0x00008000; } // Search bar will find both server name and client name
return { features: features, features2: features2 }; return { features: features, features2: features2 };
} }