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

More plugin hooks / development of base

This commit is contained in:
Ryan Blenis 2019-10-08 04:18:40 -04:00
parent 36931698ad
commit d143990f31
6 changed files with 200 additions and 17 deletions

View file

@ -1345,6 +1345,18 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
});
break;
}
case 'plugin': {
if (typeof command.plugin == 'string') {
try {
var pluginHandler = require('./pluginHandler.js').pluginHandler(parent.parent);
pluginHandler.plugins[command.plugin].serveraction(command, obj, parent);
} catch (e) {
console.log('Error loading plugin handler ('+ e + ')');
}
}
break;
}
default: {
parent.agentStats.unknownAgentActionCount++;
console.log('Unknown agent action (' + obj.remoteaddrport + '): ' + command.action + '.');