More work on automatic inactive device removal.

This commit is contained in:
Ylian Saint-Hilaire 2021-08-01 10:54:14 -07:00
parent db9e824121
commit 896a613a65
5 changed files with 954 additions and 924 deletions

View File

@ -295,6 +295,7 @@
"footer": { "type": "string", "default": null, "description": "This is a HTML string displayed at the bottom of the web page when a user is logged in." },
"loginfooter": { "type": "string", "default": null, "description": "This is a HTML string displayed at the bottom of the web page when a user is not logged in." },
"guestDeviceSharing": { "type": "boolean", "default": true, "description": "When set to false, the desktop/terminal sharing link feature is not available." },
"autoRemoveInactiveDevices": { "type": "integer", "default": 0, "description": "Number of days a device can be inactive before it's removed. 0 disables this feature. Device group setting will override this value." },
"altMessenging": {
"type": "object",
"properties": {

View File

@ -506,6 +506,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
serverinfo.redirport = args.redirport;
if (parent.parent.webpush != null) { serverinfo.vapidpublickey = parent.parent.webpush.vapidPublicKey; } // Web push public key
if (parent.parent.amtProvisioningServer != null) { serverinfo.amtProvServerMeshId = parent.parent.amtProvisioningServer.meshid; } // Device group that allows for bare-metal Intel AMT activation
if ((typeof domain.autoremoveinactivedevices == 'number') && (domain.autoremoveinactivedevices > 0)) { serverinfo.autoremoveinactivedevices = domain.autoremoveinactivedevices; } // Default number of days before inactive devices are removed
// Build the mobile agent URL, this is used to connect mobile devices
var agentServerName = parent.getWebServerName(domain);

View File

@ -138,6 +138,7 @@
"_meshQuota": 248576,
"minify": true,
"_guestDeviceSharing" : false,
"_AutoRemoveInactiveDevices": 37,
"_loginKey": [ "abc", "123" ],
"_newAccounts": true,
"_newAccountsUserGroups": [ "ugrp//xxxxxxxxxxxxxxxxx" ],

File diff suppressed because it is too large Load Diff

View File

@ -11469,6 +11469,15 @@
}
x += '<div><label><input type=checkbox id=d20expireDevice onchange=p20editmeshfeaturesValidate() ' + ((expire > 0) ? 'checked' : '') + '>' + "Automatically remove inactive devices" + '</label><br></div>';
x += '<div style=margin-left:20px id=d20expireDeviceDev>' + "Inactivate days until removal" + ' <label><input type=number inputmode=numeric onchange=p20editmeshfeaturesValidate() onkeyup=p20editmeshfeaturesValidate() onpaste=p20editmeshfeaturesValidate() onkeydown=p20editmeshfeaturesValidate() maxlength=4 min=1 max=2000 style=width:80px value=\"' + ((expire == 0)?30:expire) + '\" id=d20expireDeviceDays></label><br></div>';
if (serverinfo.autoremoveinactivedevices) {
if (serverinfo.autoremoveinactivedevices == 1) {
x += format('<span style=font-size:x-small;margin-left:6px>' + "By default, inactive devices will be removed after 1 day." + '</span>', serverinfo.autoremoveinactivedevices);
} else {
x += format('<span style=font-size:x-small;margin-left:6px>' + "By default, inactive devices will be removed after {0} days." + '</span>', serverinfo.autoremoveinactivedevices);
}
}
setDialogMode(2, "Edit Device Group Features", 3, p20editmeshfeaturesEx, x);
p20editmeshfeaturesValidate();
}