mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-28 16:15:54 -05:00
AMT manager improvements.
This commit is contained in:
parent
96f686133a
commit
9f8a5646ee
@ -40,7 +40,8 @@ module.exports.CreateAmtManager = function(parent) {
|
|||||||
|
|
||||||
// Handle server events
|
// Handle server events
|
||||||
obj.HandleEvent = function (source, event, ids, id) {
|
obj.HandleEvent = function (source, event, ids, id) {
|
||||||
if (event.action != 'nodeconnect') return;
|
// React to nodes connecting and disconnecting
|
||||||
|
if (event.action == 'nodeconnect') {
|
||||||
if ((event.conn & 14) != 0) { // connectType: Bitmask, 1 = MeshAgent, 2 = Intel AMT CIRA, 4 = Intel AMT local, 8 = Intel AMT Relay, 16 = MQTT
|
if ((event.conn & 14) != 0) { // connectType: Bitmask, 1 = MeshAgent, 2 = Intel AMT CIRA, 4 = Intel AMT local, 8 = Intel AMT Relay, 16 = MQTT
|
||||||
// We have an OOB connection to Intel AMT, update our information
|
// We have an OOB connection to Intel AMT, update our information
|
||||||
var dev = obj.amtDevices[event.nodeid];
|
var dev = obj.amtDevices[event.nodeid];
|
||||||
@ -56,6 +57,10 @@ module.exports.CreateAmtManager = function(parent) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// React to node being removed
|
||||||
|
if (event.action == 'removenode') { removeDevice(event.nodeid); }
|
||||||
|
}
|
||||||
|
|
||||||
// Remove a device
|
// Remove a device
|
||||||
function removeDevice(nodeid) {
|
function removeDevice(nodeid) {
|
||||||
const dev = obj.amtDevices[nodeid];
|
const dev = obj.amtDevices[nodeid];
|
||||||
|
@ -1472,7 +1472,7 @@
|
|||||||
}
|
}
|
||||||
case 'ifchange': {
|
case 'ifchange': {
|
||||||
// Network interface changed for a device, if we are currently viewing this device, ask for an update.
|
// Network interface changed for a device, if we are currently viewing this device, ask for an update.
|
||||||
if (currentNode._id == message.event.nodeid) { meshserver.send({ action: 'getnetworkinfo', nodeid: currentNode._id }); }
|
if ((currentNode != null) && (currentNode._id == message.event.nodeid)) { meshserver.send({ action: 'getnetworkinfo', nodeid: currentNode._id }); }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'devicesessions': {
|
case 'devicesessions': {
|
||||||
|
@ -2955,7 +2955,7 @@
|
|||||||
}
|
}
|
||||||
case 'ifchange': {
|
case 'ifchange': {
|
||||||
// Network interface changed for a device, if we are currently viewing this device, ask for an update.
|
// Network interface changed for a device, if we are currently viewing this device, ask for an update.
|
||||||
if (currentNode._id == message.event.nodeid) { meshserver.send({ action: 'getnetworkinfo', nodeid: currentNode._id }); }
|
if ((currentNode != null) && (currentNode._id == message.event.nodeid)) { meshserver.send({ action: 'getnetworkinfo', nodeid: currentNode._id }); }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'devicesessions': {
|
case 'devicesessions': {
|
||||||
|
Loading…
Reference in New Issue
Block a user