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

Completed device inactive auto-remove feature.

This commit is contained in:
Ylian Saint-Hilaire 2021-08-04 10:55:33 -07:00
parent 047916eb9a
commit 2281a61e30
4 changed files with 114 additions and 3 deletions

View file

@ -5508,6 +5508,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
'nodeconfig': [serverUserCommandNodeConfig, ""],
'print': [serverUserCommandPrint, ""],
'relays': [serverUserCommandRelays, ""],
'removeinactivedevices': [serverUserCommandRemoveInactiveDevices, ""],
'resetserver': [serverUserCommandResetServer, "Causes the server to reset, this is sometimes useful is the config.json file was changed."],
'serverupdate': [serverUserCommandServerUpdate, "Updates server to latest version. Optional version argument to install specific version. Example: serverupdate 0.8.49"],
'setmaxtasks': [serverUserCommandSetMaxTasks, ""],
@ -6231,6 +6232,11 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
if (cmdData.result == '') { cmdData.result = 'No relays.'; }
}
function serverUserCommandRemoveInactiveDevices(cmdData) {
parent.db.removeInactiveDevices();
cmdData.result = 'Ok';
}
function serverUserCommandAutoBackup(cmdData) {
var backupResult = parent.db.performBackup(function (msg) {
try { ws.send(JSON.stringify({ action: 'serverconsole', value: msg, tag: cmdData.command.tag })); } catch (ex) { }