Web Power Switch operations are now logged.

This commit is contained in:
Ylian Saint-Hilaire 2021-12-31 13:17:17 -08:00
parent 58d97515ab
commit 935ad09129
2 changed files with 5 additions and 3 deletions

View File

@ -2902,7 +2902,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
if (node.mtype == 4) { if (node.mtype == 4) {
// Send out an event to perform turn off command on the port // Send out an event to perform turn off command on the port
//var targets = parent.CreateNodeDispatchTargets(node.meshid, node._id, ['devport-operation', 'server-users', user._id]); //var targets = parent.CreateNodeDispatchTargets(node.meshid, node._id, ['devport-operation', 'server-users', user._id]);
var event = { etype: 'node', userid: user._id, username: user.name, nodeid: node._id, action: 'turnon', domain: domain.id, nolog: 1, portid: node.portid, porttype: node.porttype, portnum: node.portnum, meshid: node.meshid, mtype: node.mtype }; const event = { etype: 'node', userid: user._id, username: user.name, nodeid: node._id, action: 'turnon', domain: domain.id, portid: node.portid, porttype: node.porttype, portnum: node.portnum, meshid: node.meshid, mtype: node.mtype, msgid: 132, msg: "Turn on." };
parent.parent.DispatchEvent([ 'devport-operation' ], obj, event); parent.parent.DispatchEvent([ 'devport-operation' ], obj, event);
return; return;
} }
@ -3072,7 +3072,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
if (node.mtype == 4) { if (node.mtype == 4) {
// Send out an event to perform turn off command on the port // Send out an event to perform turn off command on the port
//var targets = parent.CreateNodeDispatchTargets(node.meshid, node._id, ['devport-operation', 'server-users', user._id]); //var targets = parent.CreateNodeDispatchTargets(node.meshid, node._id, ['devport-operation', 'server-users', user._id]);
var event = { etype: 'node', userid: user._id, username: user.name, nodeid: node._id, action: 'turnoff', domain: domain.id, nolog: 1, portid: node.portid, porttype: node.porttype, portnum: node.portnum, meshid: node.meshid, mtype: node.mtype }; var event = { etype: 'node', userid: user._id, username: user.name, nodeid: node._id, action: 'turnoff', domain: domain.id, portid: node.portid, porttype: node.porttype, portnum: node.portnum, meshid: node.meshid, mtype: node.mtype, msgid: 133, msg: "Turn off." };
parent.parent.DispatchEvent([ 'devport-operation' ], obj, event); parent.parent.DispatchEvent([ 'devport-operation' ], obj, event);
return; return;
} }

View File

@ -13348,7 +13348,9 @@
128: "Account created, name is {0}.", 128: "Account created, name is {0}.",
129: "Removed account display name.", 129: "Removed account display name.",
130: "User notifications changed", 130: "User notifications changed",
131: "Added device share {0} with unlimited time." 131: "Added device share {0} with unlimited time.",
132: "Turn on.",
133: "Turn off."
}; };
// Highlights the device being hovered // Highlights the device being hovered