Merge pull request #338 from saadsahibjan/master

Added edit COSU policy configurations
revert-dabc3590
Chatura Dilan 8 years ago committed by GitHub
commit ac9f95f885

@ -851,6 +851,18 @@ var operationModule = function () {
"restrictedApplications": operationPayload["restricted-applications"]
};
break;
case androidOperationConstants["SYSTEM_UPDATE_POLICY_CODE"]:
payload = {
"cosuSystemUpdateType": operationPayload["type"],
"cosuWindowStartTime": operationPayload["startTime"],
"cosuWindowEndTime": operationPayload["endTime"]
};
break;
case androidOperationConstants["KIOSK_APPS_CODE"]:
payload = {
"cosuWhitelistedApplications": operationPayload["whitelistedApplications"]
};
break;
}
return payload;
};
@ -1290,6 +1302,7 @@ var operationModule = function () {
function () {
var operationDataObj = $(this);
var key = operationDataObj.data("key");
var validValue = true;
var value;
if (operationDataObj.is(":text") || operationDataObj.is("textarea") ||
operationDataObj.is(":password") || operationDataObj.is(":hidden")) {
@ -1297,7 +1310,9 @@ var operationModule = function () {
} else if (operationDataObj.is(":checkbox")) {
value = operationDataObj.is(":checked");
} else if (operationDataObj.is(":radio") && operationDataObj.is(":checked")) {
value = operationDataObj.val();
value = operationDataObj.val();
} else if (operationDataObj.is(":radio") && !(operationDataObj.is(":checked"))) {
validValue = false;
} else if (operationDataObj.is("select")) {
value = operationDataObj.find("option:selected").attr("value");
} else if (operationDataObj.hasClass("grouped-array-input")) {
@ -1392,7 +1407,9 @@ var operationModule = function () {
});
}
}
operationData[key] = value;
if (validValue) {
operationData[key] = value;
}
}
);
@ -1447,6 +1464,10 @@ var operationModule = function () {
operationDataObj.val(value);
} else if (operationDataObj.is(":checkbox")) {
operationDataObj.prop("checked", value);
} else if (operationDataObj.is(":radio")) {
if (operationDataObj.val() == uiPayload[key]) {
operationDataObj.attr("checked", true);
}
} else if (operationDataObj.is("select")) {
operationDataObj.val(value);
/* trigger a change of value, so that if slidable panes exist,

@ -3,8 +3,10 @@
<a href="javascript:void(0)" onclick="showAdvanceOperation('passcode-policy', this)" class="selected">
<span class="wr-hidden-operations-icon fw-stack">
<i class="fw fw-key fw-stack-2x"></i>
</span>Passcode Policy
<span id="passcode-policy-configured" class="has-configured status-icon hidden"><i class="fw fw-ok"></i></span>
</span>
Passcode Policy
<span id="passcode-policy-configured" class="has-configured status-icon hidden"><i
class="fw fw-ok"></i></span>
<span id="passcode-policy-ok" class="has-success status-icon hidden"><i class="fw fw-ok"></i></span>
<span id="passcode-policy-error" class="has-error status-icon hidden"><i class="fw fw-error"></i></span>
</a>
@ -22,9 +24,11 @@
<i class="fw fw-security fw-stack-2x"></i>
</span>
Encryption Settings
<span id="encrypt-storage-configured" class="has-configured status-icon hidden"><i class="fw fw-ok"></i></span>
<span id="encrypt-storage-configured" class="has-configured 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 href="javascript:void(0)" onclick="showAdvanceOperation('wifi', this)">
<span class="wr-hidden-operations-icon fw-stack">
@ -70,7 +74,8 @@
<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-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>
@ -90,17 +95,18 @@
<span class="helper"></span>
<span class="text"></span>
</label>
<hr>
<div class="panel-title-description">
This configuration can be used to set a passcode policy to 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 class="panel-title-description">
This configuration can be used to set a passcode policy to 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>
</div>
<div id="passcode-policy-body" class="panel-collapse panel-body collapse" role="tabpanel"
aria-labelledby="passcode-policy-body">
<hr/>
<div id="passcode-policy-feature-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span>
</div>
@ -244,17 +250,17 @@
<span class="helper"></span>
<span class="text"></span>
</label>
<hr>
<div class="panel-title-description">
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>
</h2>
<div class="panel-title-description">
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>
</div>
<div id="camera-body" class="panel-collapse panel-body collapse" role="tabpanel"
aria-labelledby="camera-body">
<hr/>
<div id="camera-feature-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span>
</div>
@ -651,7 +657,7 @@
<ul class="message message-info">
<i class="icon fw fw-info"></i>
<a id="policy-listing-status-msg">Below restrictions will be applied on devices with Android
version 6.0 Marshmallow onwards only.</a>
version 6.0 Marshmallow onwards only.</a>
</ul>
</div>
<div class="wr-input-control">
@ -683,18 +689,18 @@
<span class="helper"></span>
<span class="text"></span>
</label>
<hr>
<div class="panel-title-description">
This configuration can be used to encrypt data on an Android device, when the device is
locked and
make it readable when the passcode is entered. 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 class="panel-title-description">
This configuration can be used to encrypt data on an Android device, when the device is
locked and
make it readable when the passcode is entered. Once this configuration profile is installed
on a device,
corresponding users will not be able to modify these settings on their devices.
</div>
</div>
<div id="encrypt-storage-body" class="panel-collapse panel-body collapse" role="tabpanel"
aria-labelledby="encrypt-storage-body">
<hr/>
<div id="encrypt-storage-feature-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span>
</div>
@ -729,17 +735,17 @@
<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 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>
</div>
<div id="wifi-body" class="panel-collapse panel-body collapse" role="tabpanel"
aria-labelledby="wifi-body">
<hr/>
Please note that * sign represents required fields of data.
<br>
<br>
@ -859,7 +865,7 @@
</span>
</label>
<input id="wifi-cacert-upload" type="file" class="form-control"
onchange="base64EncodeFile(this, document.getElementById('wifi-cacert'), document.getElementById('wifi-cacert-name'))"/>
onchange="base64EncodeFile(this, document.getElementById('wifi-cacert'), document.getElementById('wifi-cacert-name'))"/>
<input id="wifi-cacert" type="hidden" class="form-control operationDataKeys"
data-key="wifiCaCert" />
<input id="wifi-cacert-name" type="hidden" class="form-control operationDataKeys"
@ -893,13 +899,14 @@
<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 class="panel-title-description">
This configuration can be used to create a black list or white list of applications.
</div>
</div>
<div id="app-restriction-body" class="panel-collapse panel-body collapse" role="tabpanel" aria-labelledby="app-restriction-body">
<hr/>
<div id="app-restriction-feature-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span>
</div>
@ -999,17 +1006,17 @@
<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 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>
</div>
<div id="vpn-body" class="panel-collapse panel-body collapse" role="tabpanel"
aria-labelledby="vpn-body">
<hr/>
Please note that * sign represents required fields of data.
<br>
<br>
@ -1181,15 +1188,16 @@
<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 class="panel-title-description">
The configurations below can be applied to the devices where the agent is running in Android
Work-Profile.
</div>
</div>
<div id="work-profile-policy-body" class="panel-collapse panel-body collapse" role="tabpanel"
aria-labelledby="work-profile-policy-body">
<hr/>
<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>
@ -1274,7 +1282,7 @@
<!--android-for-work-cosu-->
<div class="wr-hidden-operation" data-operation="android-for-work-cosu">
<!--system-update-policy-->
<div class="panel panel-default operation-data" data-operation="system-update-policy"
<div class="panel panel-default operation-data" data-operation="android-for-work-cosu"
data-operation-code="SYSTEM_UPDATE_POLICY">
<div id="system-update-policy-heading" class="panel-heading" role="tab">
<h2 class="sub-title panel-title">
@ -1331,8 +1339,6 @@
</label>
</div>
</div>
<div id="android-for-work-cosu-window-select" class="hidden">
<div>
<ul class="message message-info">
@ -1440,9 +1446,8 @@
<div id="whitelisted-applications-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="whitelisted-application">
<label class="wr-input-label" for="whitelisted-applications">
<br><br>Whitelisted Application List to enter Lock Task Mode
<span class="helper" title="Add an application to whitelist.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -1479,20 +1484,20 @@
</table>
<table class="template hidden">
<tbody data-add-form="#whitelisted-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 ]"/>
</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 ]"/>
</td>
<td>
<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 ]"/>
</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 ]"/>
</td>
<td>
<span class="list-group-item-actions">
<a href="#whitelisted-applications-grid" class="grid-input-remove"
data-click-event="remove-form">
@ -1502,8 +1507,8 @@
</span>
</a>
</span>
</td>
</tr>
</td>
</tr>
</tbody>
</table>
</div>
@ -1514,6 +1519,5 @@
<!--/whitelisted-applications-->
</div>
<!--/android-for-work-cosu-->
</div>
</div>

@ -2219,6 +2219,24 @@ var slideDownPaneAgainstValueSet = function (selectElement, paneID, valueSet) {
);
}
};
var slideDownPaneAgainstValueSetForRadioButtons = function (selectElement, paneID, valueSet) {
var selectedValueOnChange = selectElement.value;
var i, slideDownVotes = 0;
for (i = 0; i < valueSet.length; i++) {
if (selectedValueOnChange == valueSet[i]) {
slideDownVotes++;
}
}
var paneSelector = "#" + paneID;
if(slideDownVotes > 0) {
$(paneSelector).removeClass("hidden");
} else {
$(paneSelector).addClass("hidden");
}
};
// End of HTML embedded invoke methods

@ -57,6 +57,17 @@
<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>
<!--COSU-->
<a href="javascript:void(0)" onclick="showAdvanceOperation('android-for-work-cosu', this)">
<span class="wr-hidden-operation-icon fw-stack">
<i class="fw fw-service fw-stack-2x"></i>
</span>
&nbsp;&nbsp;COSU Configuration
<span id="android-for-work-cosu-configured" class="has-configured status-icon hidden"><i class="fw fw-ok"></i></span>
<span id="android-for-work-cosu-ok" class="has-success status-icon hidden"><i class="fw fw-ok"></i></span>
<span id="android-for-work-cosu-error" class="has-error status-icon hidden"><i class="fw fw-error"></i></span>
</a>
<!--/COSU-->
<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>
@ -1286,5 +1297,249 @@
</div>
</div>
</div>
<!--android-for-work-cosu-->
<div class="wr-hidden-operation" data-operation="android-for-work-cosu">
<!--system-update-policy-->
<div class="panel panel-default operation-data" data-operation="android-for-work-cosu"
data-operation-code="SYSTEM_UPDATE_POLICY">
<div id="system-update-policy-heading" class="panel-heading" role="tab">
<h2 class="sub-title panel-title">
System Update Policy
<label id="system-update-policy-lbl" class="wr-input-control switch" data-toggle="collapse"
data-target="#system-update-policy-body">
<input type="checkbox"/>
<span class="helper"></span>
<span class="text"></span>
</label>
</h2>
</div>
<div id="system-update-policy-body" class="panel-collapse panel-body collapse" role="tabpanel"
aria-labelledby="android-for-work-cosu-policy-body">
<div id="system-update-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-label" for="android-for-work-cosu-policy-system-update">
System Update
<span class="helper" title="Type of the System Update to be set by the Device Owner">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
<br>
</label>
<br>
<div class="wr-input-control">
<label class="wr-input-control radio light">
<input id="automatic-system-update-radio-btn" type="radio" name="android-for-work-cosu-policy-system-update"
class="form-control operationDataKeys" data-key="cosuSystemUpdateType"
value="automatic" onclick="slideDownPaneAgainstValueSetForRadioButtons(this, 'android-for-work-cosu-window-select', ['window'])" checked/>
<span class="helper" title="Installs system update automatically as soon as one is available">
&nbsp;Automatic
</span>
</span>
</label>
<label class="wr-input-control radio light">
<input id="postpone-system-update-radio-btn" type="radio" name="android-for-work-cosu-policy-system-update"
class="form-control operationDataKeys" data-key="cosuSystemUpdateType"
value="postpone" onclick="slideDownPaneAgainstValueSetForRadioButtons(this, 'android-for-work-cosu-window-select', ['window'])"/>
<span class="helper" title="Incoming system update will be blocked for a maximum of 30 days">
&nbsp;Postpone
</span>
</label>
<label class="wr-input-control radio light">
<input id="window-system-update-radio-btn" type="radio" name="android-for-work-cosu-policy-system-update"
class="form-control operationDataKeys" data-key="cosuSystemUpdateType"
value="window" onclick="slideDownPaneAgainstValueSetForRadioButtons(this, 'android-for-work-cosu-window-select', ['window'])"/>
<span class="helper" title="Install system update automatically within a daily maintenance window, for a maximum of 30 days">
&nbsp;Window
</span>
</label>
</div>
</div>
<div id="android-for-work-cosu-window-select" class="hidden">
<div>
<ul class="message message-info">
<i class="icon fw fw-info"></i>
<a id="android-for-work-cosu-window-select-msg"> Below configuration of start time and end time are valid only when
<b>window</b> option is selected.</a>
</ul>
</div>
<div class="wr-input-control">
<label class="wr-input-label" for="android-for-work-cosu-window-start-time">
Start Time
<span class="helper" title="Window start time for system update">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<select id="android-for-work-cosu-start-time" class="form-control operationDataKeys"
data-key="cosuWindowStartTime" data-default="0">
<option value="1440" selected="selected">
12 AM
</option>
<option value="60">1 AM</option>
<option value="120">2 AM</option>
<option value="180">3 AM</option>
<option value="240">4 AM</option>
<option value="300">5 AM</option>
<option value="360">6 AM</option>
<option value="420">7 AM</option>
<option value="480">8 AM</option>
<option value="540">9 AM</option>
<option value="600">10 AM</option>
<option value="660">11 AM</option>
<option value="720">12 noon</option>
<option value="780">1 PM</option>
<option value="840">2 PM</option>
<option value="900">3 PM</option>
<option value="960">4 PM</option>
<option value="1020">5 PM</option>
<option value="1080">6 PM</option>
<option value="1140">7 PM</option>
<option value="1200">8 PM</option>
<option value="1260">9 PM</option>
<option value="1320">10 PM</option>
<option value="1380">11 PM</option>
</select>
</div>
<div class="wr-input-control">
<label class="wr-input-label" for="android-for-work-cosu-window-end-time">
Start Time
<span class="helper" title="Window end time for system update">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<select id="android-for-work-cosu-end-time" class="form-control operationDataKeys"
data-key="cosuWindowEndTime" data-default="0">
<option value="1440" selected="selected">
12 AM
</option>
<option value="60">1 AM</option>
<option value="120">2 AM</option>
<option value="180">3 AM</option>
<option value="240">4 AM</option>
<option value="300">5 AM</option>
<option value="360">6 AM</option>
<option value="420">7 AM</option>
<option value="480">8 AM</option>
<option value="540">9 AM</option>
<option value="600">10 AM</option>
<option value="660">11 AM</option>
<option value="720">12 noon</option>
<option value="780">1 PM</option>
<option value="840">2 PM</option>
<option value="900">3 PM</option>
<option value="960">4 PM</option>
<option value="1020">5 PM</option>
<option value="1080">6 PM</option>
<option value="1140">7 PM</option>
<option value="1200">8 PM</option>
<option value="1260">9 PM</option>
<option value="1320">10 PM</option>
<option value="1380">11 PM</option>
</select>
</div>
</div>
</div>
</div>
<!--system-update-policy-->
<!--whitelisted-applications-->
<div class="panel panel-default operation-data" data-operation="whitelisted-applications"
data-operation-code="KIOSK_APPS">
<div id="whitelisted-applications-heading" class="panel-heading" role="tab">
<h2 class="sub-title panel-title">
Whitelisted Applications
<label id="whitelisted-applications-lbl" class="wr-input-control switch" data-toggle="collapse"
data-target="#whitelisted-applications-body">
<input type="checkbox"/>
<span class="helper"></span>
<span class="text"></span>
</label>
</h2>
</div>
<div id="whitelisted-applications-body" class="panel-collapse panel-body collapse" role="tabpanel"
aria-labelledby="whitelisted-applications-body">
<div id="whitelisted-applications-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="whitelisted-applications">
<br><br>Whitelisted Applications List to enter Lock Task Mode
<span class="helper" title="Add an application to whitelist.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
<br>
<a href="#whitelisted-applications-grid" class="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-ring fw-stack-2x"></i>
</span>
&nbsp;
Add Application
</a>
</label>
<div id="whitelisted-applications"
class="operationDataKeys grouped-array-input multi-column-key-value-pair-array"
data-key="cosuWhitelistedApplications" 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="#whitelisted-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="#whitelisted-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 ]"/>
</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 ]"/>
</td>
<td>
<span class="list-group-item-actions">
<a href="#whitelisted-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>
<!--/whitelisted-applications-->
</div>
<!--/android-for-work-cosu-->
</div>
</div>
Loading…
Cancel
Save