diff --git a/meshagent.js b/meshagent.js index 0cf2e548..81ac1973 100644 --- a/meshagent.js +++ b/meshagent.js @@ -467,7 +467,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) { var cmdstr = JSON.stringify(command); for (var userid in obj.parent.wssessions) { // Find all connected users for this mesh and send the message var user = obj.parent.users[userid]; - if (user) { + if ((user != null) && (user.links != null)) { var rights = user.links[obj.dbMeshKey]; if (rights != null) { // TODO: Look at what rights are needed for message routing var sessions = obj.parent.wssessions[userid]; diff --git a/mpsserver.js b/mpsserver.js index e0c583a2..831374b5 100644 --- a/mpsserver.js +++ b/mpsserver.js @@ -135,7 +135,7 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) { if (nodes.length == 0) { if (mesh.mtype == 1) { // Node is not in the database, add it. Credentials will be empty until added by the user. - var device = { type: 'node', mtype: 1, _id: socket.tag.nodeid, meshid: socket.tag.meshid, name: socket.tag.name, host: null, domain: domainid, intelamt: { user: '', pass: '', tls: 0 } }; + var device = { type: 'node', mtype: 1, _id: socket.tag.nodeid, meshid: socket.tag.meshid, name: socket.tag.name, host: null, domain: domainid, intelamt: { user: '', pass: '', tls: 0, state: 2 } }; obj.db.Set(device); // Event the new node @@ -152,7 +152,7 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) { } else { // Node is already present var node = nodes[0]; - if (node.intelamt != undefined) { socket.tag.host = node.intelamt.host; } + if ((node.intelamt != undefined) && (node.intelamt.state == 2)) { socket.tag.host = node.intelamt.host; } } // Add the connection to the MPS connection list @@ -249,7 +249,7 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) { if (nodes.length == 0) { if (mesh.mtype == 1) { // Node is not in the database, add it. Credentials will be empty until added by the user. - var device = { type: 'node', mtype: 1, _id: socket.tag.nodeid, meshid: socket.tag.meshid, name: socket.tag.name, host: null, domain: mesh.domain, intelamt: { user: '', pass: '', tls: 0 } }; + var device = { type: 'node', mtype: 1, _id: socket.tag.nodeid, meshid: socket.tag.meshid, name: socket.tag.name, host: null, domain: mesh.domain, intelamt: { user: '', pass: '', tls: 0, state: 2 } }; obj.db.Set(device); // Event the new node @@ -266,7 +266,7 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) { } else { // Node is already present var node = nodes[0]; - if (node.intelamt != undefined) { socket.tag.host = node.intelamt.host; } + if ((node.intelamt != undefined) && (node.intelamt.state == 2)) { socket.tag.host = node.intelamt.host; } } // Add the connection to the MPS connection list @@ -286,7 +286,7 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) { // Node is present var node = nodes[0]; - if (node.intelamt != undefined) { socket.tag.host = node.intelamt.host; } + if ((node.intelamt != undefined) && (node.intelamt.state == 2)) { socket.tag.host = node.intelamt.host; } socket.tag.nodeid = node._id; socket.tag.meshid = mesh._id; socket.tag.connectTime = Date.now(); @@ -667,7 +667,10 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) { obj.db.Get(socket.tag.nodeid, function (err, nodes) { if (nodes.length != 1) return; var node = nodes[0]; - if ((node.intelamt != undefined) && (node.intelamt.host == host)) return; + + // See if any changes need to be made + console.log(node.intelamt); + if ((node.intelamt != undefined) && (node.intelamt.host == host) && (node.name != '') && (node.intelamt.state == 2)) return; // Get the mesh for this device obj.db.Get(node.meshid, function (err, meshes) { @@ -681,9 +684,10 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) { // Make the change & save if (node.intelamt == undefined) node.intelamt = {}; node.intelamt.host = host; + node.intelamt.state = 2; // Set the state to activated, since this is pretty obvious, we have a CIRA connection. if (node.name == '') { node.name = host.split('.')[0]; } obj.db.Set(node); - + // Event the node change event.msg = 'CIRA changed device ' + node.name + ' from mesh ' + mesh.name + ': ' + changes.join(', '); var node2 = common.Clone(node); diff --git a/package.json b/package.json index 22d130f8..18826cdc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.1.7-x", + "version": "0.1.8-a", "keywords": [ "Remote Management", "Intel AMT", diff --git a/public/images/3bars-30.png b/public/images/3bars-30.png new file mode 100644 index 00000000..c0e54102 Binary files /dev/null and b/public/images/3bars-30.png differ diff --git a/public/images/user-50.png b/public/images/user-50.png new file mode 100644 index 00000000..0ef298ba Binary files /dev/null and b/public/images/user-50.png differ diff --git a/views/default-mobile.handlebars b/views/default-mobile.handlebars index a2679a39..b0377f98 100644 --- a/views/default-mobile.handlebars +++ b/views/default-mobile.handlebars @@ -48,18 +48,30 @@ border-bottom-width: 1px; border-bottom-color: #DDDDDD; } + + .noselect { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + }
-
- {{{title}}} -
-
- {{{title2}}} +
+
+ {{{title}}} +
+
+ {{{title2}}} +
+
@@ -76,8 +88,48 @@ -