Adding emm policy view UI

revert-dabc3590
dilanua 9 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, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * 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, * Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an * software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* KIND, either express or implied. See the License for the * either express or implied. See the License for the
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
@ -23,6 +23,8 @@ var stepBackFrom = {};
var policy = {}; var policy = {};
var configuredOperations = []; var configuredOperations = [];
var base_api_url = "/api/device-mgt/v1.0";
// Constants to define platform types available // Constants to define platform types available
var platformTypeConstants = { var platformTypeConstants = {
"ANDROID": "android", "ANDROID": "android",
@ -102,8 +104,7 @@ var updateGroupedInputVisibility = function (domElement) {
skipStep["policy-platform"] = function (policyPayloadObj) { skipStep["policy-platform"] = function (policyPayloadObj) {
policy["name"] = policyPayloadObj["policyName"]; policy["name"] = policyPayloadObj["policyName"];
policy["platform"] = policyPayloadObj["profile"]["deviceType"]["name"]; policy["platform"] = policyPayloadObj["profile"]["deviceType"];
policy["platformId"] = policyPayloadObj["profile"]["deviceType"]["id"];
var userRoleInput = $("#user-roles-input"); var userRoleInput = $("#user-roles-input");
var ownershipInput = $("#ownership-input"); var ownershipInput = $("#ownership-input");
var userInput = $("#users-select-field"); var userInput = $("#users-select-field");
@ -1788,7 +1789,7 @@ var updatePolicy = function (policy, state) {
if (policy["profile"].hasOwnProperty(key)) { if (policy["profile"].hasOwnProperty(key)) {
profilePayloads.push({ profilePayloads.push({
"featureCode": key, "featureCode": key,
"deviceTypeId": policy["platformId"], "deviceType": policy["platform"],
"content": policy["profile"][key] "content": policy["profile"][key]
}); });
} }
@ -1800,9 +1801,7 @@ var updatePolicy = function (policy, state) {
"ownershipType": policy["selectedOwnership"], "ownershipType": policy["selectedOwnership"],
"profile": { "profile": {
"profileName": policy["policyName"], "profileName": policy["policyName"],
"deviceType": { "deviceType": policy["platform"],
"id": policy["platformId"]
},
"profileFeaturesList": profilePayloads "profileFeaturesList": profilePayloads
} }
}; };
@ -1815,7 +1814,7 @@ var updatePolicy = function (policy, state) {
payload["users"] = []; payload["users"] = [];
payload["roles"] = []; payload["roles"] = [];
} }
var serviceURL = "/devicemgt_admin/policies/" + getParameterByName("id"); var serviceURL = base_api_url + "/policies/" + getParameterByName("id");
invokerUtil.put( invokerUtil.put(
serviceURL, serviceURL,
payload, payload,
@ -1824,7 +1823,7 @@ var updatePolicy = function (policy, state) {
if (state == "save") { if (state == "save") {
var policyList = []; var policyList = [];
policyList.push(getParameterByName("id")); policyList.push(getParameterByName("id"));
serviceURL = "/devicemgt_admin/policies/inactivate"; serviceURL = base_api_url + "/policies/deactivate-policy";
invokerUtil.put( invokerUtil.put(
serviceURL, serviceURL,
policyList, policyList,
@ -1841,7 +1840,7 @@ var updatePolicy = function (policy, state) {
} else if (state == "publish") { } else if (state == "publish") {
var policyList = []; var policyList = [];
policyList.push(getParameterByName("id")); policyList.push(getParameterByName("id"));
serviceURL = "/devicemgt_admin/policies/activate"; serviceURL = base_api_url + "/policies/activate-policy";
invokerUtil.put( invokerUtil.put(
serviceURL, serviceURL,
policyList, policyList,
@ -1882,6 +1881,10 @@ var showAdvanceOperation = function (operation, button) {
*/ */
var slideDownPaneAgainstValueSet = function (selectElement, paneID, valueSet) { var slideDownPaneAgainstValueSet = function (selectElement, paneID, valueSet) {
var selectedValueOnChange = $(selectElement).find("option:selected").val(); var selectedValueOnChange = $(selectElement).find("option:selected").val();
if ($(selectElement).is("input:checkbox")) {
selectedValueOnChange = $(selectElement).is(":checked").toString();
}
var i, slideDownVotes = 0; var i, slideDownVotes = 0;
for (i = 0; i < valueSet.length; i++) { for (i = 0; i < valueSet.length; i++) {
if (selectedValueOnChange == valueSet[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 // End of functions related to grid-input-view
/** /**
@ -2000,17 +2033,17 @@ $(document).ready(function () {
var policyPayloadObj; var policyPayloadObj;
invokerUtil.get( invokerUtil.get(
"/devicemgt_admin/policies/" + getParameterByName("id"), base_api_url + "/policies/" + getParameterByName("id"),
// on success // on success
function (data) { function (data, textStatus, jqXHR) {
// console.log("success: " + JSON.stringify(data)); if (jqXHR.status == 200 && data) {
data = JSON.parse(data); policyPayloadObj = JSON.parse(data);
policyPayloadObj = data["responseContent"];
skipStep["policy-platform"](policyPayloadObj); skipStep["policy-platform"](policyPayloadObj);
}
}, },
// on error // on error
function (data) { function (jqXHR) {
console.log(data); console.log(jqXHR);
// should be redirected to an error page // should be redirected to an error page
} }
); );

@ -1,5 +1,5 @@
<div class="row no-gutter"> <div class="row no-gutter">
<div class="wr-hidden-operations-nav col-lg-4"> <div class="wr-hidden-operations-nav col-lg-4">
<a href="javascript:void(0)" onclick="showAdvanceOperation('passcode-policy', this)" class="selected"> <a href="javascript:void(0)" onclick="showAdvanceOperation('passcode-policy', this)" class="selected">
<span class="wr-hidden-operations-icon fw-stack"> <span class="wr-hidden-operations-icon fw-stack">
<i class="fw fw-key fw-stack-2x"></i> <i class="fw fw-key fw-stack-2x"></i>
@ -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-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> <span id="encrypt-storage-error" class="encryption-error status-icon hidden"><i class="fw fw-error"></i></span>
</a> </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)">--> <!--<a href="javascript:void(0)" onclick="showAdvanceOperation('wifi', this)">-->
<!--<span class="wr-hidden-operations-icon fw-stack">--> <!--<span class="wr-hidden-operations-icon fw-stack">-->
<!--<i class="fw fw-wifi fw-stack-2x"></i>--> <!--<i class="fw fw-wifi fw-stack-2x"></i>-->
@ -54,11 +64,11 @@
<!--</span>--> <!--</span>-->
<!--Web clips--> <!--Web clips-->
<!--</a>--> <!--</a>-->
</div> </div>
<div class="wr-hidden-operations-content col-lg-8"> <div class="wr-hidden-operations-content col-lg-8">
<!-- passcode-policy --> <!-- passcode-policy -->
<div class="wr-hidden-operation" data-operation="passcode-policy" style="display: block"> <div class="wr-hidden-operation" data-operation="passcode-policy" style="display: block">
<div class="panel panel-default operation-data" data-operation="passcode-policy" data-operation-code="PASSCODE_POLICY"> <div class="panel panel-default operation-data" data-operation="passcode-policy" data-operation-code="PASSCODE_POLICY">
<div id="passcode-policy-heading" class="panel-heading" role="tab"> <div id="passcode-policy-heading" class="panel-heading" role="tab">
<h2 class="sub-title panel-title"> <h2 class="sub-title panel-title">
@ -197,11 +207,11 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- /passcode-policy --> <!-- /passcode-policy -->
<!-- camera --> <!-- camera -->
<div class="wr-hidden-operation" data-operation="camera"> <div class="wr-hidden-operation" data-operation="camera">
<div class="panel panel-default operation-data" data-operation="camera" data-operation-code="CAMERA"> <div class="panel panel-default operation-data" data-operation="camera" data-operation-code="CAMERA">
<div id="camera-heading" class="panel-heading" role="tab"> <div id="camera-heading" class="panel-heading" role="tab">
<h2 class="sub-title panel-title"> <h2 class="sub-title panel-title">
@ -238,11 +248,11 @@
<br> <br>
</div> </div>
</div> </div>
</div> </div>
<!-- /camera --> <!-- /camera -->
<!-- encrypt-storage --> <!-- encrypt-storage -->
<div class="wr-hidden-operation" data-operation="encrypt-storage"> <div class="wr-hidden-operation" data-operation="encrypt-storage">
<div class="panel panel-default operation-data" data-operation="encrypt-storage" data-operation-code="ENCRYPT_STORAGE"> <div class="panel panel-default operation-data" data-operation="encrypt-storage" data-operation-code="ENCRYPT_STORAGE">
<div id="encrypt-storage-heading" class="panel-heading" role="tab"> <div id="encrypt-storage-heading" class="panel-heading" role="tab">
<h2 class="sub-title panel-title"> <h2 class="sub-title panel-title">
@ -279,182 +289,280 @@
<br> <br>
</div> </div>
</div> </div>
</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>
<!-- /encrypt-storage --> <div id="app-restriction-body" class="panel-collapse panel-body collapse" role="tabpanel" aria-labelledby="app-restriction-body">
<!-- wi-fi --> <div id="app-restriction-feature-error-msg" class="alert alert-danger hidden" role="alert">
<!--<div class="wr-hidden-operation" data-operation="wifi">--> <i class="icon fw fw-error"></i><span></span>
<!--<div class="panel panel-default operation-data" data-operation="wifi" data-operation-code="WIFI">--> </div>
<!--<div id="wifi-heading" class="panel-heading" role="tab">-->
<!--<h2 class="sub-title panel-title">-->
<!--Wi-Fi Settings-->
<!--<label class="wr-input-control switch" data-toggle="collapse" data-target="#wifi-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 Wi-Fi access 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="wifi-body" class="panel-collapse panel-body collapse" role="tabpanel" aria-labelledby="wifi-body">-->
<!--&lt;!&ndash;<div class="cloneable">&ndash;&gt;-->
<!--&lt;!&ndash;<a href="#" class="multi-view add enabled">&ndash;&gt;-->
<!--&lt;!&ndash;<span class="icon fw-stack">&ndash;&gt;-->
<!--&lt;!&ndash;<i class="fw fw-add fw-stack-1x"></i>&ndash;&gt;-->
<!--&lt;!&ndash;<i class="fw fw-ring fw-stack-2x"></i>&ndash;&gt;-->
<!--&lt;!&ndash;</span>&ndash;&gt;-->
<!--&lt;!&ndash;</a>&ndash;&gt;-->
<!--&lt;!&ndash;<a href="#" class="multi-view remove disabled">&ndash;&gt;-->
<!--&lt;!&ndash;<span class="icon fw-stack">&ndash;&gt;-->
<!--&lt;!&ndash;<i class="fw fw-minus fw-stack-1x"></i>&ndash;&gt;-->
<!--&lt;!&ndash;<i class="fw fw-ring fw-stack-2x"></i>&ndash;&gt;-->
<!--&lt;!&ndash;</span>&ndash;&gt;-->
<!--&lt;!&ndash;</a>&ndash;&gt;-->
<!--&lt;!&ndash;Wi-Fi Setting :&ndash;&gt;-->
<!--&lt;!&ndash;<br>&ndash;&gt;-->
<!--&lt;!&ndash;<br>&ndash;&gt;-->
<!--Please note that * sign represents required fields of data.-->
<!--<br>-->
<!--<br>-->
<!--<div id="wifi-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="wifi-ssid">-->
<!--Service Set Identifier (SSID) *-->
<!--<span class="helper" title="Identification of the wireless network to be configured.">-->
<!--<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>-->
<!--</span>-->
<!--<br>-->
<!--( should be 1-to-30 characters long )-->
<!--</label>-->
<!--<input id="wifi-ssid" type="text" class="form-control operationDataKeys" data-key="wifiSSID" maxlength="100" placeholder="[ Required field ]"/>-->
<!--</div>-->
<!--<div class="wr-input-control">-->
<!--<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="text" class="form-control operationDataKeys" data-key="wifiPassword" maxlength="100" placeholder="[ Optional field ]"/>-->
<!--</div>-->
<!--&lt;!&ndash;</div>&ndash;&gt;-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!-- /wi-fi -->
<!-- install-applications --> <select id="app-restriction-type" class="form-control operationDataKeys" data-key="restrictionType" disabled>
<!--<div class="wr-hidden-operation" data-operation="install-apps">--> <option value="" selected="selected">
<!--<div class="panel panel-default operation-data" data-operation="INSTALL_APPLICATION">--> None
<!--<div class="panel-heading" role="tab">--> </option>
<!--<h2 class="sub-title panel-title">--> <option value="black-list">Black List</option>
<!--<br>--> <option value="white-list">White List</option>
<!--&nbsp;&nbsp;&nbsp;App Installations--> </select>
<!--<label class="wr-input-control switch" data-toggle="collapse" data-target="#installApp">--> <br>
<!--<input type="checkbox" />--> <div class="wr-input-control">
<!--<span class="helper"></span>--> <label class="wr-input-label" for="restricted-applications">
<!--<span class="text"></span>--> Restricted Application List
<!--</label>--> <span class="helper" title="Add an application to restrict.">
<!--<br>--> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
<!--<br>--> </span>
<!--</h2>--> <br>
<!--</div>--> <br>
<!--<div id="installApp" class="panel-collapse panel-body collapse" role="tabpanel" aria-labelledby="installApp">--> <a href="#restricted-applications-grid" class="grid-input-add hidden" data-click-event="add-form">
<!--<div id="install-app-feature-error-msg" class="alert alert-danger hidden" role="alert">--> <span class="icon fw-stack">
<!--<i class="icon fw fw-error"></i><span></span>--> <i class="fw fw-add fw-stack-1x"></i>
<!--</div>--> <i class="fw fw-ring fw-stack-2x"></i>
<!--<label class="wr-input-label" title="Application Identifier">App Identifier<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></label>--> </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-->
<!--<div class="wr-input-control">--> <!-- wi-fi -->
<!--<input type="text" class="form-control operationDataKeys" id="package-name" data-key="packageName" placeholder="Enter App Identifier"/>--> <!--<div class="wr-hidden-operation" data-operation="wifi">-->
<!--</div>--> <!--<div class="panel panel-default operation-data" data-operation="wifi" data-operation-code="WIFI">-->
<!--<div class="wr-input-control">--> <!--<div id="wifi-heading" class="panel-heading" role="tab">-->
<!--<label class="wr-input-control dropdown">--> <!--<h2 class="sub-title panel-title">-->
<!--<span class="helper" title="App Type">App Type<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></span>--> <!--Wi-Fi Settings-->
<!--<select class="form-control col-sm-8 operationDataKeys appTypesInput" id="type" data-key="type">--> <!--<label class="wr-input-control switch" data-toggle="collapse" data-target="#wifi-body">-->
<!--<option>Public</option>--> <!--<input type="checkbox" />-->
<!--<option>Enterprise</option>--> <!--<span class="helper"></span>-->
<!--</select>--> <!--<span class="text"></span>-->
<!--</label>--> <!--</label>-->
<!--</div>--> <!--<hr>-->
<!--<label class="wr-input-label" title="URL">URL<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></label>--> <!--<div class="panel-title-description">-->
<!--This configurations can be used to configure Wi-Fi access 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="wifi-body" class="panel-collapse panel-body collapse" role="tabpanel" aria-labelledby="wifi-body">-->
<!--&lt;!&ndash;<div class="cloneable">&ndash;&gt;-->
<!--&lt;!&ndash;<a href="#" class="multi-view add enabled">&ndash;&gt;-->
<!--&lt;!&ndash;<span class="icon fw-stack">&ndash;&gt;-->
<!--&lt;!&ndash;<i class="fw fw-add fw-stack-1x"></i>&ndash;&gt;-->
<!--&lt;!&ndash;<i class="fw fw-ring fw-stack-2x"></i>&ndash;&gt;-->
<!--&lt;!&ndash;</span>&ndash;&gt;-->
<!--&lt;!&ndash;</a>&ndash;&gt;-->
<!--&lt;!&ndash;<a href="#" class="multi-view remove disabled">&ndash;&gt;-->
<!--&lt;!&ndash;<span class="icon fw-stack">&ndash;&gt;-->
<!--&lt;!&ndash;<i class="fw fw-minus fw-stack-1x"></i>&ndash;&gt;-->
<!--&lt;!&ndash;<i class="fw fw-ring fw-stack-2x"></i>&ndash;&gt;-->
<!--&lt;!&ndash;</span>&ndash;&gt;-->
<!--&lt;!&ndash;</a>&ndash;&gt;-->
<!--&lt;!&ndash;Wi-Fi Setting :&ndash;&gt;-->
<!--&lt;!&ndash;<br>&ndash;&gt;-->
<!--&lt;!&ndash;<br>&ndash;&gt;-->
<!--Please note that * sign represents required fields of data.-->
<!--<br>-->
<!--<br>-->
<!--<div id="wifi-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="wifi-ssid">-->
<!--Service Set Identifier (SSID) *-->
<!--<span class="helper" title="Identification of the wireless network to be configured.">-->
<!--<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>-->
<!--</span>-->
<!--<br>-->
<!--( should be 1-to-30 characters long )-->
<!--</label>-->
<!--<input id="wifi-ssid" type="text" class="form-control operationDataKeys" data-key="wifiSSID" maxlength="100" placeholder="[ Required field ]"/>-->
<!--</div>-->
<!--<div class="wr-input-control">-->
<!--<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="text" class="form-control operationDataKeys" data-key="wifiPassword" maxlength="100" placeholder="[ Optional field ]"/>-->
<!--</div>-->
<!--&lt;!&ndash;</div>&ndash;&gt;-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!-- /wi-fi -->
<!--<div class="wr-input-control">--> <!-- install-applications -->
<!--<input type="text" class="form-control operationDataKeys" id="url" data-key="url" placeholder="Enter URL"/>--> <!--<div class="wr-hidden-operation" data-operation="install-apps">-->
<!--</div>--> <!--<div class="panel panel-default operation-data" data-operation="INSTALL_APPLICATION">-->
<!--</div>--> <!--<div class="panel-heading" role="tab">-->
<!--</div>--> <!--<h2 class="sub-title panel-title">-->
<!--</div>--> <!--<br>-->
<!-- /install-applications --> <!--&nbsp;&nbsp;&nbsp;App Installations-->
<!--<label class="wr-input-control switch" data-toggle="collapse" data-target="#installApp">-->
<!--<input type="checkbox" />-->
<!--<span class="helper"></span>-->
<!--<span class="text"></span>-->
<!--</label>-->
<!--<br>-->
<!--<br>-->
<!--</h2>-->
<!--</div>-->
<!--<div id="installApp" class="panel-collapse panel-body collapse" role="tabpanel" aria-labelledby="installApp">-->
<!--<div id="install-app-feature-error-msg" class="alert alert-danger hidden" role="alert">-->
<!--<i class="icon fw fw-error"></i><span></span>-->
<!--</div>-->
<!--<label class="wr-input-label" title="Application Identifier">App Identifier<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></label>-->
<!-- /uninstall-applications --> <!--<div class="wr-input-control">-->
<!--<div class="wr-hidden-operation" data-operation="uninstall-apps">--> <!--<input type="text" class="form-control operationDataKeys" id="package-name" data-key="packageName" placeholder="Enter App Identifier"/>-->
<!--<div class="panel panel-default operation-data" data-operation="UNINSTALL_APPLICATION">--> <!--</div>-->
<!--<div class="panel-heading" role="tab">--> <!--<div class="wr-input-control">-->
<!--<h2 class="sub-title panel-title">--> <!--<label class="wr-input-control dropdown">-->
<!--<br>--> <!--<span class="helper" title="App Type">App Type<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></span>-->
<!--&nbsp;&nbsp;&nbsp;App Uninstallations--> <!--<select class="form-control col-sm-8 operationDataKeys appTypesInput" id="type" data-key="type">-->
<!--<label class="wr-input-control switch" data-toggle="collapse" data-target="#uninstallApp">--> <!--<option>Public</option>-->
<!--<input type="checkbox" />--> <!--<option>Enterprise</option>-->
<!--<span class="helper"></span>--> <!--</select>-->
<!--<span class="text"></span>--> <!--</label>-->
<!--</label>--> <!--</div>-->
<!--<br>--> <!--<label class="wr-input-label" title="URL">URL<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></label>-->
<!--<br>-->
<!--</h2>-->
<!--</div>-->
<!--<div id="uninstallApp" class="panel-collapse panel-body collapse" role="tabpanel" aria-labelledby="uninstallApp">-->
<!--<div id="uninstall-app-feature-error-msg" class="alert alert-danger hidden" role="alert">-->
<!--<i class="icon fw fw-error"></i><span></span>-->
<!--</div>-->
<!--<label class="wr-input-label" title="Application Identifier">App Identifier<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></label>-->
<!--<!--span>Identification of the wireless network to connect to</span-->
<!--<div class="wr-input-control">-->
<!--<input type="text" class="form-control operationDataKeys" id="package-name" data-key="packageName" placeholder="Enter App Identifier"/>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!-- /uninstall-applications -->
<!-- /web-clips --> <!--<div class="wr-input-control">-->
<!--<div class="wr-hidden-operation" data-operation="web-clips">--> <!--<input type="text" class="form-control operationDataKeys" id="url" data-key="url" placeholder="Enter URL"/>-->
<!--<div class="panel panel-default operation-data" data-operation="WEBCLIP">--> <!--</div>-->
<!--<div class="panel-heading" role="tab">--> <!--</div>-->
<!--<h2 class="sub-title panel-title">--> <!--</div>-->
<!--<br>--> <!--</div>-->
<!--&nbsp;&nbsp;&nbsp;Web clips--> <!-- /install-applications -->
<!--<label class="wr-input-control switch" data-toggle="collapse" data-target="#installWebClip">-->
<!--<input type="checkbox" />--> <!-- /uninstall-applications -->
<!--<span class="helper"></span>--> <!--<div class="wr-hidden-operation" data-operation="uninstall-apps">-->
<!--<span class="text"></span>--> <!--<div class="panel panel-default operation-data" data-operation="UNINSTALL_APPLICATION">-->
<!--</label>--> <!--<div class="panel-heading" role="tab">-->
<!--<br>--> <!--<h2 class="sub-title panel-title">-->
<!--<br>--> <!--<br>-->
<!--</h2>--> <!--&nbsp;&nbsp;&nbsp;App Uninstallations-->
<!--</div>--> <!--<label class="wr-input-control switch" data-toggle="collapse" data-target="#uninstallApp">-->
<!--<div id="installWebClip" class="panel-collapse panel-body collapse" role="tabpanel" aria-labelledby="installWebClip">--> <!--<input type="checkbox" />-->
<!--<div id="install-webclip-feature-error-msg" class="alert alert-danger hidden" role="alert">--> <!--<span class="helper"></span>-->
<!--<i class="icon fw fw-error"></i><span></span>--> <!--<span class="text"></span>-->
<!--</div>--> <!--</label>-->
<!--<label class="wr-input-label" title="Title of the web clip">Title<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></label>--> <!--<br>-->
<!--<div class="wr-input-control">--> <!--<br>-->
<!--<input type="text" class="form-control operationDataKeys" id="title" data-key="title" placeholder="Enter Title"/>--> <!--</h2>-->
<!--</div>--> <!--</div>-->
<!--<label class="wr-input-label" title="URL">URL<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></label>--> <!--<div id="uninstallApp" class="panel-collapse panel-body collapse" role="tabpanel" aria-labelledby="uninstallApp">-->
<!--<div class="wr-input-control">--> <!--<div id="uninstall-app-feature-error-msg" class="alert alert-danger hidden" role="alert">-->
<!--<input type="text" class="form-control operationDataKeys" id="url" data-key="url" placeholder="Enter URL"/>--> <!--<i class="icon fw fw-error"></i><span></span>-->
<!--</div>--> <!--</div>-->
<!--</div>--> <!--<label class="wr-input-label" title="Application Identifier">App Identifier<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></label>-->
<!--</div>--> <!--<!--span>Identification of the wireless network to connect to</span-->
<!--</div>--> <!--<div class="wr-input-control">-->
<!-- /web-clips --> <!--<input type="text" class="form-control operationDataKeys" id="package-name" data-key="packageName" placeholder="Enter App Identifier"/>-->
</div> <!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!-- /uninstall-applications -->
<!-- /web-clips -->
<!--<div class="wr-hidden-operation" data-operation="web-clips">-->
<!--<div class="panel panel-default operation-data" data-operation="WEBCLIP">-->
<!--<div class="panel-heading" role="tab">-->
<!--<h2 class="sub-title panel-title">-->
<!--<br>-->
<!--&nbsp;&nbsp;&nbsp;Web clips-->
<!--<label class="wr-input-control switch" data-toggle="collapse" data-target="#installWebClip">-->
<!--<input type="checkbox" />-->
<!--<span class="helper"></span>-->
<!--<span class="text"></span>-->
<!--</label>-->
<!--<br>-->
<!--<br>-->
<!--</h2>-->
<!--</div>-->
<!--<div id="installWebClip" class="panel-collapse panel-body collapse" role="tabpanel" aria-labelledby="installWebClip">-->
<!--<div id="install-webclip-feature-error-msg" class="alert alert-danger hidden" role="alert">-->
<!--<i class="icon fw fw-error"></i><span></span>-->
<!--</div>-->
<!--<label class="wr-input-label" title="Title of the web clip">Title<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></label>-->
<!--<div class="wr-input-control">-->
<!--<input type="text" class="form-control operationDataKeys" id="title" data-key="title" placeholder="Enter Title"/>-->
<!--</div>-->
<!--<label class="wr-input-label" title="URL">URL<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></label>-->
<!--<div class="wr-input-control">-->
<!--<input type="text" class="form-control operationDataKeys" id="url" data-key="url" placeholder="Enter URL"/>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!-- /web-clips -->
</div>
</div> </div>

@ -1,20 +1,4 @@
{{! {{#zone "content"}}
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.
}}
{{#defineZone "policy-profile-top"}} {{#defineZone "policy-profile-top"}}
<div class="row wr-device-board"> <div class="row wr-device-board">
<div class="col-lg-12 wr-secondary-bar"> <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="row no-gutter add-padding-5x add-margin-top-5x" style="border: 1px solid #e4e4e4;">
<div class="media"> <div class="media">
<div class="media-body asset-desc add-padding-left-5x"> <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> </div>
{{#defineZone "policy-detail-properties"}} {{#defineZone "policy-detail-properties"}}
<table class="table table-responsive table-striped" id="members"> <table class="table table-responsive table-striped" id="members">
@ -66,9 +51,8 @@
<div id="policy-description" class="panel-title-description"></div> <div id="policy-description" class="panel-title-description"></div>
</div> </div>
<br> <br>
<div style="background: #11375B; color: #fff; padding: 10px; margin-bottom: 5px">
<div style="background: #11375B; color: #fff; padding: 10px; margin-bottom: 5px">Profile Profile Information
Information
</div> </div>
<div class="add-margin-top-4x"> <div class="add-margin-top-4x">
<div id="policy-profile-main-error-msg" class="alert alert-danger hidden" role="alert"> <div id="policy-profile-main-error-msg" class="alert alert-danger hidden" role="alert">
@ -88,16 +72,17 @@
</div> </div>
</div> </div>
</div> </div>
{{/zone}}
{{#zone "bottomJs"}} {{#zone "bottomJs"}}
<!--suppress HtmlUnknownTarget -->
<script id="hidden-operations-ios" src="{{@unit.publicUri}}/templates/hidden-operations-ios.hbs" <script id="hidden-operations-ios" src="{{@unit.publicUri}}/templates/hidden-operations-ios.hbs"
type="text/x-handlebars-template"></script> type="text/x-handlebars-template"></script>
<script id="hidden-operations-android" <!--suppress HtmlUnknownTarget -->
src="{{@unit.publicUri}}/templates/hidden-operations-android.hbs" <script id="hidden-operations-android" src="{{@unit.publicUri}}/templates/hidden-operations-android.hbs"
type="text/x-handlebars-template"></script> type="text/x-handlebars-template"></script>
<script id="hidden-operations-windows" <!--suppress HtmlUnknownTarget -->
src="{{@unit.publicUri}}/templates/hidden-operations-windows.hbs" <script id="hidden-operations-windows" src="{{@unit.publicUri}}/templates/hidden-operations-windows.hbs"
type="text/x-handlebars-template"></script> type="text/x-handlebars-template"></script>
{{js "/js/policy-view.js"}} {{js "js/view.js"}}
{{/zone}} {{/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, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * 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, * Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an * software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* KIND, either express or implied. See the License for the * either express or implied. See the License for the
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
function onRequest(context) { function onRequest(context) {
var log = new Log("policy-view-edit-unit backend js"); // 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"]; // var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
context.roles = userModule.getRoles().content; // context.roles = userModule.getRoles();
return context; return context;
} }
Loading…
Cancel
Save