CSS fixes and CIRA clean up.

This commit is contained in:
Ylian Saint-Hilaire 2019-04-30 13:44:49 -07:00
parent 9af8c78350
commit df02307fec
6 changed files with 22 additions and 29 deletions

View File

@ -146,10 +146,10 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) {
// Fetch the mesh
obj.db.Get(socket.tag.meshid, function (err, meshes) {
if (meshes.length == 1) {
if (meshes.length === 1) {
var mesh = meshes[0];
obj.db.Get(socket.tag.nodeid, function (err, nodes) {
if (nodes.length == 0) {
if (nodes.length !== 1) {
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, state: 2 } };
@ -261,23 +261,16 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) {
socket.tag.connectTime = Date.now();
obj.db.Get(socket.tag.nodeid, function (err, nodes) {
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, state: 2 } };
obj.db.Set(device);
if (nodes.length !== 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, state: 2 } };
obj.db.Set(device);
// Event the new node
var device2 = common.Clone(device);
if (device2.intelamt.pass != null) delete device2.intelamt.pass; // Remove the Intel AMT password before eventing this.
var change = 'CIRA added device ' + socket.tag.name + ' to group ' + mesh.name;
obj.parent.DispatchEvent(['*', socket.tag.meshid], obj, { etype: 'node', action: 'addnode', node: device2, msg: change, domain: mesh.domain });
} else {
// New CIRA connection for unknown node, disconnect.
console.log('CIRA connection for unknown node with incorrect group type. meshid: ' + socket.tag.meshid);
socket.end();
return;
}
// Event the new node
var device2 = common.Clone(device);
if (device2.intelamt.pass != null) delete device2.intelamt.pass; // Remove the Intel AMT password before eventing this.
var change = 'CIRA added device ' + socket.tag.name + ' to group ' + mesh.name;
obj.parent.DispatchEvent(['*', socket.tag.meshid], obj, { etype: 'node', action: 'addnode', node: device2, msg: change, domain: mesh.domain });
} else {
// Node is already present
var node = nodes[0];
@ -292,7 +285,7 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) {
} else if (mesh.mtype == 2) { // If this is a agent mesh, search the mesh for this device UUID
// Intel AMT GUID (socket.tag.SystemId) will be used to search the node
obj.db.getAmtUuidNode(mesh._id, socket.tag.SystemId, function (err, nodes) { // TODO: May need to optimize this request with indexes
if (nodes.length == 0) {
if (nodes.length !== 1) {
// New CIRA connection for unknown node, disconnect.
console.log('CIRA connection for unknown node. groupid: ' + mesh._id + ', uuid: ' + socket.tag.SystemId);
socket.end();
@ -688,7 +681,7 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) {
// Change the device
obj.db.Get(socket.tag.nodeid, function (err, nodes) {
if (nodes.length != 1) return;
if (nodes.length !== 1) return;
var node = nodes[0];
// See if any changes need to be made
@ -696,7 +689,7 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) {
// Get the mesh for this device
obj.db.Get(node.meshid, function (err, meshes) {
if (meshes.length != 1) return;
if (meshes.length !== 1) return;
var mesh = meshes[0];
// Ready the node change event

View File

@ -1,6 +1,6 @@
{
"name": "meshcentral",
"version": "0.3.3-j",
"version": "0.3.3-k",
"keywords": [
"Remote Management",
"Intel AMT",

View File

@ -32,7 +32,7 @@ body {
-ms-grid-rows: 66px 24px 1fr 45px;
grid-template-rows: 66px 24px auto 45px;
-ms-grid-columns: 90px 1fr;
grid-template-columns: 90px repeat(auto-fit, minmax(900px, 1fr));
/*grid-template-columns: 90px repeat(auto-fit, minmax(900px, 1fr));*/
grid-template-areas: "header header" "nav nav" "content content" "footer footer";
}
@ -40,7 +40,7 @@ body {
-ms-grid-rows: 66px 24px 1fr 45px;
grid-template-rows: 66px 24px auto 45px;
-ms-grid-columns: 90px 1fr;
grid-template-columns: 90px repeat(auto-fit, minmax(900px, 1fr));
/*grid-template-columns: 90px repeat(auto-fit, minmax(900px, 1fr));*/
grid-template-areas: "header header" "nav nav" "content content" "footer footer";
}
@ -48,7 +48,7 @@ body {
-ms-grid-rows: 66px minmax(24px, max-content) 1fr 45px;
grid-template-rows: 66px minmax(24px, max-content) auto 45px;
-ms-grid-columns: 90px 1fr;
grid-template-columns: 90px repeat(auto-fit, minmax(900px, 1fr));
/*grid-template-columns: 90px repeat(auto-fit, minmax(900px, 1fr));*/
grid-template-areas: "header header" "nav nav" "content content" "footer footer";
}
@ -101,7 +101,7 @@ body {
background-position-y: 0px;
background-attachment: initial;
background-repeat: no-repeat;
width: 960px;
/*width: 960px;*/
height: 66px;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long