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

Improvements for automatic device removal, #3089

This commit is contained in:
Ylian Saint-Hilaire 2021-09-01 22:21:39 -07:00
parent a9116c2d26
commit 7d25391f78
2 changed files with 19 additions and 8 deletions

View file

@ -6248,9 +6248,15 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
if (cmdData.result == '') { cmdData.result = 'No relays.'; }
}
// removeinactivedevices showall|showremoved
function serverUserCommandRemoveInactiveDevices(cmdData) {
parent.db.removeInactiveDevices();
cmdData.result = 'Ok';
var arg = cmdData.cmdargs['_'][0];
if ((arg == null) && (arg != 'showremoved') && (arg != 'showall')) {
cmdData.result = 'Usage: removeinactivedevices [showremoved|showall]';
} else {
parent.db.removeInactiveDevices((arg == 'showall'), function (msg) { try { ws.send(JSON.stringify({ action: 'serverconsole', value: msg, tag: cmdData.command.tag })); } catch (ex) { } });
cmdData.result = 'Ok';
}
}
function serverUserCommandAutoBackup(cmdData) {