Kiosk Policy UI

revert-dabc3590
Saad Sahibjan 6 years ago committed by Inosh Perara
parent 278fbccff4
commit db44610c11

@ -196,59 +196,93 @@ var androidOperationModule = function () {
};
break;
case androidOperationConstants["COSU_PROFILE_CONFIGURATION_OPERATION_CODE"]:
payload = {
"cosuProfileRestrictionStartTime": operationPayload["cosuProfileOperationRestrictionEndTime"],
"cosuProfileRestrictionEndTime": operationPayload["cosuProfileOperationRestrictionEndTime"],
"idleMediaURL" : operationPayload["deviceGlobalConfigurations"]["idleMediaURL"],
"kioskBackgroundImage": operationPayload["deviceGlobalConfigurations"]["kioskBackgroundImage"],
"kioskLogoImage" : operationPayload["deviceGlobalConfigurations"]["kioskLogoImage"],
"kioskAppName" : operationPayload["deviceGlobalConfigurations"]["kioskAppName"],
"isIdleGraphicsEnabled" : operationPayload["deviceGlobalConfigurations"]["isIdleGraphicsEnabled"],
"idleTimeout" : operationPayload["deviceGlobalConfigurations"]["idleTimeout"],
"isMultiUserDevice" : operationPayload["deviceGlobalConfigurations"]["isMultiUserDevice"],
"isLoginRequired" : operationPayload["deviceGlobalConfigurations"]["isLoginRequired"],
"displayOrientation" : operationPayload["deviceGlobalConfigurations"]["displayOrientation"],
"primaryURL": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["primaryURL"],
"isTopBarEnabled": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isTopBarEnabled"],
"isAddressBarEnabled": operationPayload["deviceGlobalConfigurations"]["browserProperties"]
["isAddressBarEnabled"],
"showBackController": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["showBackController"],
"isForwardControllerEnabled": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isForwardControllerEnabled"],
"isHomeButtonEnabled": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isHomeButtonEnabled"],
"isReloadEnabled": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isReloadEnabled"],
"lockToPrimaryURL": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["lockToPrimaryURL"],
"isJavascriptEnabled": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isJavascriptEnabled"],
"isTextCopyEnabled": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isTextCopyEnabled"],
"isDownloadsEnabled": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isDownloadsEnabled"],
"isLockedToBrowser": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isLockedToBrowser"],
"isFormAutoFillEnabled": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isFormAutoFillEnabled"],
"isContentAccessEnabled": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isContentAccessEnabled"],
"isFileAccessAllowed": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isFileAccessAllowed"],
"isAllowedUniversalAccessFromFileURLs": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isAllowedUniversalAccessFromFileURLs"],
"isAllowedFileAccessFromFileURLs": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isAllowedFileAccessFromFileURLs"],
"isAppCacheEnabled": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isAppCacheEnabled"],
"appCachePath": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["appCachePath"],
"cacheMode": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["cacheMode"],
"isLoadsImagesAutomatically": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isLoadsImagesAutomatically"],
"isBlockNetworkImage": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isBlockNetworkImage"],
"isBlockNetworkLoads": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isBlockNetworkLoads"],
"isSupportZoomEnabled": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isSupportZoomEnabled"],
"isDisplayZoomControls": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isDisplayZoomControls"],
"textZoom": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["textZoom"],
"defaultFontSize": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["defaultFontSize"],
"defaultTextEncodingName": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["defaultTextEncodingName"],
"isDatabaseEnabled": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isDatabaseEnabled"],
"isDomStorageEnabled": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isDomStorageEnabled"],
"geolocationEnabled": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["geolocationEnabled"],
"isJavaScriptCanOpenWindowsAutomatically": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isJavaScriptCanOpenWindowsAutomatically"],
"isMediaPlaybackRequiresUserGesture": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isMediaPlaybackRequiresUserGesture"],
"isSafeBrowsingEnabled": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isSafeBrowsingEnabled"],
"isUseWideViewPort": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["isUseWideViewPort"],
"userAgentString": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["userAgentString"],
"mixedContentMode": operationPayload["deviceGlobalConfigurations"]["browserProperties"]["mixedContentMode"]
};
payload = {};
payload["isDeviceRestrictOperationTimeEnabled"] =
operationPayload["isDeviceRestrictOperationTimeEnabled"];
payload["isDeviceGlobalConfigEnabled"] = operationPayload["isDeviceGlobalConfigEnabled"];
if (payload["isDeviceRestrictOperationTimeEnabled"] === true) {
payload["cosuProfileRestrictionStartTime"] = operationPayload["cosuProfileRestrictionStartTime"];
payload["cosuProfileRestrictionEndTime"] = operationPayload["cosuProfileRestrictionEndTime"];
}
if (payload["isDeviceGlobalConfigEnabled"] === true) {
var deviceGlobalConfigurations = operationPayload["deviceGlobalConfigurations"];
payload["idleMediaURL"] = deviceGlobalConfigurations["idleMediaURL"];
payload["kioskBackgroundImage"] = deviceGlobalConfigurations["kioskBackgroundImage"];
payload["kioskLogoImage"] = deviceGlobalConfigurations["kioskLogoImage"];
payload["kioskAppName"] = deviceGlobalConfigurations["kioskAppName"];
payload["isIdleGraphicsEnabled"] = deviceGlobalConfigurations["isIdleGraphicsEnabled"];
payload["idleTimeout"] = deviceGlobalConfigurations["idleTimeout"];
payload["isMultiUserDevice"] = deviceGlobalConfigurations["isMultiUserDevice"];
if (payload["isMultiUserDevice"] === true) {
payload["isLoginRequired"] = deviceGlobalConfigurations["isLoginRequired"];
var userAppConfigurations = operationPayload["userAppConfigurations"];
var index;
for (index = 0; index < userAppConfigurations.length; index++) {
userAppConfigurations[index]["visibleAppList"] =
userAppConfigurations[index]["visibleAppList"].map(function (item) {
var packageName = item.trim();
if (packageName && packageName.charAt(0) !== "{") {
var indexValue = packageName.lastIndexOf(":");
if (indexValue > -1) {
packageName = packageName.substring(0, indexValue);
}
}
return packageName;
}).filter(Boolean);
if (userAppConfigurations[index]["username"] === "primaryUser") {
payload["primaryUserApps"] = userAppConfigurations[index]["visibleAppList"];
delete userAppConfigurations[index];
}
}
payload["userAppConfigurations"] = userAppConfigurations.filter(Boolean);
}
payload["displayOrientation"] = deviceGlobalConfigurations["displayOrientation"];
if ("browserProperties" in deviceGlobalConfigurations) {
var browserProperties = deviceGlobalConfigurations["browserProperties"];
payload["isBrowserPropertyEnabled"] = browserProperties["isBrowserPropertyEnabled"];
payload["primaryURL"] = browserProperties["primaryURL"];
payload["isTopBarEnabled"] = browserProperties["isTopBarEnabled"];
payload["isAddressBarEnabled"] = browserProperties["isAddressBarEnabled"];
payload["showBackController"] = browserProperties["showBackController"];
payload["isForwardControllerEnabled"] = browserProperties["isForwardControllerEnabled"];
payload["isHomeButtonEnabled"] = browserProperties["isHomeButtonEnabled"];
payload["isReloadEnabled"] = browserProperties["isReloadEnabled"];
payload["lockToPrimaryURL"] = browserProperties["lockToPrimaryURL"];
payload["isJavascriptEnabled"] = browserProperties["isJavascriptEnabled"];
payload["isTextCopyEnabled"] = browserProperties["isTextCopyEnabled"];
payload["isDownloadsEnabled"] = browserProperties["isDownloadsEnabled"];
payload["isLockedToBrowser"] = browserProperties["isLockedToBrowser"];
payload["isFormAutoFillEnabled"] = browserProperties["isFormAutoFillEnabled"];
payload["isContentAccessEnabled"] = browserProperties["isContentAccessEnabled"];
payload["isFileAccessAllowed"] = browserProperties["isFileAccessAllowed"];
payload["isAllowedUniversalAccessFromFileURLs"] =
browserProperties["isAllowedUniversalAccessFromFileURLs"];
payload["isAllowedFileAccessFromFileURLs"] =
browserProperties["isAllowedFileAccessFromFileURLs"];
payload["isAppCacheEnabled"] = browserProperties["isAppCacheEnabled"];
payload["appCachePath"] = browserProperties["appCachePath"];
payload["cacheMode"] = browserProperties["cacheMode"];
payload["isLoadsImagesAutomatically"] = browserProperties["isLoadsImagesAutomatically"];
payload["isBlockNetworkImage"] = browserProperties["isBlockNetworkImage"];
payload["isBlockNetworkLoads"] = browserProperties["isBlockNetworkLoads"];
payload["isSupportZoomEnabled"] = browserProperties["isSupportZoomEnabled"];
payload["isDisplayZoomControls"] = browserProperties["isDisplayZoomControls"];
payload["textZoom"] = browserProperties["textZoom"];
payload["defaultFontSize"] = browserProperties["defaultFontSize"];
payload["defaultTextEncodingName"] = browserProperties["defaultTextEncodingName"];
payload["isDatabaseEnabled"] = browserProperties["isDatabaseEnabled"];
payload["isDomStorageEnabled"] = browserProperties["isDomStorageEnabled"];
payload["geolocationEnabled"] = browserProperties["geolocationEnabled"];
payload["isJavaScriptCanOpenWindowsAutomatically"] =
browserProperties["isJavaScriptCanOpenWindowsAutomatically"];
payload["isMediaPlaybackRequiresUserGesture"] =
browserProperties["isMediaPlaybackRequiresUserGesture"];
payload["isSafeBrowsingEnabled"] = browserProperties["isSafeBrowsingEnabled"];
payload["isUseWideViewPort"] = browserProperties["isUseWideViewPort"];
payload["userAgentString"] = browserProperties["userAgentString"];
payload["mixedContentMode"] = browserProperties["mixedContentMode"];
}
}
break;
case androidOperationConstants["KIOSK_APPS_CODE"]:
payload = {
@ -445,12 +479,16 @@ var androidOperationModule = function () {
case androidOperationConstants["COSU_PROFILE_CONFIGURATION_OPERATION_CODE"]:
operationType = operationTypeConstants["PROFILE"];
payload = {};
operation = {};
operation["cosuProfileRestrictionStartTime"] =
operationData["cosuProfileOperationRestrictionStartTime"];
operation["cosuProfileRestrictionEndTime"] = operationData["cosuProfileOperationRestrictionEndTime"];
deviceGlobalConfigurations = {};
var operation = {};
operation["isDeviceRestrictOperationTimeEnabled"] =
operationData["isDeviceRestrictOperationTimeEnabled"];
operation["isDeviceGlobalConfigEnabled"] = operationData["isDeviceGlobalConfigEnabled"];
if (operation["isDeviceRestrictOperationTimeEnabled"] === true) {
operation["cosuProfileRestrictionStartTime"] = operationData["cosuProfileRestrictionStartTime"];
operation["cosuProfileRestrictionEndTime"] = operationData["cosuProfileRestrictionEndTime"];
}
if (operationData["isDeviceGlobalConfigEnabled"] === true) {
var deviceGlobalConfigurations = {};
if (operationData["idleMediaURL"]) {
deviceGlobalConfigurations["idleMediaURL"] = operationData["idleMediaURL"];
}
@ -468,11 +506,38 @@ var androidOperationModule = function () {
deviceGlobalConfigurations["idleTimeout"] = operationData["idleTimeout"];
}
deviceGlobalConfigurations["isMultiUserDevice"] = operationData["isMultiUserDevice"];
deviceGlobalConfigurations["isLoginRequired"] = operationData["isLoginRequired"];
deviceGlobalConfigurations["displayOrientation"] = operationData["displayOrientation"];
browserProperties = {};
if (operationData["primaryURL"]) {
if (deviceGlobalConfigurations["isMultiUserDevice"] === true) {
deviceGlobalConfigurations["isLoginRequired"] = operationData["isLoginRequired"];
var storeApps = $("#cosu-profile-app-configs-storeapps").data("storeapps");
var primaryUserApps = {
"username" : "primaryUser",
"visibleAppList" : operationData["primaryUserApps"]
};
var userAppConfigurations = operationData["userAppConfigurations"];
userAppConfigurations.push(primaryUserApps);
var index;
for (index = 0; index < userAppConfigurations.length; index++) {
userAppConfigurations[index]["visibleAppList"] =
userAppConfigurations[index]["visibleAppList"].split(/,(?![^{]*})/)
.map(function (item) {
var packageName = item.trim();
if (packageName) {
var i;
for (i=0; i<storeApps.length; i++) {
if (packageName === storeApps[i]["packageName"]) {
packageName += ":" + storeApps[i]["webUrl"];
}
}
}
return packageName;
}).filter(Boolean);
}
operation["userAppConfigurations"] = operationData["userAppConfigurations"];
}
if (operationData["isBrowserPropertyEnabled"] === true) {
var browserProperties = {};
browserProperties["isBrowserPropertyEnabled"] = true;
browserProperties["primaryURL"] = operationData["primaryURL"];
browserProperties["isTopBarEnabled"] = operationData["isTopBarEnabled"];
browserProperties["isAddressBarEnabled"] = operationData["isAddressBarEnabled"];
@ -488,8 +553,10 @@ var androidOperationModule = function () {
browserProperties["isFormAutoFillEnabled"] = operationData["isFormAutoFillEnabled"];
browserProperties["isContentAccessEnabled"] = operationData["isContentAccessEnabled"];
browserProperties["isFileAccessAllowed"] = operationData["isFileAccessAllowed"];
browserProperties["isAllowedUniversalAccessFromFileURLs"] = operationData["isAllowedUniversalAccessFromFileURLs"];
browserProperties["isAllowedFileAccessFromFileURLs"] = operationData["isAllowedFileAccessFromFileURLs"];
browserProperties["isAllowedUniversalAccessFromFileURLs"] =
operationData["isAllowedUniversalAccessFromFileURLs"];
browserProperties["isAllowedFileAccessFromFileURLs"] =
operationData["isAllowedFileAccessFromFileURLs"];
browserProperties["isAppCacheEnabled"] = operationData["isAppCacheEnabled"];
if (operationData["isAppCacheEnabled"] && operationData["appCachePath"]) {
browserProperties["appCachePath"] = operationData["appCachePath"];
@ -512,8 +579,10 @@ var androidOperationModule = function () {
browserProperties["isDatabaseEnabled"] = operationData["isDatabaseEnabled"];
browserProperties["isDomStorageEnabled"] = operationData["isDomStorageEnabled"];
browserProperties["geolocationEnabled"] = operationData["geolocationEnabled"];
browserProperties["isJavaScriptCanOpenWindowsAutomatically"] = operationData["isJavaScriptCanOpenWindowsAutomatically"];
browserProperties["isMediaPlaybackRequiresUserGesture"] = operationData["isMediaPlaybackRequiresUserGesture"];
browserProperties["isJavaScriptCanOpenWindowsAutomatically"] =
operationData["isJavaScriptCanOpenWindowsAutomatically"];
browserProperties["isMediaPlaybackRequiresUserGesture"] =
operationData["isMediaPlaybackRequiresUserGesture"];
browserProperties["isSafeBrowsingEnabled"] = operationData["isSafeBrowsingEnabled"];
browserProperties["isUseWideViewPort"] = operationData["isUseWideViewPort"];
if (operationData["userAgentString"]) {
@ -523,8 +592,8 @@ var androidOperationModule = function () {
deviceGlobalConfigurations.browserProperties = browserProperties;
}
operation.deviceGlobalConfigurations = deviceGlobalConfigurations;
}
payload.operation = operation;
break;
case androidOperationConstants["SYSTEM_UPDATE_POLICY_CODE"]:
operationType = operationTypeConstants["PROFILE"];
@ -793,6 +862,7 @@ var androidOperationModule = function () {
operationDataObj.val(value);
} else if (operationDataObj.is(":checkbox")) {
operationDataObj.prop("checked", value);
operationDataObj.trigger("change");
} else if (operationDataObj.is(":radio")) {
if (operationDataObj.val() == uiPayload[key]) {
operationDataObj.attr("checked", true);
@ -917,6 +987,7 @@ var androidOperationModule = function () {
var multiColumnKeyValuePair = value[multiColumnKeyValuePairArrayIndex];
var childInputKey = childInput.data("child-key");
var childInputValue = multiColumnKeyValuePair[childInputKey];
// populating extracted value in the UI according to the input type
if (childInput.is(":text") ||
childInput.is("textarea") ||

@ -274,6 +274,18 @@ var validatePolicyProfile = function () {
operation = androidOperationConstants["COSU_PROFILE_CONFIGURATION_OPERATION"];
var continueToCheckNextInputs = true;
var isDeviceGlobalConfigChecked = $("input#cosu-profile-device-global-config").is(":checked");
var isDeviceRestrictOperationChecked = $("input#cosu-profile-device-restrict-operation-time").is(":checked");
if (isDeviceGlobalConfigChecked === false && isDeviceRestrictOperationChecked === false) {
validationStatus = {
"error": true,
"subErrorMsg": "COSU Profile Configuration is empty.",
"erroneousFeature": operation
};
continueToCheckNextInputs = false;
}
if (continueToCheckNextInputs) {
var backgroundImage = $("input#cosu-global-config-kiosk-background-image").val();
if (backgroundImage && !(backgroundImage.endsWith("jpg") || backgroundImage.endsWith("jpeg")
@ -353,6 +365,69 @@ var validatePolicyProfile = function () {
}
}
if (continueToCheckNextInputs) {
var isMultiUser = $("input#cosu-global-config-is-multi-user-device").is(":checked");
if (isMultiUser === true) {
var primaryUserApps = $("input#cosu-user-app-config-primary-user").val();
if (!primaryUserApps) {
validationStatus = {
"error": true,
"subErrorMsg": "Primary user apps are not configured.",
"erroneousFeature": operation
};
continueToCheckNextInputs = false;
}
if (continueToCheckNextInputs) {
var isEmptyInputValue = false;
var cosuUserAppConfig = $("#cosu-user-app-config .child-input");
if ($(cosuUserAppConfig).length === 0) {
validationStatus = {
"error": true,
"subErrorMsg": "Users and apps are not configured for multi users.",
"erroneousFeature": operation
};
continueToCheckNextInputs = false;
} else {
var childInputCount = 0;
var userInputArray = [];
var appInputArray = [];
$(cosuUserAppConfig).each(function () {
childInputCount++;
var childInputValue = $(this).val();
if (!childInputValue) {
isEmptyInputValue = true;
return false;
}
if (childInputCount % 2 === 0) {
appInputArray.push(childInputValue);
} else {
userInputArray.push(childInputValue);
}
});
var uniqueUserInputArray = userInputArray.filter(function (value, index, self) {
return self.indexOf(value) === index;
});
if (userInputArray.length !== uniqueUserInputArray.length) {
validationStatus = {
"error": true,
"subErrorMsg": "Duplicate values exist for username in multi user app configuration.",
"erroneousFeature": operation
};
continueToCheckNextInputs = false;
}
}
if (isEmptyInputValue === true) {
validationStatus = {
"error": true,
"subErrorMsg": "One or more multi user app configurations are empty.",
"erroneousFeature": operation
};
continueToCheckNextInputs = false;
}
}
}
}
if (continueToCheckNextInputs) {
validationStatus = {
"error": false,
@ -830,17 +905,41 @@ var changeAndroidWifiPolicyEAP = function (select, superSelect) {
*/
var changeDivVisibility = function (divId, checkbox) {
if (checkbox.checked) {
document.getElementById(divId).style.display= "block"
document.getElementById(divId).style.display= "block";
} else {
document.getElementById(divId).style.display= "none"
inputs = document.getElementById(divId).getElementsByTagName('input');
for (index = 0; index < inputs.length; ++index) {
if (inputs[index].type == "text") {
inputs[index].value = inputs[index].defaultValue;
} else if (inputs[index].type == "checkbox") {
inputs[index].checked = inputs[index].defaultChecked;
document.getElementById(divId).style.display= "none";
$("#" + divId + " input").each(
function () {
if ($(this).is("input:text")) {
$(this).val(this.defaultValue);
} else if ($(this).is("input:checkbox")) {
$(this).prop("checked", this.defaultChecked);
}
}
);
$("#" + divId + " select").each(
function () {
$(this).val($(this).data("default"));
}
);
$("#" + divId + " .grouped-array-input").each(
function () {
var gridInputs = $(this).find("[data-add-form-clone]");
if (gridInputs.length > 0) {
gridInputs.remove();
}
var helpTexts = $(this).find("[data-help-text=add-form]");
if (helpTexts.length > 0) {
helpTexts.show();
}
}
);
$("#" + divId + " .collapse-config").each(
function() {
this.style.display = "none";
}
);
}
};

@ -1511,28 +1511,33 @@
This policy can be used to configure the profile of COSU Devices.
</div>
</div>
<div id="cosu-profile-configuration-body" class="panel-collapse panel-body collapse"
role="tabpanel"
<div id="cosu-profile-configuration-body" class="panel-collapse panel-body collapse" role="tabpanel"
aria-labelledby="cosu-profile-configuration-body">
<hr/>
<div id="cosu-profile-configuration-feature-error-msg" class="alert alert-danger hidden" role="alert">
<div id="cosu-profile-configuration-feature-error-msg" class="alert alert-danger hidden"
role="alert">
<i class="icon fw fw-error"></i><span></span>
</div>
<div id="cosu-profile-restrict-device-operation-time-configuration" class="panel">
<form class="form-horizontal">
<div class="form-group">
<div class="col-sm-12 form-inline">
<label class="control-label">Restrict device operation time</label>
<label class="switch">
<input type="checkbox" id="gridGuideToggle" data-toggle="collapse"
data-target="#cosu-profile-restrict-operation-time" >
<h2 class="sub-title panel-title"
style="padding: 0px; padding-right:15px; font-size:15px; margin-left:15px;">
Restrict Device Operation Time
<label class="wr-input-control checkbox">
<input id="cosu-profile-device-restrict-operation-time" type="checkbox"
class="non-advance-operation operationDataKeys"
data-key="isDeviceRestrictOperationTimeEnabled"
onchange="changeDivVisibility('cosu-profile-restrict-operation-time', this)"/>
<span class="helper"></span>
<span class="text"></span>
</label>
</div>
</h2>
</div>
<div id="cosu-profile-restrict-operation-time" class="panel-collapse panel-body collapse"
role="tabpanel">
<div class="wr-input-control">
<label class="wr-input-label" for="cosu-profile-configuration-start-time">
<label class="wr-input-label">
Start Time
<span class="helper" title="Start time for the device">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -1540,7 +1545,7 @@
</label>
<select id="cosu-profile-configuration-start-time"
class="form-control operationDataKeys"
data-key="cosuProfileOperationRestrictionStartTime">
data-key="cosuProfileRestrictionStartTime" data-default="480">
<option value="1440">12:00 Midnight</option>
<option value="30">12:30 AM</option>
<option value="60">1:00 AM</option>
@ -1557,7 +1562,7 @@
<option value="390">6:30 AM</option>
<option value="420">7:00 AM</option>
<option value="450">7:30 AM</option>
<option value="480">8:00 AM</option>
<option value="480" selected="selected">8:00 AM</option>
<option value="510">8:30 AM</option>
<option value="540">9:00 AM</option>
<option value="570">9:30 AM</option>
@ -1600,7 +1605,7 @@
</label>
<select id="cosu-profile-configuration-end-time"
class="form-control operationDataKeys"
data-key="cosuProfileOperationRestrictionEndTime" data-default="0">
data-key="cosuProfileRestrictionEndTime" data-default="1020">
<option value="1440">12:00 Midnight</option>
<option value="30">12:30 AM</option>
<option value="60">1:00 AM</option>
@ -1635,7 +1640,7 @@
<option value="930">3:30 PM</option>
<option value="960">4:00 PM</option>
<option value="990">4:30 PM</option>
<option value="1020">5:00 PM</option>
<option value="1020" selected="selected">5:00 PM</option>
<option value="1050">5:30 PM</option>
<option value="1080">6:00 PM</option>
<option value="1110">6:30 PM</option>
@ -1661,14 +1666,18 @@
</div>
</div>
</form>
</div>
<div id="cosu-profile-device-global-configuration" class="panel">
<form class="form-horizontal">
<div class="form-group">
<h2 class="sub-title panel-title"
style="padding: 0px; padding-right:15px; font-size:15px; margin-left:15px;">
Device Global Configuration
<label class="wr-input-control switch" data-toggle="collapse"
data-target="#cosu-profile-device-global-operation">
<input type="checkbox" class="non-advance-operation" />
<label class="wr-input-control checkbox">
<input id="cosu-profile-device-global-config" type="checkbox"
class="non-advance-operation operationDataKeys"
data-key="isDeviceGlobalConfigEnabled"
onchange="changeDivVisibility('cosu-profile-device-global-operation', this)"/>
<span class="helper"></span>
<span class="text"></span>
</label>
@ -1677,17 +1686,18 @@
<div id="cosu-profile-device-global-operation" class="panel-collapse panel-body collapse"
role="tabpanel">
<form class="form-horizontal">
<div class="wr-input-control">
<label class="wr-input-label">
Launcher background image
<span class="helper" title="This is the image that will be displayed in kiosk background.">
<span class="helper"
title="This is the image that will be displayed in kiosk background.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<input id="cosu-global-config-kiosk-background-image" type="text"
class="form-control operationDataKeys" data-key="kioskBackgroundImage"
maxlength="100" placeholder="[ Should be a valid URL of jpg or jpeg or png]"/>
maxlength="100"
placeholder="[ Should be a valid URL of jpg or jpeg or png ]"/>
</div>
<div class="wr-input-control">
<label class="wr-input-label">
@ -1698,8 +1708,8 @@
</label>
<input id="cosu-global-config-kiosk-logo-image" type="text"
class="form-control operationDataKeys" data-key="kioskLogoImage"
maxlength="100" placeholder="[ Should be a valid URL ending with .jpg, .png,
.jpeg"/>
maxlength="100"
placeholder="[ Should be a valid URL ending with .jpg, .png, .jpeg ]"/>
</div>
<div class="wr-input-control">
<label class="wr-input-label">
@ -1712,18 +1722,22 @@
class="form-control operationDataKeys" data-key="kioskAppName"
maxlength="100" placeholder="Name to appear on the agent"/>
</div>
<div class="wr-input-control">
<div id="cosu-profile-idle-media-configuration" class="panel">
<div class="wr-input-control sub-title panel-title"
style="padding: 0px; padding-right:15px; font-size:15px;">
Is idle media enabled
<span class="wr-help-tip glyphicon glyphicon-question-sign"
title="Is idle media enabled"></span>
<label class="wr-input-control checkbox">
<input id="cosu-global-config-is-idle-graphics-enabled" type="checkbox"
class="form-control operationDataKeys" data-key="isIdleGraphicsEnabled"
class="form-control operationDataKeys"
data-key="isIdleGraphicsEnabled"
onchange="changeDivVisibility('idle-properties', this)"/>
<span class="helper" title="Is idle media enabled">
Is idle media enabled
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
<span class="helper"></span>
</label>
</div>
<div id="idle-properties">
<div id="idle-properties"class="panel-collapse panel-body collapse-config"
role="tabpanel" style="display: none;" >
<div class="wr-input-control">
<label class="wr-input-label">
Media to display while idle
@ -1733,9 +1747,9 @@
</label>
<input id="cosu-global-config-idle-media-url" type="text"
class="form-control operationDataKeys" data-key="idleMediaURL"
maxlength="100" placeholder="[ Should be a valid URL ending with .jpg, .png, .jpeg, .mp4, .3gp, .wmv, .mkv ]"/>
maxlength="100"
placeholder="[ Should be a valid URL ending with .jpg, .png, .jpeg, .mp4, .3gp, .wmv, .mkv ]"/>
</div>
<div class="wr-input-control">
<label class="wr-input-label">
Idle graphic begin after(seconds)
@ -1748,38 +1762,132 @@
maxlength="100" placeholder="[ Idle timeout in seconds ]"/>
</div>
</div>
<div class="wr-input-control">
</div>
<!--COSU profile user app configuration-->
<div id="cosu-profile-user-app-configuration" class="panel">
<div class="wr-input-control sub-title panel-title"
style="padding: 0px; padding-right:15px; font-size:15px;">
Is multi-user device
<span class="wr-help-tip glyphicon glyphicon-question-sign"
title="Is multi-user device"></span>
<label class="wr-input-control checkbox">
<input id="cosu-global-config-is-multi-user-device" type="checkbox"
class="form-control operationDataKeys" data-key="isMultiUserDevice"
onchange="changeDivVisibility('cosu-global-config-is-is-login-required-div', this)"/>
<span class="helper" title="Is multi-user device">
Is multi-user device
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
class="form-control operationDataKeys cosu-profile-config"
data-key="isMultiUserDevice"
onchange="changeDivVisibility('cosu-global-config-multi-user-enabled', this)"/>
<span class="helper"></span>
</label>
</div>
<div id="cosu-global-config-is-is-login-required-div">
<div id="cosu-global-config-multi-user-enabled"
class="panel-collapse panel-body collapse-config specific-cosu-global-config-multi-user-enabled"
role="tabpanel" style="display: none;">
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="cosu-global-config-is-is-login-required" type="checkbox"
class="form-control operationDataKeys"
data-key="isLoginRequired"/>
<span class="helper" title="Is login needed for user switch">
data-key="isLoginRequired" checked="checked"/>
<span class="helper" title="Is login needed for user switch.">
Is login needed for user switch
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
</div>
<div>
<ul class="message message-info">
<i class="icon fw fw-info"></i>
<a id="cosu-profile-user-app-configuration-msg">
Provide comma separated package name or web clip details for applications.<br/>
eg: com.google.android.apps.maps, {"identity":"http:entgra.io/","title":"entgra-webclip"}
</a>
</ul>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-label">
Primary User Apps
<span class="helper">
<span class="wr-help-tip glyphicon glyphicon-question-sign"
title="Primary User is the user to which the device is enrolled."></span>
</span>
</label>
<input id="cosu-user-app-config-primary-user" type="text"
class="form-control operationDataKeys"
data-key="primaryUserApps" placeholder="[ Applications ]"/>
</div>
<a href="#cosu-global-config-multi-user-app-config-grid"
class="btn btn-secondary grid-input-add"
data-click-event="add-form">
<span class="icon fw-stack">
<i class="fw fw-add fw-stack-1x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
</span>
Add User Apps
</a>
<div id="cosu-user-app-config"
class="operationDataKeys grouped-array-input multi-column-key-value-pair-array"
data-key="userAppConfigurations" data-column-count="2">
<table class="table table-responsive table-striped">
<thead>
<tr>
<th>No:</th>
<th>User</th>
<th>Applications</th>
<th></th>
</tr>
</thead>
<tbody data-add-form-container="#cosu-global-config-multi-user-app-config-grid">
<tr data-help-text="add-form">
<td colspan="4">
No entries added yet.
</td>
</tr>
</tbody>
</table>
<table class="template hidden">
<tbody data-add-form="#cosu-global-config-multi-user-app-config-grid">
<tr data-add-form-element="clone">
<td data-title="No:">
<span class="index"></span>
</td>
<td data-title="User">
<input type="text" class="form-control grid-input-text"
data-child-key="username"
maxlength="100" placeholder="[ username ]"/>
</td>
<td data-title="Applications">
<input type="text" class="form-control grid-input-text"
rows="2" data-child-key="visibleAppList"
title="visibleAppList">
</td>
<td>
<span class="list-group-item-actions">
<a href="#cosu-global-config-multi-user-app-config-grid"
class="grid-input-remove"
data-click-event="remove-form">
<span class="fw-stack helper" title="Remove Entry">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-delete fw-stack-1x"></i>
</span>
</a>
</span>
</td>
</tr>
</tbody>
</table>
</div>
<span id="cosu-profile-app-configs-storeapps"
data-storeapps="{{json storeapps}}" hidden></span>
</div>
</div>
<!--COSU profile user app configuration-->
<div class="wr-input-control">
<label class="wr-input-label">
Device display orientation
<span class="helper" title="Device display orientation">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<select id="cosu-profile-orientation"
<select id="cosu-profile-display-orientation"
class="form-control operationDataKeys"
data-key="displayOrientation" data-default="auto">
<option value="auto">Auto</option>
@ -1787,20 +1895,21 @@
<option value="landscape">Landscape</option>
</select>
</div>
<br><br>
<div class="form-group">
<h2 class="col-sm-12 form-inline sub-title panel-title"
style="padding: 0px; padding-right:15px; font-size:13px; margin-left:10px;">
Browser Properties
<label class="wr-input-control switch" data-toggle="collapse"
data-target="#cosu-browser-property">
<input type="checkbox" />
<div id="cosu-profile-browser-property-configurations" class="panel">
<div class="wr-input-control sub-title panel-title"
style="padding: 0px; padding-right:15px; font-size:15px;">
Enable Browser Properties
<span class="wr-help-tip glyphicon glyphicon-question-sign"
title="Browser Properties"></span>
<label class="wr-input-control checkbox">
<input type="checkbox"
onchange="changeDivVisibility('cosu-browser-property', this)"
data-key="isBrowserPropertyEnabled"
class="form-control operationDataKeys"/>
<span class="helper"></span>
<span class="text"></span>
</label>
</h2>
</div>
<div id="cosu-browser-property" class="panel-collapse panel-body collapse"
<div id="cosu-browser-property" class="panel-collapse panel-body collapse collapse-config"
role="tabpanel">
<div class="wr-input-control">
<label class="wr-input-label">
@ -1818,7 +1927,8 @@
<input id="cosu-browser-property-top-bar-enabled" type="checkbox"
class="form-control operationDataKeys"
data-key="isTopBarEnabled"/>
<span class="helper" title="Enabled top control bar that displays all the controllers such as address bar, home button and forwards controllers">
<span class="helper"
title="Enabled top control bar that displays all the controllers such as address bar, home button and forwards controllers">
Enabled top control bar
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
@ -1886,7 +1996,7 @@
<label class="wr-input-control checkbox">
<input id="cosu-browser-property-lock-to-primary-url" type="checkbox"
class="form-control operationDataKeys"
data-key="lockToPrimaryURL"/>
data-key="lockToPrimaryURL" checked />
<span class="helper" title="Only allowed to visit the pirmary url.">
Only allowed to visit the pirmary url
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -1898,7 +2008,7 @@
<label class="wr-input-control checkbox">
<input id="cosu-browser-property-is-javascript-enabled" type="checkbox"
class="form-control operationDataKeys"
data-key="isJavascriptEnabled"/>
data-key="isJavascriptEnabled" checked />
<span class="helper" title="Is javascript enabled.">
Is javascript enabled
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -2034,7 +2144,7 @@
<label class="wr-input-control checkbox">
<input id="cosu-browser-property-is-loads-images-automatically" type="checkbox"
class="form-control operationDataKeys"
data-key="isLoadsImagesAutomatically"/>
data-key="isLoadsImagesAutomatically" checked />
<span class="helper" title="Sets whether the browser should load image resources(through network and cached). Note that this method controls loading of all images, including those embedded using the data URI scheme.">
Should load images
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -2067,7 +2177,7 @@
<label class="wr-input-control checkbox">
<input id="cosu-browser-property-is-support-zoom-enabled" type="checkbox"
class="form-control operationDataKeys"
data-key="isSupportZoomEnabled"/>
data-key="isSupportZoomEnabled" checked />
<span class="helper" title="Sets whether the browser should support zooming using its on-screen zoom controls and gestures.">
Support zooming
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -2168,7 +2278,7 @@
<label class="wr-input-control checkbox">
<input id="cosu-browser-property-is-media-playback-requires-user-gesture" type="checkbox"
class="form-control operationDataKeys"
data-key="isMediaPlaybackRequiresUserGesture"/>
data-key="isMediaPlaybackRequiresUserGesture" checked/>
<span class="helper" title="Sets whether the browser requires a user gesture to play media. If false, the browser can play media without user consent">
Does media playback requires user consent
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -2179,7 +2289,7 @@
<label class="wr-input-control checkbox">
<input id="cosu-browser-property-is-safe-browsing-enabled" type="checkbox"
class="form-control operationDataKeys"
data-key="isSafeBrowsingEnabled"/>
data-key="isSafeBrowsingEnabled" checked/>
<span class="helper" title="Sets whether safe browsing is enabled. Safe browsing allows browser to protect against malware and phishing attacks by verifying the links.">
Is safe browsing enabled
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -2190,7 +2300,7 @@
<label class="wr-input-control checkbox">
<input id="cosu-browser-property-is-use-wide-view-port" type="checkbox"
class="form-control operationDataKeys"
data-key="isUseWideViewPort"/>
data-key="isUseWideViewPort" checked />
<span class="helper" title="Sets whether the browser should enable support for the viewport HTML meta tag or should use a wide viewport. When the value of the setting is false, the layout width is always set to the width of the browser control in device-independent (CSS) pixels. When the value is true and the page contains the viewport meta tag, the value of the width specified in the tag is used. If the page does not contain the tag or does not provide a width, then a wide viewport will be used.">
Use wide view port
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -2226,8 +2336,8 @@
</select>
</div>
</div>
</div>
</form>
<br/>
<div>
<ul class="message message-info">
<i class="icon fw fw-info"></i>
@ -2241,7 +2351,7 @@
</div>
</div>
</div>
</div>
<!--COSU profile configuration-->
<!-- cosu-system-update-policy -->

@ -198,6 +198,48 @@ var switchPaneAgainstValueSetForRadioButtons = function (selectElement, paneIdPr
};
// End of HTML embedded invoke methods
/**
* Pass a div Id and a check box to view or hide div content based on checkbox value
*/
var changeDivVisibility = function (divId, checkbox) {
if (checkbox.checked) {
document.getElementById(divId).style.display= "block";
} else {
document.getElementById(divId).style.display= "none";
$("#" + divId + " input").each(
function () {
if ($(this).is("input:text")) {
$(this).val(this.defaultValue);
} else if ($(this).is("input:checkbox")) {
$(this).prop("checked", this.defaultChecked);
}
}
);
$("#" + divId + " select").each(
function () {
$(this).val($(this).data("default"));
}
);
$("#" + divId + " .grouped-array-input").each(
function () {
var gridInputs = $(this).find("[data-add-form-clone]");
if (gridInputs.length > 0) {
gridInputs.remove();
}
var helpTexts = $(this).find("[data-help-text=add-form]");
if (helpTexts.length > 0) {
helpTexts.show();
}
}
);
$("#" + divId + " .collapse-config").each(
function() {
this.style.display = "none";
}
);
}
};
/**
* This method will display appropriate fields based on wifi type
* @param {object} wifi type select object
@ -254,4 +296,53 @@ $(document).ready(function () {
}
}
});
// add form entry click function for grid inputs
$(advanceOperations).on("click", "[data-click-event=add-form]", function () {
var addFormContainer = $("[data-add-form-container=" + $(this).attr("href") + "]");
var clonedForm = $("[data-add-form=" + $(this).attr("href") + "]").clone().find("[data-add-form-element=clone]")
.attr("data-add-form-clone", $(this).attr("href"));
// adding class .child-input to capture text-input-array-values
$("input, select", clonedForm).addClass("child-input");
$(addFormContainer).append(clonedForm);
setId(addFormContainer);
showHideHelpText(addFormContainer);
});
// remove form entry click function for grid inputs
$(advanceOperations).on("click", "[data-click-event=remove-form]", function () {
var addFormContainer = $("[data-add-form-container=" + $(this).attr("href") + "]");
$(this).closest("[data-add-form-element=clone]").remove();
setId(addFormContainer);
showHideHelpText(addFormContainer);
});
});
/**
* Method to set count id to cloned elements.
* @param {object} addFormContainer
*/
var setId = function (addFormContainer) {
$(addFormContainer).find("[data-add-form-clone]").each(function (i) {
$(this).attr("id", $(this).attr("data-add-form-clone").slice(1) + "-" + (i + 1));
if ($(this).find(".index").length > 0) {
$(this).find(".index").html(i + 1);
}
});
};
/**
* Method to set count id to cloned elements.
* @param {object} addFormContainer
*/
var showHideHelpText = function (addFormContainer) {
var helpText = "[data-help-text=add-form]";
if ($(addFormContainer).find("[data-add-form-clone]").length > 0) {
$(addFormContainer).find(helpText).hide();
} else {
$(addFormContainer).find(helpText).show();
}
};

@ -1119,19 +1119,26 @@
role="tabpanel"
aria-labelledby="cosu-profile-configuration-body">
<hr/>
<div id="cosu-profile-configuration-feature-error-msg" class="alert alert-danger hidden" role="alert">
<div id="cosu-profile-configuration-feature-error-msg" class="alert alert-danger hidden"
role="alert">
<i class="icon fw fw-error"></i><span></span>
</div>
<div id="cosu-profile-restrict-device-operation-time-configuration" class="panel">
<form class="form-horizontal">
<div class="form-group" >
<div class="col-sm-12 form-inline">
<label class="control-label">Restrict device operation time</label>
<label class="switch">
<input type="checkbox" id="gridGuideToggle" data-toggle="collapse"
data-target="#cosu-profile-restrict-operation-time" >
<div class="form-group">
<h2 class="sub-title panel-title"
style="padding: 0px; padding-right:15px; font-size:15px; margin-left:15px;">
Restrict Device Operation Time
<label class="wr-input-control checkbox">
<input id="cosu-profile-device-restrict-operation-time" type="checkbox"
class="non-advance-operation operationDataKeys"
data-key="isDeviceRestrictOperationTimeEnabled"
onchange="changeDivVisibility('cosu-profile-restrict-operation-time', this)"
disabled/>
<span class="helper"></span>
<span class="text"></span>
</label>
</div>
</h2>
</div>
<div id="cosu-profile-restrict-operation-time" class="panel-collapse panel-body collapse"
role="tabpanel">
@ -1144,7 +1151,7 @@
</label>
<select id="cosu-profile-configuration-start-time"
class="form-control operationDataKeys"
data-key="cosuProfileOperationRestrictionStartTime" disabled>
data-key="cosuProfileRestrictionStartTime" data-default="480" disabled>
<option value="1440">12:00 Midnight</option>
<option value="30">12:30 AM</option>
<option value="60">1:00 AM</option>
@ -1204,7 +1211,7 @@
</label>
<select id="cosu-profile-configuration-end-time"
class="form-control operationDataKeys"
data-key="cosuProfileOperationRestrictionEndTime" data-default="0" disabled>
data-key="cosuProfileRestrictionEndTime" data-default="1020" disabled>
<option value="1440">12:00 Midnight</option>
<option value="30">12:30 AM</option>
<option value="60">1:00 AM</option>
@ -1265,14 +1272,19 @@
</div>
</div>
</form>
</div>
<div id="cosu-profile-device-global-configuration" class="panel">
<form class="form-horizontal">
<div class="form-group">
<h2 class="sub-title panel-title"
style="padding: 0px; padding-right:15px; font-size:15px; margin-left:15px;">
Device Global Configuration
<label class="wr-input-control switch hidden" data-toggle="collapse"
data-target="#cosu-profile-device-global-operation">
<input type="checkbox" class="non-advance-operation" />
<label class="wr-input-control checkbox">
<input id="cosu-profile-device-global-config" type="checkbox"
class="non-advance-operation operationDataKeys"
data-key="isDeviceGlobalConfigEnabled"
onchange="changeDivVisibility('cosu-profile-device-global-operation', this)"
disabled/>
<span class="helper"></span>
<span class="text"></span>
</label>
@ -1316,16 +1328,23 @@
maxlength="100" placeholder="Name to appear on the agent" disabled/>
</div>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="cosu-global-config-is-idle-graphics-enabled" type="checkbox"
class="form-control operationDataKeys" data-key="isIdleGraphicsEnabled" disabled/>
<span class="helper" title="Is idle media enabled">
<div id="cosu-profile-idle-media-configuration" class="panel">
<div class="wr-input-control sub-title panel-title"
style="padding: 0px; padding-right:15px; font-size:15px;">
Is idle media enabled
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
<span class="wr-help-tip glyphicon glyphicon-question-sign"
title="Is idle media enabled"></span>
<label class="wr-input-control checkbox">
<input id="cosu-global-config-is-idle-graphics-enabled"
type="checkbox" class="form-control operationDataKeys"
data-key="isIdleGraphicsEnabled"
onchange="changeDivVisibility('idle-properties', this)"
disabled/>
<span class="helper"></span>
</label>
</div>
<div id="idle-properties"class="panel-collapse panel-body collapse-config"
role="tabpanel" style="display: none;" >
<div class="wr-input-control">
<label class="wr-input-label">
Media to display while idle
@ -1335,7 +1354,7 @@
</label>
<input id="cosu-global-config-idle-media-url" type="text"
class="form-control operationDataKeys" data-key="idleMediaURL"
maxlength="100" placeholder="[ Should be a valid URL ending with .jpg, .png, .jpeg, .mp4, .3gp, .wmv, .mkv ]" disabled/>
maxlength="100" placeholder="[ Should be a valid URL ending with .jpg, .png, .jpeg, .mp4, .3gp, .wmv, .mkv ]"/>
</div>
<div class="wr-input-control">
<label class="wr-input-label">
@ -1346,38 +1365,135 @@
</label>
<input id="cosu-browser-property-idle-timeout" type="text"
class="form-control operationDataKeys" data-key="idleTimeout"
maxlength="100" placeholder="[ Idle timeout in seconds ]" disabled/>
maxlength="100" placeholder="[ Idle timeout in seconds ]"/>
</div>
<div class="wr-input-control">
</div>
</div>
<!--COSU profile user app configuration-->
<div id="cosu-profile-user-app-configuration" class="panel">
<div class="wr-input-control sub-title panel-title"
style="padding: 0px; padding-right:15px; font-size:15px;">
Is multi-user device
<span class="wr-help-tip glyphicon glyphicon-question-sign"
title="Is multi-user device"></span>
<label class="wr-input-control checkbox">
<input id="cosu-global-config-is-multi-user-device" type="checkbox"
class="form-control operationDataKeys" data-key="isMultiUserDevice" disabled/>
<span class="helper" title="Is multi-user device">
Is multi-user device
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
class="form-control operationDataKeys cosu-profile-config"
data-key="isMultiUserDevice"
onchange="changeDivVisibility('cosu-global-config-multi-user-enabled', this)"
disabled/>
<span class="helper"></span>
</label>
</div>
<div id="cosu-global-config-multi-user-enabled"
class="panel-collapse panel-body collapse-config"
role="tabpanel" style="display: none;">
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="cosu-global-config-is-is-login-required" type="checkbox"
class="form-control operationDataKeys"
data-key="isLoginRequired" disabled/>
<span class="helper" title="Is re-login required to switch between users.">
Is Login Required Ror User Switch
data-key="isLoginRequired" checked="checked" disabled/>
<span class="helper" title="Is login needed for user switch.">
Is login needed for user switch
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<div>
<ul class="message message-info">
<i class="icon fw fw-info"></i>
<a id="cosu-profile-user-app-configuration-msg">
Provide comma separated package name or web clip details for applications.<br/>
eg: com.google.android.apps.maps, {"identity":"http:entgra.io/","title":"entgra-webclip"}
</a>
</ul>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-label">
Primary User Apps
<span class="helper">
<span class="wr-help-tip glyphicon glyphicon-question-sign"
title="Primary User is the user to which the device is enrolled."></span>
</span>
</label>
<input id="cosu-user-app-config-primary-user" type="text"
class="form-control operationDataKeys"
data-key="primaryUserApps" placeholder="[ Applications ]" disabled/>
</div>
<a href="#cosu-global-config-multi-user-app-config-grid"
class="btn btn-secondary grid-input-add"
data-click-event="add-form" style="display: none;">
<span class="icon fw-stack">
<i class="fw fw-add fw-stack-1x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
</span>
Add User Apps
</a>
<div id="cosu-user-app-config"
class="operationDataKeys grouped-array-input multi-column-key-value-pair-array"
data-key="userAppConfigurations" data-column-count="2">
<table class="table table-responsive table-striped">
<thead>
<tr>
<th>No:</th>
<th>User</th>
<th>Applications</th>
<th></th>
</tr>
</thead>
<tbody data-add-form-container="#cosu-global-config-multi-user-app-config-grid">
<tr data-help-text="add-form">
<td colspan="4">
No entries added yet.
</td>
</tr>
</tbody>
</table>
<table class="template hidden">
<tbody data-add-form="#cosu-global-config-multi-user-app-config-grid">
<tr data-add-form-element="clone">
<td data-title="No:">
<span class="index"></span>
</td>
<td data-title="User">
<input type="text" class="form-control grid-input-text"
data-child-key="username"
maxlength="100" placeholder="[ username ]"
disabled/>
</td>
<td data-title="Applications">
<input type="text" class="form-control grid-input-text" rows="2"
data-child-key="visibleAppList"
title="visibleAppList" disabled>
</td>
<td>
<span class="list-group-item-actions" hidden>
<a href="#cosu-global-config-multi-user-app-config-grid"
class="grid-input-remove"
data-click-event="remove-form">
<span class="fw-stack helper" title="Remove Entry">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-delete fw-stack-1x"></i>
</span>
</a>
</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!--COSU profile user app configuration-->
<div class="wr-input-control">
<label class="wr-input-label">
Device display orientation
<span class="helper" title="Device display orientation">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<select id="cosu-profile-configuration-end-time"
<select id="cosu-profile-display-orientation"
class="form-control operationDataKeys"
data-key="displayOrientation" data-default="auto" disabled>
<option value="auto">Auto</option>
@ -1385,18 +1501,19 @@
<option value="landscape">Landscape</option>
</select>
</div>
<br><br>
<div class="form-group">
<h2 class="col-sm-12 form-inline sub-title panel-title"
style="padding: 0px; padding-right:15px; font-size:13px; margin-left:10px;">
Browser Properties
<label class="wr-input-control switch hidden" data-toggle="collapse"
data-target="#cosu-browser-property">
<input type="checkbox" />
<div id="cosu-profile-browser-property-configurations" class="panel">
<div class="wr-input-control sub-title panel-title"
style="padding: 0px; padding-right:15px; font-size:15px;">
Enable Browser Properties
<span class="wr-help-tip glyphicon glyphicon-question-sign"
title="Browser Properties"></span>
<label class="wr-input-control checkbox">
<input type="checkbox"
onchange="changeDivVisibility('cosu-browser-property', this)"
data-key="isBrowserPropertyEnabled"
class="form-control operationDataKeys" disabled/>
<span class="helper"></span>
<span class="text"></span>
</label>
</h2>
</div>
<div id="cosu-browser-property" class="panel-collapse panel-body collapse"
role="tabpanel">
@ -1825,6 +1942,7 @@
</select>
</div>
</div>
</div>
</form>
<br/>
<div>
@ -1840,6 +1958,7 @@
</div>
</div>
</div>
</div>
<!--COSU profile configuration-->
<!--app-restriction-->

@ -217,6 +217,18 @@ var validatePolicyProfile = function () {
operation = androidOperationConstants["COSU_PROFILE_CONFIGURATION_OPERATION"];
var continueToCheckNextInputs = true;
var isDeviceGlobalConfigChecked = $("input#cosu-profile-device-global-config").is(":checked");
var isDeviceRestrictOperationChecked = $("input#cosu-profile-device-restrict-operation-time").is(":checked");
if (isDeviceGlobalConfigChecked === false && isDeviceRestrictOperationChecked === false) {
validationStatus = {
"error": true,
"subErrorMsg": "COSU Profile Configuration is empty.",
"erroneousFeature": operation
};
continueToCheckNextInputs = false;
}
if (continueToCheckNextInputs) {
var backgroundImage = $("input#cosu-global-config-kiosk-background-image").val();
if (backgroundImage && !(backgroundImage.endsWith("jpg") || backgroundImage.endsWith("jpeg")
@ -296,6 +308,69 @@ var validatePolicyProfile = function () {
}
}
if (continueToCheckNextInputs) {
var isMultiUser = $("input#cosu-global-config-is-multi-user-device").is(":checked");
if (isMultiUser === true) {
var primaryUserApps = $("input#cosu-user-app-config-primary-user").val();
if (!primaryUserApps) {
validationStatus = {
"error": true,
"subErrorMsg": "Primary user apps are not configured.",
"erroneousFeature": operation
};
continueToCheckNextInputs = false;
}
if (continueToCheckNextInputs) {
var isEmptyInputValue = false;
var cosuUserAppConfig = $("#cosu-user-app-config .child-input");
if ($(cosuUserAppConfig).length === 0) {
validationStatus = {
"error": true,
"subErrorMsg": "Users and apps are not configured for multi users.",
"erroneousFeature": operation
};
continueToCheckNextInputs = false;
} else {
var childInputCount = 0;
var userInputArray = [];
var appInputArray = [];
$(cosuUserAppConfig).each(function () {
childInputCount++;
var childInputValue = $(this).val();
if (!childInputValue) {
isEmptyInputValue = true;
return false;
}
if (childInputCount % 2 === 0) {
appInputArray.push(childInputValue);
} else {
userInputArray.push(childInputValue);
}
});
var uniqueUserInputArray = userInputArray.filter(function (value, index, self) {
return self.indexOf(value) === index;
});
if (userInputArray.length !== uniqueUserInputArray.length) {
validationStatus = {
"error": true,
"subErrorMsg": "Duplicate values exist for username in multi user app configuration.",
"erroneousFeature": operation
};
continueToCheckNextInputs = false;
}
}
if (isEmptyInputValue === true) {
validationStatus = {
"error": true,
"subErrorMsg": "One or more multi user app configurations are empty.",
"erroneousFeature": operation
};
continueToCheckNextInputs = false;
}
}
}
}
if (continueToCheckNextInputs) {
validationStatus = {
"error": false,
@ -807,17 +882,40 @@ var changeAndroidWifiPolicyEAP = function (select, superSelect) {
*/
var changeDivVisibility = function (divId, checkbox) {
if (checkbox.checked) {
document.getElementById(divId).style.display= "block"
document.getElementById(divId).style.display= "block";
} else {
document.getElementById(divId).style.display= "none"
inputs = document.getElementById(divId).getElementsByTagName('input');
for (index = 0; index < inputs.length; ++index) {
if (inputs[index].type == "text") {
inputs[index].value = inputs[index].defaultValue;
} else if (inputs[index].type == "checkbox") {
inputs[index].checked = inputs[index].defaultChecked;
document.getElementById(divId).style.display= "none";
$("#" + divId + " input").each(
function () {
if ($(this).is("input:text")) {
$(this).val(this.defaultValue);
} else if ($(this).is("input:checkbox")) {
$(this).prop("checked", this.defaultChecked);
}
}
);
$("#" + divId + " select").each(
function () {
$(this).val($(this).data("default"));
}
);
$("#" + divId + " .grouped-array-input").each(
function () {
var gridInputs = $(this).find("[data-add-form-clone]");
if (gridInputs.length > 0) {
gridInputs.remove();
}
var helpTexts = $(this).find("[data-help-text=add-form]");
if (helpTexts.length > 0) {
helpTexts.show();
}
}
);
$("#" + divId + " .collapse-config").each(
function() {
this.style.display = "none";
}
);
}
};

@ -195,7 +195,7 @@
<label class="wr-input-control checkbox">
<input id="passcode-policy-allow-simple" type="checkbox"
class="form-control operationDataKeys" data-key="passcodePolicyAllowSimple"
checked="checked"/>
checked/>
<span class="helper"
title="Permits repeating, ascending and descending character sequences">
Allow simple value
@ -1249,16 +1249,21 @@
role="alert">
<i class="icon fw fw-error"></i><span></span>
</div>
<div id="cosu-profile-restrict-device-operation-time-configuration" class="panel">
<form class="form-horizontal">
<div class="form-group">
<div class="col-sm-12 form-inline">
<label class="control-label">Restrict device operation time</label>
<label class="switch">
<input type="checkbox" id="gridGuideToggle" data-toggle="collapse"
data-target="#cosu-profile-restrict-operation-time">
<h2 class="sub-title panel-title"
style="padding: 0px; padding-right:15px; font-size:15px; margin-left:15px;">
Restrict Device Operation Time
<label class="wr-input-control checkbox">
<input id="cosu-profile-device-restrict-operation-time" type="checkbox"
class="non-advance-operation operationDataKeys"
data-key="isDeviceRestrictOperationTimeEnabled"
onchange="changeDivVisibility('cosu-profile-restrict-operation-time', this)"/>
<span class="helper"></span>
<span class="text"></span>
</label>
</div>
</h2>
</div>
<div id="cosu-profile-restrict-operation-time" class="panel-collapse panel-body collapse"
role="tabpanel">
@ -1271,7 +1276,7 @@
</label>
<select id="cosu-profile-configuration-start-time"
class="form-control operationDataKeys"
data-key="cosuProfileOperationRestrictionStartTime" data-default="0">
data-key="cosuProfileRestrictionStartTime" data-default="480">
<option value="1440">12:00 Midnight</option>
<option value="30">12:30 AM</option>
<option value="60">1:00 AM</option>
@ -1331,7 +1336,7 @@
</label>
<select id="cosu-profile-configuration-end-time"
class="form-control operationDataKeys"
data-key="cosuProfileOperationRestrictionEndTime" data-default="0">
data-key="cosuProfileRestrictionEndTime" data-default="1020">
<option value="1440">12:00 Midnight</option>
<option value="30">12:30 AM</option>
<option value="60">1:00 AM</option>
@ -1392,14 +1397,18 @@
</div>
</div>
</form>
</div>
<div id="cosu-profile-device-global-configuration" class="panel">
<form class="form-horizontal">
<div class="form-group">
<h2 class="sub-title panel-title"
style="padding: 0px; padding-right:15px; font-size:15px; margin-left:15px;">
Device Global Configuration
<label class="wr-input-control switch" data-toggle="collapse"
data-target="#cosu-profile-device-global-operation">
<input type="checkbox" class="non-advance-operation" />
<label class="wr-input-control checkbox">
<input id="cosu-profile-device-global-config" type="checkbox"
class="non-advance-operation operationDataKeys"
data-key="isDeviceGlobalConfigEnabled"
onchange="changeDivVisibility('cosu-profile-device-global-operation', this)"/>
<span class="helper"></span>
<span class="text"></span>
</label>
@ -1411,13 +1420,15 @@
<div class="wr-input-control">
<label class="wr-input-label">
Launcher background image
<span class="helper" title="This is the image that will be displayed in kiosk background.">
<span class="helper"
title="This is the image that will be displayed in kiosk background.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<input id="cosu-global-config-kiosk-background-image" type="text"
class="form-control operationDataKeys" data-key="kioskBackgroundImage"
maxlength="100" placeholder="[ Should be a valid URL of jpg or jpeg or png ]"/>
maxlength="100"
placeholder="[ Should be a valid URL of jpg or jpeg or png ]"/>
</div>
<div class="wr-input-control">
<label class="wr-input-label">
@ -1428,8 +1439,8 @@
</label>
<input id="cosu-global-config-kiosk-logo-image" type="text"
class="form-control operationDataKeys" data-key="kioskLogoImage"
maxlength="100" placeholder="[ Should be a valid URL ending with .jpg, .png,
.jpeg ]"/>
maxlength="100"
placeholder="[ Should be a valid URL ending with .jpg, .png, .jpeg ]"/>
</div>
<div class="wr-input-control">
<label class="wr-input-label">
@ -1442,19 +1453,22 @@
class="form-control operationDataKeys" data-key="kioskAppName"
maxlength="100" placeholder="Name to appear on the agent"/>
</div>
<div class="wr-input-control">
<div id="cosu-profile-idle-media-configuration" class="panel">
<div class="wr-input-control sub-title panel-title"
style="padding: 0px; padding-right:15px; font-size:15px;">
Is idle media enabled
<span class="wr-help-tip glyphicon glyphicon-question-sign"
title="Is idle media enabled"></span>
<label class="wr-input-control checkbox">
<input id="cosu-global-config-is-idle-graphics-enabled" type="checkbox"
class="form-control operationDataKeys" data-key="isIdleGraphicsEnabled"
class="form-control operationDataKeys"
data-key="isIdleGraphicsEnabled"
onchange="changeDivVisibility('idle-properties', this)"/>
<span class="helper" title="Is idle media enabled">
Is idle media enabled
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
<span class="helper"></span>
</label>
</div>
<div id="idle-properties">
<div id="idle-properties"class="panel-collapse panel-body collapse-config"
role="tabpanel" style="display: none;" >
<div class="wr-input-control">
<label class="wr-input-label">
Media to display while idle
@ -1478,38 +1492,131 @@
maxlength="100" placeholder="[ Idle timeout in seconds ]"/>
</div>
</div>
<div class="wr-input-control">
</div>
<!--COSU profile user app configuration-->
<div id="cosu-profile-user-app-configuration" class="panel">
<div class="wr-input-control sub-title panel-title"
style="padding: 0px; padding-right:15px; font-size:15px;">
Is multi-user device
<span class="wr-help-tip glyphicon glyphicon-question-sign"
title="Is multi-user device"></span>
<label class="wr-input-control checkbox">
<input id="cosu-global-config-is-multi-user-device" type="checkbox"
class="form-control operationDataKeys" data-key="isMultiUserDevice"
onchange="changeDivVisibility('cosu-global-config-is-is-login-required-div', this)"/>/>
<span class="helper" title="Is multi-user device">
Is multi-user device
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
class="form-control operationDataKeys cosu-profile-config"
data-key="isMultiUserDevice"
onchange="changeDivVisibility('cosu-global-config-multi-user-enabled', this)"/>
<span class="helper"></span>
</label>
</div>
<div id="cosu-global-config-is-is-login-required-div">
<div id="cosu-global-config-multi-user-enabled"
class="panel-collapse panel-body collapse-config specific-cosu-global-config-multi-user-enabled" role="tabpanel" style="display: none;">
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="cosu-global-config-is-is-login-required" type="checkbox"
class="form-control operationDataKeys"
data-key="isLoginRequired" checked/>
data-key="isLoginRequired" checked="checked"/>
<span class="helper" title="Is login needed for user switch.">
Is login needed for user switch
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
</div>
<div>
<ul class="message message-info">
<i class="icon fw fw-info"></i>
<a id="cosu-profile-user-app-configuration-msg">
Provide comma separated package name or web clip details for applications.<br/>
eg: com.google.android.apps.maps, {"identity":"http:entgra.io/","title":"entgra-webclip"}
</a>
</ul>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-label">
Primary User Apps
<span class="helper">
<span class="wr-help-tip glyphicon glyphicon-question-sign"
title="Primary User is the user to which the device is enrolled."></span>
</span>
</label>
<input id="cosu-user-app-config-primary-user" type="text"
class="form-control operationDataKeys"
data-key="primaryUserApps" placeholder="[ Applications ]"/>
</div>
<a href="#cosu-global-config-multi-user-app-config-grid"
class="btn btn-secondary grid-input-add"
data-click-event="add-form">
<span class="icon fw-stack">
<i class="fw fw-add fw-stack-1x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
</span>
Add User Apps
</a>
<div id="cosu-user-app-config"
class="operationDataKeys grouped-array-input multi-column-key-value-pair-array"
data-key="userAppConfigurations" data-column-count="2">
<table class="table table-responsive table-striped">
<thead>
<tr>
<th>No:</th>
<th>User</th>
<th>Applications</th>
<th></th>
</tr>
</thead>
<tbody data-add-form-container="#cosu-global-config-multi-user-app-config-grid">
<tr data-help-text="add-form">
<td colspan="4">
No entries added yet.
</td>
</tr>
</tbody>
</table>
<table class="template hidden">
<tbody data-add-form="#cosu-global-config-multi-user-app-config-grid">
<tr data-add-form-element="clone">
<td data-title="No:">
<span class="index"></span>
</td>
<td data-title="User">
<input type="text" class="form-control grid-input-text"
data-child-key="username"
maxlength="100" placeholder="[ Username ]"/>
</td>
<td data-title="Applications">
<input type="text" class="form-control grid-input-text"
rows="2" data-child-key="visibleAppList"
title="visibleAppList" placeholder="[ Applications ]">
</td>
<td>
<span class="list-group-item-actions">
<a href="#cosu-global-config-multi-user-app-config-grid"
class="grid-input-remove"
data-click-event="remove-form">
<span class="fw-stack helper" title="Remove Entry">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-delete fw-stack-1x"></i>
</span>
</a>
</span>
</td>
</tr>
</tbody>
</table>
</div>
<span id="cosu-profile-app-configs-storeapps"
data-storeapps="{{json storeapps}}" hidden></span>
</div>
</div>
<!--COSU profile user app configuration-->
<div class="wr-input-control">
<label class="wr-input-label">
Device display orientation
<span class="helper" title="Device display orientation">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<select id="cosu-profile-configuration-end-time"
<select id="cosu-profile-display-orientation"
class="form-control operationDataKeys"
data-key="displayOrientation" data-default="auto">
<option value="auto">Auto</option>
@ -1517,20 +1624,21 @@
<option value="landscape">Landscape</option>
</select>
</div>
<br><br>
<div class="form-group">
<h2 class="col-sm-12 form-inline sub-title panel-title"
style="padding: 0px; padding-right:15px; font-size:13px; margin-left:10px;">
Browser Properties
<label class="wr-input-control switch" data-toggle="collapse"
data-target="#cosu-browser-property">
<input type="checkbox" />
<div id="cosu-profile-browser-property-configurations" class="panel">
<div class="wr-input-control sub-title panel-title"
style="padding: 0px; padding-right:15px; font-size:15px;">
Enable Browser Properties
<span class="wr-help-tip glyphicon glyphicon-question-sign"
title="Browser Properties"></span>
<label class="wr-input-control checkbox">
<input type="checkbox"
onchange="changeDivVisibility('cosu-browser-property', this)"
data-key="isBrowserPropertyEnabled"
class="form-control operationDataKeys"/>
<span class="helper"></span>
<span class="text"></span>
</label>
</h2>
</div>
<div id="cosu-browser-property" class="panel-collapse panel-body collapse"
<div id="cosu-browser-property" class="panel-collapse panel-body collapse collapse-config"
role="tabpanel">
<div class="wr-input-control">
<label class="wr-input-label">
@ -1956,8 +2064,8 @@
</select>
</div>
</div>
</div>
</form>
<br/>
<div>
<ul class="message message-info">
<i class="icon fw fw-info"></i>
@ -1971,6 +2079,7 @@
</div>
</div>
</div>
</div>
<!--COSU profile configuration-->
<!-- VPN -->

Loading…
Cancel
Save