Adding emm policy view UI

revert-dabc3590
dilanua 8 years ago
parent aada09de10
commit 935b429198

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
@ -10,8 +10,8 @@
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
@ -23,6 +23,8 @@ var stepBackFrom = {};
var policy = {};
var configuredOperations = [];
var base_api_url = "/api/device-mgt/v1.0";
// Constants to define platform types available
var platformTypeConstants = {
"ANDROID": "android",
@ -102,8 +104,7 @@ var updateGroupedInputVisibility = function (domElement) {
skipStep["policy-platform"] = function (policyPayloadObj) {
policy["name"] = policyPayloadObj["policyName"];
policy["platform"] = policyPayloadObj["profile"]["deviceType"]["name"];
policy["platformId"] = policyPayloadObj["profile"]["deviceType"]["id"];
policy["platform"] = policyPayloadObj["profile"]["deviceType"];
var userRoleInput = $("#user-roles-input");
var ownershipInput = $("#ownership-input");
var userInput = $("#users-select-field");
@ -1788,7 +1789,7 @@ var updatePolicy = function (policy, state) {
if (policy["profile"].hasOwnProperty(key)) {
profilePayloads.push({
"featureCode": key,
"deviceTypeId": policy["platformId"],
"deviceType": policy["platform"],
"content": policy["profile"][key]
});
}
@ -1800,9 +1801,7 @@ var updatePolicy = function (policy, state) {
"ownershipType": policy["selectedOwnership"],
"profile": {
"profileName": policy["policyName"],
"deviceType": {
"id": policy["platformId"]
},
"deviceType": policy["platform"],
"profileFeaturesList": profilePayloads
}
};
@ -1815,7 +1814,7 @@ var updatePolicy = function (policy, state) {
payload["users"] = [];
payload["roles"] = [];
}
var serviceURL = "/devicemgt_admin/policies/" + getParameterByName("id");
var serviceURL = base_api_url + "/policies/" + getParameterByName("id");
invokerUtil.put(
serviceURL,
payload,
@ -1824,7 +1823,7 @@ var updatePolicy = function (policy, state) {
if (state == "save") {
var policyList = [];
policyList.push(getParameterByName("id"));
serviceURL = "/devicemgt_admin/policies/inactivate";
serviceURL = base_api_url + "/policies/deactivate-policy";
invokerUtil.put(
serviceURL,
policyList,
@ -1841,7 +1840,7 @@ var updatePolicy = function (policy, state) {
} else if (state == "publish") {
var policyList = [];
policyList.push(getParameterByName("id"));
serviceURL = "/devicemgt_admin/policies/activate";
serviceURL = base_api_url + "/policies/activate-policy";
invokerUtil.put(
serviceURL,
policyList,
@ -1882,6 +1881,10 @@ var showAdvanceOperation = function (operation, button) {
*/
var slideDownPaneAgainstValueSet = function (selectElement, paneID, valueSet) {
var selectedValueOnChange = $(selectElement).find("option:selected").val();
if ($(selectElement).is("input:checkbox")) {
selectedValueOnChange = $(selectElement).is(":checked").toString();
}
var i, slideDownVotes = 0;
for (i = 0; i < valueSet.length; i++) {
if (selectedValueOnChange == valueSet[i]) {
@ -1979,6 +1982,36 @@ var showHideHelpText = function (addFormContainer) {
}
};
/**
* This method will display appropriate fields based on wifi type
* @param {object} wifi type select object
*/
var changeAndroidWifiPolicy = function (select) {
slideDownPaneAgainstValueSet(select, 'control-wifi-password', ['wep', 'wpa', '802eap']);
slideDownPaneAgainstValueSet(select, 'control-wifi-eap', ['802eap']);
slideDownPaneAgainstValueSet(select, 'control-wifi-phase2', ['802eap']);
slideDownPaneAgainstValueSet(select, 'control-wifi-identity', ['802eap']);
slideDownPaneAgainstValueSet(select, 'control-wifi-anoidentity', ['802eap']);
slideDownPaneAgainstValueSet(select, 'control-wifi-cacert', ['802eap']);
};
/**
* This method will display appropriate fields based on wifi EAP type
* @param {object} wifi eap select object
* @param {object} wifi type select object
*/
var changeAndroidWifiPolicyEAP = function (select, superSelect) {
slideDownPaneAgainstValueSet(select, 'control-wifi-password', ['peap', 'ttls', 'pwd' , 'fast', 'leap']);
slideDownPaneAgainstValueSet(select, 'control-wifi-phase2', ['peap', 'ttls', 'fast']);
slideDownPaneAgainstValueSet(select, 'control-wifi-provisioning', ['fast']);
slideDownPaneAgainstValueSet(select, 'control-wifi-identity', ['peap', 'tls', 'ttls', 'pwd', 'fast', 'leap']);
slideDownPaneAgainstValueSet(select, 'control-wifi-anoidentity', ['peap', 'ttls']);
slideDownPaneAgainstValueSet(select, 'control-wifi-cacert', ['peap', 'tls', 'ttls']);
if (superSelect.value != '802eap') {
changeAndroidWifiPolicy(superSelect);
}
};
// End of functions related to grid-input-view
/**
@ -2000,17 +2033,17 @@ $(document).ready(function () {
var policyPayloadObj;
invokerUtil.get(
"/devicemgt_admin/policies/" + getParameterByName("id"),
base_api_url + "/policies/" + getParameterByName("id"),
// on success
function (data) {
// console.log("success: " + JSON.stringify(data));
data = JSON.parse(data);
policyPayloadObj = data["responseContent"];
function (data, textStatus, jqXHR) {
if (jqXHR.status == 200 && data) {
policyPayloadObj = JSON.parse(data);
skipStep["policy-platform"](policyPayloadObj);
}
},
// on error
function (data) {
console.log(data);
function (jqXHR) {
console.log(jqXHR);
// should be redirected to an error page
}
);

@ -13,7 +13,7 @@
<span class="wr-hidden-operations-icon fw-stack">
<i class="fw fw-block fw-stack-2x"></i>
</span>
Restrictions on Camera
Restrictions
<span id="camera-configured" class="has-configured status-icon hidden"><i class="fw fw-ok"></i></span>
<span id="camera-ok" class="has-success status-icon hidden"><i class="fw fw-ok"></i></span>
<span class="camera-error status-icon hidden"><i class="fw fw-error"></i></span>
@ -36,6 +36,34 @@
<span id="wifi-ok" class="has-success status-icon hidden"><i class="fw fw-ok"></i></span>
<span id="wifi-error" class="has-error status-icon hidden"><i class="fw fw-error"></i></span>
</a>
<a href="javascript:void(0)" onclick="showAdvanceOperation('vpn', this)">
<span class="wr-hidden-operations-icon fw-stack">
<i class="fw fw-vpn fw-stack-2x"></i>
</span>
Virtual Private Network
<span id="wifi-configured" class="has-configured status-icon hidden"><i class="fw fw-ok"></i></span>
<span id="wifi-ok" class="has-success status-icon hidden"><i class="fw fw-ok"></i></span>
<span id="wifi-error" class="has-error status-icon hidden"><i class="fw fw-error"></i></span>
</a>
<a href="javascript:void(0)" onclick="showAdvanceOperation('work-profile', this)">
<span class="wr-hidden-operations-icon fw-stack">
<i class="fw fw-service fw-stack-2x"></i>
</span>
Work-Profile Configurations
<span id="work-profile-configured" class="has-configured status-icon hidden"><i class="fw fw-ok"></i></span>
<span id="work-profile-ok" class="has-success status-icon hidden"><i class="fw fw-ok"></i></span>
<span id="work-profile-error" class="has-error status-icon hidden"><i class="fw fw-error"></i></span>
</a>
<a href="javascript:void(0)" onclick="showAdvanceOperation('app-restriction', this)">
<span class="fw-stack fw-lg">
<i class="fw fw-application fw-stack-1x"></i>
<i class="fw fw-block fw-stack-2x"></i>
</span>
Applications Restrictions
<span id="app-restriction-configured" class="has-configured status-icon hidden"><i class="fw fw-ok"></i></span>
<span id="app-restriction-ok" class="has-success status-icon hidden"><i class="fw fw-ok"></i></span>
<span id="app-restriction-error" class="has-error status-icon hidden"><i class="fw fw-error"></i></span>
</a>
</div>
<div class="wr-hidden-operations-content col-lg-8">
@ -184,15 +212,15 @@
<div class="panel panel-default operation-data" data-operation="camera" data-operation-code="CAMERA">
<div id="camera-heading" class="panel-heading" role="tab">
<h2 class="sub-title panel-title">
Restrictions on Camera
<label class="wr-input-control switch hidden" data-toggle="collapse" data-target="#camera-body">
Restrictions
<label class="wr-input-control switch" data-toggle="collapse" data-target="#camera-body">
<input type="checkbox"/>
<span class="helper"></span>
<span class="text"></span>
</label>
<hr>
<div class="panel-title-description">
This configuration can be used to restrict the usage of camera on an Android device together with all the applications using the camera.
This configurations can be used to restrict certain settings on an Android device.
Once this configuration profile is installed on a device, corresponding users will not be able
to modify these settings on their devices.
</div>
@ -202,18 +230,431 @@
<div id="camera-feature-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span>
</div>
Un-check following checkbox in case you need to disable camera.
<br>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="camera-enabled" type="checkbox" class="operationDataKeys" data-key="cameraEnabled" checked="checked" disabled/>
<span class="helper" title="Having this checked would enable Usage of phone camera in the device.">
<input id="camera-enabled" type="checkbox" class="operationDataKeys" data-key="cameraEnabled"
checked="checked"/>
<span class="helper"
title="Having this checked would enable Usage of phone camera in the device.">
&nbsp;&nbsp;&nbsp;Allow use of camera
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br><b>
Bellow restrictions will be applied on devices with Android version 5.0 Lollipop onwards only
</b>
<br><br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="volume-adjust-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowAdjustVolumeEnabled"/>
<span class="helper" title="Having this checked would disallow volume adjust.">
&nbsp;&nbsp;&nbsp;Disallow volume adjust
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-configuring-bluetooth-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowConfigBluetooth"/>
<span class="helper" title="Having this checked would disallow configuring bluetooth.">
&nbsp;&nbsp;&nbsp;Disallow configuring bluetooth.
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-configuring-cell-broadcast-enabled" type="checkbox"
class="operationDataKeys"
data-key="disallowConfigCellBroadcasts"/>
<span class="helper" title="Having this checked would disallow configuring cell broadcast.">
&nbsp;&nbsp;&nbsp;Disallow cell broadcast
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-configuring-credentials-enabled" type="checkbox"
class="operationDataKeys"
data-key="disallowConfigCredentials"/>
<span class="helper" title="Having this checked would disallow configuring credentials.">
&nbsp;&nbsp;&nbsp;Disallow configuring credentials
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-configuring-mobile-networkst-enabled" type="checkbox"
class="operationDataKeys"
data-key="disallowConfigMobileNetworks"/>
<span class="helper"
title="Having this checked would disallow configuring mobile networks.">
&nbsp;&nbsp;&nbsp;Disallow configuring mobile networks
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-configuring-tethering-enabled" type="checkbox"
class="operationDataKeys"
data-key="disallowConfigTethering"/>
<span class="helper" title="Having this checked would disallow configuring tethering.">
&nbsp;&nbsp;&nbsp;Disallow configuring tethering
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-configuring-VPN-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowConfigVpn"/>
<span class="helper" title="Having this checked would disallow configuring VPN.">
&nbsp;&nbsp;&nbsp;Disallow configuring VPN
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-configuring-Wifi-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowConfigWifi"/>
<span class="helper" title="Having this checked would disallow configuring Wifi.">
&nbsp;&nbsp;&nbsp;Disallow configuring Wifi
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-configuring-app-control-enabled" type="checkbox"
class="operationDataKeys"
data-key="disallowAppControl"/>
<span class="helper" title="Having this checked would disallow configuring app control.">
&nbsp;&nbsp;&nbsp;Disallow configuring app control
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-create-window-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowCreateWindows"/>
<span class="helper" title="Having this checked would disallow create window.">
&nbsp;&nbsp;&nbsp;Disallow create window
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-cross-profile-copy-paste-enabled" type="checkbox"
class="operationDataKeys"
data-key="disallowCrossProfileCopyPaste"/>
<span class="helper" title="Having this checked would disallow cross profile copy paste.">
&nbsp;&nbsp;&nbsp;Disallow cross profile copy paste
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-debugging-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowDebugging"/>
<span class="helper" title="Having this checked would disallow debugging.">
&nbsp;&nbsp;&nbsp;Disallow debuging
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-factory-reset-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowFactoryReset"/>
<span class="helper" title="Having this checked would disallow factory reset.">
&nbsp;&nbsp;&nbsp;Disallow factory reset
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-add-user-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowAddUser"/>
<span class="helper" title="Having this checked would disallow add user.">
&nbsp;&nbsp;&nbsp;Disallow add user
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-install-apps-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowInstallApps"/>
<span class="helper" title="Having this checked would disallow install apps.">
&nbsp;&nbsp;&nbsp;Disallow install apps
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-installing-from-unknown-enabled" type="checkbox"
class="operationDataKeys"
data-key="disallowInstallUnknownSources"/>
<span class="helper" title="Having this checked would disallow installing from unknown
sources.">
&nbsp;&nbsp;&nbsp;Disallow install from unknown sources
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-modify-accounts-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowModifyAccounts"/>
<span class="helper" title="Having this checked would disallow modify accounts.">
&nbsp;&nbsp;&nbsp;Disallow modify accounts
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-mount-physical-media-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowMountPhysicalMedia"/>
<span class="helper" title="Having this checked would disallow mount physical media.">
&nbsp;&nbsp;&nbsp;Disallow mount physical media
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-network-reset-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowNetworkReset"/>
<span class="helper" title="Having this checked would disallow network reset.">
&nbsp;&nbsp;&nbsp;Disallow network reset
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-outgoing-beam-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowOutgoingBeam"/>
<span class="helper" title="Having this checked would disallow outgoing beam.">
&nbsp;&nbsp;&nbsp;Disallow outgoing beam
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-outgoing-calls-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowOutgoingCalls"/>
<span class="helper" title="Having this checked would disallow outgoing calls.">
&nbsp;&nbsp;&nbsp;Disallow outgoing calls
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-remove-user-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowRemoveUser"/>
<span class="helper" title="Having this checked would disallow remove user.">
&nbsp;&nbsp;&nbsp;Disallow remove user
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-safe-boot-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowSafeBoot"/>
<span class="helper" title="Having this checked would disallow safe boot.">
&nbsp;&nbsp;&nbsp;Disallow safe boot
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-location-sharing-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowLocationSharing"/>
<span class="helper" title="Having this checked would disallow location sharing.">
&nbsp;&nbsp;&nbsp;Disallow location sharing
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-SMS-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowSMS"/>
<span class="helper" title="Having this checked would disallow SMS.">
&nbsp;&nbsp;&nbsp;Disallow SMS
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-uninstall-apps-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowUninstallApps"/>
<span class="helper" title="Having this checked would disallow uninstall apps.">
&nbsp;&nbsp;&nbsp;Disallow uninstall apps
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-unmute-microphone-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowUnmuteMicrophone"/>
<span class="helper" title="Having this checked would disallow unmute microphone.">
&nbsp;&nbsp;&nbsp;Disallow unmute microphone
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-USB-transfer-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowUSBFileTransfer"/>
<span class="helper" title="Having this checked would disallow USB file transfer.">
&nbsp;&nbsp;&nbsp;Disallow USB file transfer
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disallow-parent-profile-app-linking-enabled" type="checkbox"
class="operationDataKeys"
data-key="disallowParentProfileAppLinking"/>
<span class="helper" title="Having this checked would disallow parent profile app linking.">
&nbsp;&nbsp;&nbsp;Disallow parent profile app linking
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="ensure-verifying-apps-enabled" type="checkbox" class="operationDataKeys"
data-key="ensureVerifyApps"/>
<span class="helper" title="Having this checked would ensure verifying apps .">
&nbsp;&nbsp;&nbsp;Ensure verifying apps
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="enable-auto-timing-enabled" type="checkbox" class="operationDataKeys"
data-key="enableAutoTime"/>
<span class="helper" title="Having this checked would enable auto timing .">
&nbsp;&nbsp;&nbsp;Enable auto timing
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disable-screen-capture-enabled" type="checkbox" class="operationDataKeys"
data-key="diableScreenCapture"/>
<span class="helper" title="Having this checked would disable screen capture .">
&nbsp;&nbsp;&nbsp;Disable screen capture
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
<br><b>
Bellow restrictions will be applied on devices with Android version 6.0 Marshmallow onwards only.
</b>
<br><br>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disable-status-bar-enabled" type="checkbox" class="operationDataKeys"
data-key="disableStatusBar"/>
<span class="helper" title="Having this checked would disable status bar .">
&nbsp;&nbsp;&nbsp;Disable status bar
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div>
<br>
</div>
</div>
@ -315,19 +756,276 @@
<input id="wifi-ssid" type="text" class="form-control operationDataKeys" data-key="wifiSSID" maxlength="100" placeholder="[ Required field ]" disabled/>
</div>
<div class="wr-input-control">
<label class="wr-input-label" for="wifi-type">
Security*
<span class="helper"
title="Security type of the wireless network to be configured.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<select class="form-control operationDataKeys" id="wifi-type"
onchange="changeAndroidWifiPolicy(this)" data-key="wifiType" disabled>
<option value="none" selected>None</option>
<option value="wep">WEP</option>
<option value="wpa">WPA/WPA 2 PSK</option>
<option value="802eap">802.1x EAP</option>
</select>
</div>
<div class="wr-input-control" id="control-wifi-eap" style="display:none;">
<label class="wr-input-label" for="wifi-eap">
EAP Method
<span class="helper" title="EAP Method of the wireless network to be configured.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<select class="form-control operationDataKeys" id="wifi-eap"
onchange="changeAndroidWifiPolicyEAP(this, document.getElementById('wifi-type'))" data-key="wifiEAP" disabled>
<option value="peap">PEAP</option>
<option value="tls">TLS</option>
<option value="ttls">TTLS</option>
<option value="pwd">PWD</option>
<option value="sim">SIM</option>
<option value="aka">AKA</option>
</select>
</div>
<div class="wr-input-control" id="control-wifi-phase2" style="display:none;">
<label class="wr-input-label" for="wifi-phase2">
Phase 2 Authentication
<span class="helper"
title="Phase 2 authentication of the wireless network to be configured.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<select class="form-control operationDataKeys" id="wifi-phase2" data-key="wifiPhase2" disabled>
<option value="none">None</option>
<option value="pap">PAP</option>
<option value="mchap">MCHAP</option>
<option value="mchapv2">MCHAPV2</option>
<option value="gtc">GTC</option>
</select>
</div>
<div class="wr-input-control" id="control-wifi-provisioning" style="display:none;">
<label class="wr-input-label" for="wifi-provisioning">
Provisioning
<span class="helper" title="Provisioning of the wireless network to be configured.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<select class="form-control operationDataKeys" id="wifi-provisioning" data-key="wifiProvisioning" disabled>
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>
<div class="wr-input-control" id="control-wifi-identity" style="display:none;">
<label class="wr-input-label" for="wifi-identity">
Identity
<span class="helper" title="Identity of the wireless network to be configured.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<label id="wifiIdentityValidationText" class="wr-input-label hidden">
Identity should be 1-to-30 characters long
</label>
<input id="wifi-identity" type="text" class="form-control operationDataKeys"
data-key="wifiIdentity"
maxlength="100" placeholder="[ Should be 1-to-30 characters long ]" disabled />
</div>
<div class="wr-input-control" id="control-wifi-anoidentity" style="display:none;">
<label class="wr-input-label" for="wifi-anoidentity">
Anonymous Identity
<span class="helper" title="Identity of the wireless network to be configured.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<label id="wifiIdentityValidationText" class="wr-input-label hidden">
Anonymous Identity should be 1-to-30 characters long
</label>
<input id="wifi-anoidentity" type="text" class="form-control operationDataKeys"
data-key="wifiAnoIdentity"
maxlength="100" placeholder="[ Should be 1-to-30 characters long ]" disabled/>
</div>
<div class="wr-input-control" id="control-wifi-password" style="display:none;">
<label class="wr-input-label" for="wifi-password">
Password
<span class="helper" title="Password for the wireless network.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<input id="wifi-password" type="password" class="form-control operationDataKeys" data-key="wifiPassword" maxlength="100" placeholder="[ Optional field ]" disabled/>
<input id="wifi-password" type="password" class="form-control operationDataKeys"
data-key="wifiPassword" maxlength="100" disabled/>
</div>
<!--</div>-->
</div>
</div>
</div>
<!-- /wi-fi -->
<!--app-restriction-->
<div class="wr-hidden-operation" data-operation="app-restriction">
<div class="panel panel-default operation-data" data-operation="app-restriction" data-operation-code="APP-RESTRICTION">
<div id="app-restriction-heading" class="panel-heading" role="tab">
<h2 class="sub-title panel-title">
Application Restriction Settings
<label class="wr-input-control switch hidden" data-toggle="collapse" data-target="#app-restriction-body">
<input type="checkbox" />
<span class="helper"></span>
<span class="text"></span>
</label>
<hr>
<div class="panel-title-description">
This configuration can be used to create a black list or white list of applications.
</div>
</h2>
</div>
<div id="app-restriction-body" class="panel-collapse panel-body collapse" role="tabpanel" aria-labelledby="app-restriction-body">
<div id="app-restriction-feature-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span>
</div>
<select id="app-restriction-type" class="form-control operationDataKeys" data-key="restrictionType" disabled>
<option value="" selected="selected">
None
</option>
<option value="black-list">Black List</option>
<option value="white-list">White List</option>
</select>
<br>
<div class="wr-input-control">
<label class="wr-input-label" for="restricted-applications">
Restricted Application List
<span class="helper" title="Add an application to restrict.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
<br>
<br>
<a href="#restricted-applications-grid" class="grid-input-add hidden" data-click-event="add-form">
<span class="icon fw-stack">
<i class="fw fw-add fw-stack-1x"></i>
<i class="fw fw-ring fw-stack-2x"></i>
</span>
&nbsp;
Add Application
</a>
</label>
<div id="restricted-applications" class="operationDataKeys grouped-array-input multi-column-key-value-pair-array" data-key="restrictedApplications" data-column-count="2">
<table class="table table-responsive table-striped">
<thead>
<tr>
<th>No:</th>
<th>Application Name/Description</th>
<th>Package Name</th>
<th></th>
</tr>
</thead>
<tbody data-add-form-container="#restricted-applications-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="#restricted-applications-grid">
<tr data-add-form-element="clone">
<td data-title="No:">
<span class="index"></span>
</td>
<td data-title="App Name">
<input type="text" class="form-control grid-input-text" data-child-key="appName" maxlength="100" data-default="" placeholder="[ Gmail ]" disabled/>
</td>
<td data-title="Package Name">
<input type="text" class="form-control grid-input-text" data-child-key="packageName" maxlength="100" data-default="" placeholder="[ com.google.android.gm ]" disabled/>
</td>
<td>
<span class="list-group-item-actions hidden">
<a href="#restricted-applications-grid" class="grid-input-remove" data-click-event="remove-form">
<span class="fw-stack helper" title="Remove Entry">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-delete fw-stack-1x"></i>
</span>
</a>
</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!--/app-restriction-->
<!-- VPN -->
<div class="wr-hidden-operation" data-operation="vpn">
<div class="panel panel-default operation-data" data-operation="vpn" data-operation-code="VPN">
<div id="vpn-heading" class="panel-heading" role="tab">
<h2 class="sub-title panel-title">
VPN Settings
<label class="wr-input-control switch hidden" data-toggle="collapse" data-target="#vpn-body">
<input type="checkbox" />
<span class="helper"></span>
<span class="text"></span>
</label>
<hr>
<div class="panel-title-description">
This configurations can be used to configure VPN settings on an Android device.
Once this configuration profile is installed on a device, corresponding users will not be able
to modify these settings on their devices.
</div>
</h2>
</div>
<div id="vpn-body" class="panel-collapse panel-body collapse" role="tabpanel" aria-labelledby="vpn-body">
Please note that * sign represents required fields of data.
<br>
<br>
<div id="vpn-feature-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span>
</div>
<div class="wr-input-control">
<label class="wr-input-label" for="vpn-server-address">
VPN Server Address*
<span class="helper" title="Address of the VPN server to be configured.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<input id="vpn-server-address" type="text" class="form-control operationDataKeys" data-key="serverAddress" maxlength="200" placeholder="[ Should be a valid hostname ]" disabled/>
</div>
<div class="wr-input-control">
<label class="wr-input-label" for="vpn-server-port">
VPN Server Port
<span class="helper" title="Port of the VPN server to be configured.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<input id="vpn-server-port" type="text" class="form-control operationDataKeys" data-key="serverPort" maxlength="100" placeholder="[ Optional field ]" disabled/>
</div>
<div class="wr-input-control">
<label class="wr-input-label" for="vpn-shared-secret">
Shared Secret
<span class="helper" title="Shared secret.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<input id="vpn-shared-secret" type="password" class="form-control operationDataKeys" data-key="sharedSecret" maxlength="100" placeholder="[ Optional field ]" disabled/>
</div>
<div class="wr-input-control">
<label class="wr-input-label" for="vpn-dns">
DNS Server
<span class="helper" title="DNS Server.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<input id="vpn-dns" type="text" class="form-control operationDataKeys" data-key="dnsServer" maxlength="100" placeholder="[ Optional field ]" disabled/>
</div>
</div>
</div>
</div>
<!-- /VPN -->
<!-- install-applications -->
<!--<div class="wr-hidden-operation" data-operation="install-apps">-->
@ -435,5 +1133,95 @@
<!--</div>-->
<!--</div>-->
<!-- /web-clips -->
<!--Work-profile-->
<div class="wr-hidden-operation" data-operation="work-profile">
<div class="panel panel-default operation-data" data-operation="work-profile" data-operation-code="WORK_PROFILE">
<div id="work-profile-policy-heading" class="panel-heading" role="tab">
<h2 class="sub-title panel-title">
Work-Profile Configurations
<label id="work-profile-policy-lbl" class="wr-input-control switch" data-toggle="collapse" data-target="#work-profile-policy-body">
<input type="checkbox" />
<span class="helper"></span>
<span class="text"></span>
</label>
<hr>
<div class="panel-title-description">
The configurations below can be applied to the devices where the agent is running in Android Work-Profile.
</div>
</h2>
</div>
<div id="work-profile-policy-body" class="panel-collapse panel-body collapse" role="tabpanel" aria-labelledby="work-profile-policy-body">
<div id="work-profile-policy-feature-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span>
</div>
<!--<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="work-profile-policy-allow-cross-profile" type="checkbox" class="form-control operationDataKeys" data-key="workProfilePolicyAllowCopyPaste" checked="checked" />
<span class="helper" title="Permit the use of repeating, ascending and descending character sequences">
&nbsp;&nbsp;&nbsp;Allow cross profile copy-paste
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
</div> -->
<div class="wr-input-control">
<label class="wr-input-label" for="work-profile-policy-max-passcode-age-in-days">
Profile Name
<span class="helper" title="Name of the Work-Profile created by EMM Agent">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
<br>
</label>
<input id="work-profile-policy-profile-name" type="text" class="form-control operationDataKeys" data-key="workProfilePolicyProfileName" maxlength="20">
</div>
<div class="wr-input-control">
<label class="wr-input-label" for="work-profile-policy-enable-system-apps">
Enable System Apps
<span class="helper" title="The set of system apps needed to be added to the work-profile">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
<br>
( Should be exact package names seperated by commas. Ex: com.google.android.apps.maps, com.google.android.calculator )
</label>
<textarea id="workProfilePolicyEnableSystemApps" type ="text" class="form-control operationDataKeys" rows="4" data-key="workProfilePolicyEnableSystemApps"></textarea>
</div>
<div class="wr-input-control">
<label class="wr-input-label" for="work-profile-policy-hide-system-apps">
Hide System Apps
<span class="helper" title="The set of system apps needed to be hide in the work-profile">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
<br>
( Should be exact package names seperated by commas. Ex: com.google.android.apps.maps, com.google.android.calculator )
</label>
<textarea id="work-profile-policy-hide-system-apps" class="form-control operationDataKeys" rows="4" data-key="workProfilePolicyHideSystemApps" placeholder=""></textarea>
</div>
<div class="wr-input-control">
<label class="wr-input-label" for="work-profile-policy-unhide-system-apps">
Unhide System Apps
<span class="helper" title="The set of system apps needed to be unhide in the work-profile">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
<br>
( Should be exact package names seperated by commas. Ex: com.google.android.apps.maps, com.google.android.calculator )
</label>
<textarea id="work-profile-policy-unhide-system-apps" class="form-control operationDataKeys" rows="4" data-key="workProfilePolicyUnhideSystemApps" placeholder=""></textarea>
</div>
<div class="wr-input-control">
<label class="wr-input-label" for="passcode-policy-max-passcode-age-in-days">
Enable Google Play Store Apps
<span class="helper" title="The set of apps needed to be installed from Google Playstore to work-profile">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
<br>
( Should be exact package names seperated by commas. Ex: com.google.android.apps.maps, com.google.android.calculator )
</label>
<textarea id="work-profile-policy-install-playstore-apps" class="form-control operationDataKeys" rows="4" data-key="workProfilePolicyEnablePlaystoreApps" placeholder=""></textarea>
</div>
</div>
</div>
</div>
</div>
</div>

@ -27,6 +27,16 @@
<span id="encrypt-storage-ok" class="has-success status-icon hidden"><i class="fw fw-ok"></i></span>
<span id="encrypt-storage-error" class="encryption-error status-icon hidden"><i class="fw fw-error"></i></span>
</a>
<a href="javascript:void(0)" onclick="showAdvanceOperation('app-restriction', this)">
<span class="fw-stack fw-lg">
<i class="fw fw-application fw-stack-1x"></i>
<i class="fw fw-block fw-stack-2x"></i>
</span>
Applications Restrictions
<span id="app-restriction-configured" class="has-configured status-icon hidden"><i class="fw fw-ok"></i></span>
<span id="app-restriction-ok" class="has-success status-icon hidden"><i class="fw fw-ok"></i></span>
<span id="app-restriction-error" class="has-error status-icon hidden"><i class="fw fw-error"></i></span>
</a>
<!--<a href="javascript:void(0)" onclick="showAdvanceOperation('wifi', this)">-->
<!--<span class="wr-hidden-operations-icon fw-stack">-->
<!--<i class="fw fw-wifi fw-stack-2x"></i>-->
@ -282,6 +292,104 @@
</div>
<!-- /encrypt-storage -->
<!--app-restriction-->
<div class="wr-hidden-operation" data-operation="app-restriction">
<div class="panel panel-default operation-data" data-operation="app-restriction" data-operation-code="APP-RESTRICTION">
<div id="app-restriction-heading" class="panel-heading" role="tab">
<h2 class="sub-title panel-title">
Application Restriction Settings
<label class="wr-input-control switch hidden" data-toggle="collapse" data-target="#app-restriction-body">
<input type="checkbox" />
<span class="helper"></span>
<span class="text"></span>
</label>
<hr>
<div class="panel-title-description">
This configuration can be used to create a black list or white list of applications.
</div>
</h2>
</div>
<div id="app-restriction-body" class="panel-collapse panel-body collapse" role="tabpanel" aria-labelledby="app-restriction-body">
<div id="app-restriction-feature-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span>
</div>
<select id="app-restriction-type" class="form-control operationDataKeys" data-key="restrictionType" disabled>
<option value="" selected="selected">
None
</option>
<option value="black-list">Black List</option>
<option value="white-list">White List</option>
</select>
<br>
<div class="wr-input-control">
<label class="wr-input-label" for="restricted-applications">
Restricted Application List
<span class="helper" title="Add an application to restrict.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
<br>
<br>
<a href="#restricted-applications-grid" class="grid-input-add hidden" data-click-event="add-form">
<span class="icon fw-stack">
<i class="fw fw-add fw-stack-1x"></i>
<i class="fw fw-ring fw-stack-2x"></i>
</span>
&nbsp;
Add Application
</a>
</label>
<div id="restricted-applications" class="operationDataKeys grouped-array-input multi-column-key-value-pair-array" data-key="restrictedApplications" data-column-count="2">
<table class="table table-responsive table-striped">
<thead>
<tr>
<th>No:</th>
<th>Application Name/Description</th>
<th>Package Name</th>
<th></th>
</tr>
</thead>
<tbody data-add-form-container="#restricted-applications-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="#restricted-applications-grid">
<tr data-add-form-element="clone">
<td data-title="No:">
<span class="index"></span>
</td>
<td data-title="App Name">
<input type="text" class="form-control grid-input-text" data-child-key="appName" maxlength="100" data-default="" placeholder="[ Application Name or Description ]" disabled/>
</td>
<td data-title="Package Name">
<input type="text" class="form-control grid-input-text" data-child-key="packageName" maxlength="100" data-default="" placeholder="[ Package Name of Application ]" disabled/>
</td>
<td>
<span class="list-group-item-actions hidden">
<a href="#restricted-applications-grid" class="grid-input-remove" data-click-event="remove-form">
<span class="fw-stack helper" title="Remove Entry">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-delete fw-stack-1x"></i>
</span>
</a>
</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!--/app-restriction-->
<!-- wi-fi -->
<!--<div class="wr-hidden-operation" data-operation="wifi">-->
<!--<div class="panel panel-default operation-data" data-operation="wifi" data-operation-code="WIFI">-->

@ -1,20 +1,4 @@
{{!
Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
WSO2 Inc. licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file except
in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
}}
{{#zone "content"}}
{{#defineZone "policy-profile-top"}}
<div class="row wr-device-board">
<div class="col-lg-12 wr-secondary-bar">
@ -29,7 +13,8 @@
<div class="row no-gutter add-padding-5x add-margin-top-5x" style="border: 1px solid #e4e4e4;">
<div class="media">
<div class="media-body asset-desc add-padding-left-5x">
<div style="background: #11375B; color: #fff; padding: 10px; margin-bottom: 5px">Policy Overview
<div style="background: #11375B; color: #fff; padding: 10px; margin-bottom: 5px">
Policy Overview
</div>
{{#defineZone "policy-detail-properties"}}
<table class="table table-responsive table-striped" id="members">
@ -66,9 +51,8 @@
<div id="policy-description" class="panel-title-description"></div>
</div>
<br>
<div style="background: #11375B; color: #fff; padding: 10px; margin-bottom: 5px">Profile
Information
<div style="background: #11375B; color: #fff; padding: 10px; margin-bottom: 5px">
Profile Information
</div>
<div class="add-margin-top-4x">
<div id="policy-profile-main-error-msg" class="alert alert-danger hidden" role="alert">
@ -88,16 +72,17 @@
</div>
</div>
</div>
{{/zone}}
{{#zone "bottomJs"}}
<!--suppress HtmlUnknownTarget -->
<script id="hidden-operations-ios" src="{{@unit.publicUri}}/templates/hidden-operations-ios.hbs"
type="text/x-handlebars-template"></script>
<script id="hidden-operations-android"
src="{{@unit.publicUri}}/templates/hidden-operations-android.hbs"
<!--suppress HtmlUnknownTarget -->
<script id="hidden-operations-android" src="{{@unit.publicUri}}/templates/hidden-operations-android.hbs"
type="text/x-handlebars-template"></script>
<script id="hidden-operations-windows"
src="{{@unit.publicUri}}/templates/hidden-operations-windows.hbs"
<!--suppress HtmlUnknownTarget -->
<script id="hidden-operations-windows" src="{{@unit.publicUri}}/templates/hidden-operations-windows.hbs"
type="text/x-handlebars-template"></script>
{{js "/js/policy-view.js"}}
{{js "js/view.js"}}
{{/zone}}

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
@ -10,16 +10,16 @@
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
function onRequest(context) {
var log = new Log("policy-view-edit-unit backend js");
log.debug("calling policy-view-edit-unit");
var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
context.roles = userModule.getRoles().content;
// var log = new Log("policy-view-edit-unit backend js");
// var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
// context.roles = userModule.getRoles();
return context;
}
Loading…
Cancel
Save