diff --git a/package.json b/package.json index b5fb9918..553665ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.4.6-w", + "version": "0.4.6-x", "keywords": [ "Remote Management", "Intel AMT", diff --git a/sample-config.json b/sample-config.json index da0cd891..f31f8abb 100644 --- a/sample-config.json +++ b/sample-config.json @@ -65,7 +65,7 @@ }, "__MaxInvalidLogin": "Time in minutes, max amount of bad logins from a source IP in the time before logins are rejected.", "MaxInvalidLogin": { "time": 10, "count": 10, "coolofftime": 10 }, - "_plugins": { + "_Plugins": { "enabled": true } }, diff --git a/views/default-mobile.handlebars b/views/default-mobile.handlebars index 78d252c9..5da2ee06 100644 --- a/views/default-mobile.handlebars +++ b/views/default-mobile.handlebars @@ -117,6 +117,14 @@ float: left; } + .m4 { + background: url(../images/images16.png) -128px 0px; + height: 16px; + width: 16px; + border: none; + float: left; + } + .gray { /*filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale");*/ /* Firefox 10+, Firefox on Android */ filter: gray; /* IE6-9 */ @@ -614,6 +622,7 @@ var authCookieRenewTimer = null; var meshserver = null; var xdr = null; + var usergroups = null; var serverinfo = null; var nodes = []; var meshes = {}; @@ -670,6 +679,7 @@ if (authCookieRenewTimer != null) { clearInterval(authCookieRenewTimer); authCookieRenewTimer = null; } } else if (state == 2) { // Fetch list of meshes, nodes, files + meshserver.send({ action: 'usergroups' }); meshserver.send({ action: 'meshes' }); meshserver.send({ action: 'nodes' }); meshserver.send({ action: 'files' }); @@ -755,6 +765,20 @@ updateDevices(); break; } + case 'usergroups': { + var groupCount = 0; + if (Array.isArray(message.ugroups)) { + usergroups = {}; + for (var i in message.ugroups) { groupCount++; usergroups[message.ugroups[i]._id] = message.ugroups[i]; } + if (groupCount == 0) { usergroups = null; } + } else { + usergroups = message.ugroups; + for (var i in message.ugroups) { groupCount++; } + if (groupCount == 0) { usergroups = null; } + } + //masterUpdate(8192); + break; + } case 'files': { filetree = setupBackPointers(message.filetree); updateFiles(); @@ -876,6 +900,34 @@ } break; } + case 'createusergroup': + case 'usergroupchange': { + // User group changed + if (usergroups == null) { usergroups = {}; } + var ugroup = usergroups[message.event.ugrpid]; + if (ugroup == null) { + // This is a new user group for us + usergroups[message.event.ugrpid] = { _id: message.event.ugrpid, name: message.event.name, desc: message.event.desc, domain: message.event.domain, links: message.event.links }; + } else { + // This is an existing user group + ugroup.name = message.event.name; + ugroup.desc = message.event.desc; + ugroup.links = message.event.links; + } + //masterUpdate(8192 + 16384); + break; + } + case 'deleteusergroup': { + // User group removed + if ((usergroups != null) && (usergroups[message.event.ugrpid] != null)) { + delete usergroups[message.event.ugrpid]; + var c = 0; + for (var i in usergroups) { c++; } + if (c == 0) { usergroups = null; } // If user groups is empty, set it to null. + //masterUpdate(8192 + 16384); + } + break; + } case 'createmesh': { // A new mesh was created if (message.event.links[userinfo._id] != null) { // Check if this is a mesh create for a mesh we own. If site administrator, we get all messages so need to ignore some. @@ -1724,11 +1776,11 @@ if (typeof deviceHeaderCount[nodes[i].state] == 'undefined') { deviceHeaderCount[nodes[i].state] = 1; } else { deviceHeaderCount[nodes[i].state]++; } } - // Display all empty meshes, we need to do this because users can add devices to these at any time. + // Display all empty device groups, we need to do this because users can add devices to these at any time. if (sort == 0) { for (var i in meshes) { var mesh = meshes[i]; - if (IsMeshViewable(mesh)) { + if ((displayedMeshes[mesh._id] == null) && (IsMeshViewable(mesh))) { if ((current != '') && (r != '')) { r += ''; } r += '