1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Updated MeshCommander and fixes to message dispatch.

This commit is contained in:
Ylian Saint-Hilaire 2019-07-10 14:27:38 -07:00
parent 5e010273e3
commit abe8e97f24
6 changed files with 911 additions and 909 deletions

4
db.js
View file

@ -31,6 +31,7 @@ module.exports.CreateDB = function (parent, func) {
var expireEventsSeconds = (60 * 60 * 24 * 20); // By default, expire events after 20 days. (Seconds * Minutes * Hours * Days)
var expirePowerEventsSeconds = (60 * 60 * 24 * 10); // By default, expire power events after 10 days. (Seconds * Minutes * Hours * Days)
var expireServerStatsSeconds = (60 * 60 * 24 * 30); // By default, expire power events after 30 days. (Seconds * Minutes * Hours * Days)
const common = require('./common.js');
obj.identifier = null;
obj.dbKey = null;
obj.changeStream = false;
@ -851,6 +852,7 @@ module.exports.CreateDB = function (parent, func) {
// Called when a device group has changed
function dbMeshChange(meshChange, added) {
common.unEscapeLinksFieldName(meshChange.fullDocument);
const mesh = meshChange.fullDocument;
// Update the mesh object in memory
@ -865,7 +867,7 @@ module.exports.CreateDB = function (parent, func) {
delete mesh.type;
delete mesh._id;
if (mesh.amt) { delete mesh.amt.password; } // Remove the Intel AMT password if present
parent.DispatchEvent(['*', mesh._id], obj, mesh);
parent.DispatchEvent(['*', mesh.meshid], obj, mesh);
}
// Called when a user account has changed