Added COSU policy configurations

merge-requests/1/head
Saad Sahibjan 8 years ago
parent a561986eb0
commit b0ec89938e

@ -80,7 +80,9 @@ var operationModule = function () {
"AUTO_TIME" : "AUTO_TIME",
"SET_SCREEN_CAPTURE_DISABLED" : "SET_SCREEN_CAPTURE_DISABLED",
"SET_STATUS_BAR_DISABLED" : "SET_STATUS_BAR_DISABLED",
"APPLICATION_OPERATION_CODE":"APP-RESTRICTION"
"APPLICATION_OPERATION_CODE":"APP-RESTRICTION",
"SYSTEM_UPDATE_POLICY_CODE": "SYSTEM_UPDATE_POLICY",
"KIOSK_APPS_CODE": "KIOSK_APPS"
};
// Constants to define Windows Operation Constants
@ -1012,6 +1014,24 @@ var operationModule = function () {
}
};
break;
case androidOperationConstants["SYSTEM_UPDATE_POLICY_CODE"]:
operationType = operationTypeConstants["PROFILE"];
payload = {
"operation": {
"type": operationData["cosuSystemUpdateType"],
"startTime": operationData["cosuWindowStartTime"],
"endTime": operationData["cosuWindowEndTime"]
}
};
break;
case androidOperationConstants["KIOSK_APPS_CODE"]:
operationType = operationTypeConstants["PROFILE"];
payload = {
"operation": {
"whitelistedApplications": operationData["cosuWhitelistedApplications"]
}
};
break;
default:
// If the operation is neither of above, it is a command operation
operationType = operationTypeConstants["COMMAND"];
@ -1276,6 +1296,8 @@ var operationModule = function () {
value = operationDataObj.val();
} else if (operationDataObj.is(":checkbox")) {
value = operationDataObj.is(":checked");
} else if (operationDataObj.is(":radio") && operationDataObj.is(":checked")) {
value = operationDataObj.val();
} else if (operationDataObj.is("select")) {
value = operationDataObj.find("option:selected").attr("value");
} else if (operationDataObj.hasClass("grouped-array-input")) {

@ -2441,6 +2441,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>
@ -1268,6 +1279,249 @@
</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="system-update-policy"
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-application">
<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>
</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