Improve global proxy policy config UI

Improve the policy config ui to support auto config proxy using a pac file url
revert-dabc3590
Madawa Soysa 6 years ago committed by Madawa Soysa
parent 2a959c39a7
commit 8b2a5f5157

@ -157,11 +157,13 @@ var androidOperationModule = function () {
break; break;
case androidOperationConstants["GLOBAL_PROXY_OPERATION_CODE"]: case androidOperationConstants["GLOBAL_PROXY_OPERATION_CODE"]:
payload = { payload = {
"proxyConfigType": operationPayload["proxyConfigType"],
"proxyHost": operationPayload["proxyHost"], "proxyHost": operationPayload["proxyHost"],
"proxyPort": operationPayload["proxyPort"], "proxyPort": operationPayload["proxyPort"],
"proxyExclList": operationPayload["proxyExclList"], "proxyExclList": operationPayload["proxyExclList"],
"proxyUsername": operationPayload["proxyUsername"], "proxyUsername": operationPayload["proxyUsername"],
"proxyPassword": operationPayload["proxyPassword"] "proxyPassword": operationPayload["proxyPassword"],
"proxyPacUrl": operationPayload["proxyPacUrl"]
}; };
break; break;
case androidOperationConstants["VPN_OPERATION_CODE"]: case androidOperationConstants["VPN_OPERATION_CODE"]:
@ -323,17 +325,15 @@ var androidOperationModule = function () {
break; break;
case androidOperationConstants["GLOBAL_PROXY_OPERATION_CODE"]: case androidOperationConstants["GLOBAL_PROXY_OPERATION_CODE"]:
operationType = operationTypeConstants["PROFILE"]; operationType = operationTypeConstants["PROFILE"];
var proxyExclList = [];
if (operationData["proxyExclList"]) {
proxyExclList = operationData["proxyExclList"].trim().split(/\s*,\s*/);
}
payload = { payload = {
"operation": { "operation": {
"proxyConfigType": operationData["proxyConfigType"],
"proxyHost": operationData["proxyHost"], "proxyHost": operationData["proxyHost"],
"proxyPort": operationData["proxyPort"], "proxyPort": operationData["proxyPort"],
"proxyExclList": proxyExclList, "proxyExclList": operationData["proxyExclList"],
"proxyUsername": operationData["proxyUsername"], "proxyUsername": operationData["proxyUsername"],
"proxyPassword": operationData["proxyPassword"] "proxyPassword": operationData["proxyPassword"],
"proxyPacUrl": operationData["proxyPacUrl"]
} }
}; };
break; break;

@ -332,38 +332,50 @@ var validatePolicyProfile = function () {
// initializing continueToCheckNextInputs to true // initializing continueToCheckNextInputs to true
continueToCheckNextInputs = true; continueToCheckNextInputs = true;
var proxyHost = $("input#proxy-host").val(); if ($("input#manual-proxy-configuration-radio-button").is(":checked")) {
var proxyPort = $("input#proxy-port").val(); var proxyHost = $("input#proxy-host").val();
if (!proxyHost) { var proxyPort = $("input#proxy-port").val();
validationStatus = { if (!proxyHost) {
"error": true, validationStatus = {
"subErrorMsg": "Proxy server host name is required.", "error": true,
"erroneousFeature": operation "subErrorMsg": "Proxy server host name is required.",
}; "erroneousFeature": operation
continueToCheckNextInputs = false; };
} continueToCheckNextInputs = false;
}
if (!proxyPort) { if (!proxyPort) {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "Proxy server port is required.", "subErrorMsg": "Proxy server port is required.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
} else if (!$.isNumeric(proxyPort)) { } else if (!$.isNumeric(proxyPort)) {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "Proxy server port requires a number input.", "subErrorMsg": "Proxy server port requires a number input.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
} else if (!inputIsValidAgainstRange(proxyPort, 0, 65535)) { } else if (!inputIsValidAgainstRange(proxyPort, 0, 65535)) {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "Proxy server port is not within the range of valid port numbers.", "subErrorMsg": "Proxy server port is not within the range of valid port numbers.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
}
} else if ($("input#auto-proxy-configuration-radio-button").is(":checked")) {
var pacFileUrl = $("input#proxy-pac-url").val();
if (!pacFileUrl) {
validationStatus = {
"error": true,
"subErrorMsg": "Proxy pac file URL is required for proxy auto config.",
"erroneousFeature": operation
};
continueToCheckNextInputs = false;
}
} }
// at-last, if the value of continueToCheckNextInputs is still true // at-last, if the value of continueToCheckNextInputs is still true
@ -830,6 +842,33 @@ var slideDownPaneAgainstValueSetForRadioButtons = function (selectElement, paneI
$(paneSelector).addClass("hidden"); $(paneSelector).addClass("hidden");
} }
}; };
/**
* Method to switch panes based on the selected radio button.
*
* The method will un hide the element with the id (paneIdPrefix + selectElement.value)
*
* @param selectElement selected HTML element
* @param paneIdPrefix prefix of the id of the pane to un hide.
* @param valueSet applicable value set
*/
var switchPaneAgainstValueSetForRadioButtons = function (selectElement, paneIdPrefix, valueSet) {
var selectedValueOnChange = selectElement.value;
var paneSelector = "#" + paneIdPrefix;
for (var i = 0; i < valueSet.length; ++i) {
if (selectedValueOnChange !== valueSet[i]) {
if ($(paneSelector).hasClass("expanded")) {
$(paneSelector).removeClass("expanded");
}
$(paneSelector + valueSet[i]).slideUp();
} else {
if (!$(paneSelector).hasClass("expanded")) {
$(paneSelector).addClass("expanded");
}
$(paneSelector + selectedValueOnChange).slideDown();
}
}
};
// End of HTML embedded invoke methods // End of HTML embedded invoke methods

@ -979,79 +979,133 @@
device. Once this configuration profile is installed on a device, all the network traffic device. Once this configuration profile is installed on a device, all the network traffic
will be routed through the proxy server. will be routed through the proxy server.
</p> </p>
<p>
<b>This method requires the caller to be the device owner.</b>
</p>
<p>
This proxy is only a recommendation and it is possible that some apps will ignore it.
</p>
</div> </div>
</div> </div>
<div id="global-proxy-body" class="panel-collapse panel-body collapse" role="tabpanel" <div id="global-proxy-body" class="panel-collapse panel-body collapse" role="tabpanel"
aria-labelledby="global-proxy-body"> aria-labelledby="global-proxy-body">
<hr/> <hr/>
<ul class="message message-info">
<i class="icon fw fw-info"></i>
<a id="global-proxy-info-message">
This profile requires the agent application to be the device owner.
</a>
</ul>
<br>
<ul class="message message-warning">
<i class="icon fw fw-warning"></i>
<a id="global-proxy-warning-message">
This proxy is only a recommendation and it is possible that some apps will ignore it.
</a>
</ul>
<br>
Please note that * sign represents required fields of data. Please note that * sign represents required fields of data.
<br> <br>
<br> <br>
<div id="global-proxy-feature-error-msg" class="alert alert-danger hidden" role="alert"> <div id="global-proxy-feature-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span> <i class="icon fw fw-error"></i><span></span>
</div> </div>
<div class="wr-input-control"> <label class="wr-input-label" for="proxy-config-type-container">
<label class="wr-input-label" for="proxy-host"> Proxy Configuration Type
Proxy Host <span class="helper" title="Select the configuration type.">
<span class="helper required" title="Host name of the proxy server."> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> </span>
</span> </label>
</label> <div class="wr-input-control" id="proxy-config-type-container">
<input id="proxy-host" class="form-control operationDataKeys" data-key="proxyHost"/> <label class="wr-input-control radio light">
</div> <input id="manual-proxy-configuration-radio-button" type="radio" name="global-proxy-config-type"
<div class="wr-input-control"> class="form-control operationDataKeys" data-key="proxyConfigType"
<label class="wr-input-label" for="proxy-port"> value="manual"
Proxy Port onload="switchPaneAgainstValueSetForRadioButtons(this,
<span class="helper required" title="The port which the proxy server is running."> 'global-proxy-configuration-type-', ['manual','auto'])"
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> onchange="switchPaneAgainstValueSetForRadioButtons(this,
</span> 'global-proxy-configuration-type-', ['manual','auto'])" checked/>
</label> <span class="helper"title="Manually enter proxy configurations.">
<label id="proxyPortValidationText" class="wr-input-label hidden"> Manual
Port number should be between 0 - 65535 </span>
</label> </label>
<input id="proxy-port" class="form-control operationDataKeys" data-key="proxyPort" <label class="wr-input-control radio light">
placeholder="[ Port number 0-65535 ]"/> <input id="auto-proxy-configuration-radio-button" type="radio" name="global-proxy-config-type"
</div> class="form-control operationDataKeys" data-key="proxyConfigType"
<div class="wr-input-control"> value="auto"
<label class="wr-input-label" for="proxy-excl"> onload="switchPaneAgainstValueSetForRadioButtons(this,
Excluded List 'global-proxy-configuration-type-', ['auto','manual'])"
onchange="switchPaneAgainstValueSetForRadioButtons(this,
'global-proxy-configuration-type-', ['auto','manual'])"/>
<span class="helper" <span class="helper"
title="Hosts to exclude using the proxy on connections for. These hosts can use title="Proxy configurations will be automatically fetched from Proxy PAC file.">
wildcards such as *.example.com."> Auto
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span> </span>
</label> </label>
<input id="proxy-excl" class="form-control operationDataKeys" data-key="proxyExclList"
placeholder="[ Comma (,) separated list of proxy exclusions. These hosts can use
wildcards such as *.example.com. ]"/>
</div> </div>
<div class="wr-input-control" id="control-proxy-username"> <div id="global-proxy-configuration-type-manual" class="wr-input-control" style="display:block">
<label class="wr-input-label" for="proxy-username"> <div class="wr-input-control">
Username <label class="wr-input-label" for="proxy-host">
<span class="helper" title="Username for the proxy server."> Proxy Host
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="helper required" title="Host name/IP address of the proxy server.">
</span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</label> </span>
<input id="proxy-username" class="form-control operationDataKeys" </label>
data-key="proxyUsername" maxlength="50"/> <input id="proxy-host" class="form-control operationDataKeys" data-key="proxyHost"
placeholder="[ 192.168.8.1 ]"/>
</div>
<div class="wr-input-control">
<label class="wr-input-label" for="proxy-port">
Proxy Port
<span class="helper required" title="Target port for the proxy server">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<label id="proxyPortValidationText" class="wr-input-label hidden">
Target port should be between 0 - 65535
</label>
<input id="proxy-port" class="form-control operationDataKeys" data-key="proxyPort"
placeholder="[ Target port 0-65535 ]"/>
</div>
<div class="wr-input-control">
<label class="wr-input-label" for="proxy-excl">
Proxy Exclusion List
<span class="helper"
title="Add hostnames to this separated by commas to prevent them from routing through the proxy server.
The hostname entries can be wildcards such as *.example.com">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<input id="proxy-excl" class="form-control operationDataKeys" data-key="proxyExclList"
placeholder="[ Example: localhost, *.example.com ]"/>
</div>
<div class="wr-input-control" id="control-proxy-username">
<label class="wr-input-label" for="proxy-username">
Username
<span class="helper" title="Username for the proxy server.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<input id="proxy-username" class="form-control operationDataKeys"
data-key="proxyUsername" maxlength="50"/>
</div>
<div class="wr-input-control" id="control-proxy-password">
<label class="wr-input-label" for="proxy-password">
Password
<span class="helper" title="Password for the proxy server.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<input id="proxy-password" type="password" class="form-control operationDataKeys"
data-key="proxyPassword" maxlength="100"/>
</div>
</div> </div>
<div class="wr-input-control" id="control-proxy-password"> <div id="global-proxy-configuration-type-auto" class="wr-input-control" style="display:none">
<label class="wr-input-label" for="proxy-password"> <div class="wr-input-control">
Password <label class="wr-input-label" for="proxy-host">
<span class="helper" title="Password for the proxy server."> Proxy PAC File URL
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="helper required" title="URL for the proxy auto config PAC script">
</span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</label> </span>
<input id="proxy-password" type="password" class="form-control operationDataKeys" </label>
data-key="proxyPassword" maxlength="100"/> <input id="proxy-pac-url" class="form-control operationDataKeys" data-key="proxyPacUrl"
placeholder="[ http://exampleproxy.com/proxy.pac ]"/>
</div>
</div> </div>
<!--</div>-->
</div> </div>
</div> </div>
</div> </div>

@ -166,6 +166,33 @@ var slideDownPaneAgainstValueSetForRadioButtons = function (selectElement, paneI
$(paneSelector).addClass("hidden"); $(paneSelector).addClass("hidden");
} }
}; };
/**
* Method to switch panes based on the selected radio button.
*
* The method will un hide the element with the id (paneIdPrefix + selectElement.value)
*
* @param selectElement selected HTML element
* @param paneIdPrefix prefix of the id of the pane to un hide.
* @param valueSet applicable value set
*/
var switchPaneAgainstValueSetForRadioButtons = function (selectElement, paneIdPrefix, valueSet) {
var selectedValueOnChange = selectElement.value;
var paneSelector = "#" + paneIdPrefix;
for (var i = 0; i < valueSet.length; ++i) {
if (selectedValueOnChange !== valueSet[i]) {
if ($(paneSelector).hasClass("expanded")) {
$(paneSelector).removeClass("expanded");
}
$(paneSelector + valueSet[i]).slideUp();
} else {
if (!$(paneSelector).hasClass("expanded")) {
$(paneSelector).addClass("expanded");
}
$(paneSelector + selectedValueOnChange).slideDown();
}
}
};
// End of HTML embedded invoke methods // End of HTML embedded invoke methods
/** /**

@ -968,7 +968,8 @@
<!-- global-proxy --> <!-- global-proxy -->
<div class="wr-hidden-operation" data-operation="global-proxy"> <div class="wr-hidden-operation" data-operation="global-proxy">
<div class="panel panel-default operation-data" data-operation="global-proxy" data-operation-code="GLOBAL_PROXY"> <div class="panel panel-default operation-data" data-operation="global-proxy"
data-operation-code="GLOBAL_PROXY">
<div id="global-proxy-heading" class="panel-heading" role="tab"> <div id="global-proxy-heading" class="panel-heading" role="tab">
<h2 class="sub-title panel-title"> <h2 class="sub-title panel-title">
Global Proxy Settings Global Proxy Settings
@ -984,79 +985,128 @@
device. Once this configuration profile is installed on a device, all the network traffic device. Once this configuration profile is installed on a device, all the network traffic
will be routed through the proxy server. will be routed through the proxy server.
</p> </p>
<p>
<b>This method requires the caller to be the device owner.</b>
</p>
<p>
This proxy is only a recommendation and it is possible that some apps will ignore it.
</p>
</div> </div>
</div> </div>
<div id="global-proxy-body" class="panel-collapse panel-body collapse" role="tabpanel" <div id="global-proxy-body" class="panel-collapse panel-body collapse" role="tabpanel"
aria-labelledby="global-proxy-body"> aria-labelledby="global-proxy-body">
<hr/> <hr/>
<ul class="message message-info">
<i class="icon fw fw-info"></i>
<a id="global-proxy-info-message">
This profile requires the agent application to be the device owner.
</a>
</ul>
<br>
<ul class="message message-warning">
<i class="icon fw fw-warning"></i>
<a id="global-proxy-warning-message">
This proxy is only a recommendation and it is possible that some apps will ignore it.
</a>
</ul>
<br>
Please note that * sign represents required fields of data. Please note that * sign represents required fields of data.
<br> <br>
<br> <br>
<div id="global-proxy-feature-error-msg" class="alert alert-danger hidden" role="alert"> <div id="global-proxy-feature-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span> <i class="icon fw fw-error"></i><span></span>
</div> </div>
<div class="wr-input-control"> <label class="wr-input-label" for="proxy-config-type-container">
<label class="wr-input-label" for="proxy-host"> Proxy Configuration Type
Proxy Host <span class="helper" title="Select the configuration type.">
<span class="helper required" title="Host name of the proxy server."> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> </span>
</span> </label>
</label> <div class="wr-input-control" id="proxy-config-type-container">
<input id="proxy-host" class="form-control operationDataKeys" data-key="proxyHost"/> <label class="wr-input-control radio light">
</div> <input id="manual-proxy-configuration-radio-button" type="radio"
<div class="wr-input-control"> name="global-proxy-config-type"
<label class="wr-input-label" for="proxy-port"> class="form-control operationDataKeys" data-key="proxyConfigType"
Proxy Port value="manual" disabled/>
<span class="helper required" title="The port which the proxy server is running."> <span class="helper" title="Manually enter proxy configurations.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> Manual
</span> </span>
</label>
<label id="proxyPortValidationText" class="wr-input-label hidden">
Port number should be between 0 - 65535
</label> </label>
<input id="proxy-port" class="form-control operationDataKeys" data-key="proxyPort" <label class="wr-input-control radio light">
placeholder="[ Port number 0-65535 ]"/> <input id="auto-proxy-configuration-radio-button" type="radio"
</div> name="global-proxy-config-type"
<div class="wr-input-control"> class="form-control operationDataKeys" data-key="proxyConfigType"
<label class="wr-input-label" for="proxy-excl"> value="auto" disabled/>
Excluded List
<span class="helper" <span class="helper"
title="Hosts to exclude using the proxy on connections for. These hosts can use title="Proxy configurations will be automatically fetched from Proxy PAC file.">
wildcards such as *.example.com."> Auto
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span> </span>
</label> </label>
<input id="proxy-excl" class="form-control operationDataKeys" data-key="proxyExclList"
placeholder="[ Comma (,) separated list of proxy exclusions. These hosts can use
wildcards such as *.example.com. ]"/>
</div> </div>
<div class="wr-input-control" id="control-proxy-username"> <div id="global-proxy-configuration-type-manual" class="wr-input-control expanded">
<label class="wr-input-label" for="proxy-username"> <div class="wr-input-control">
Username <label class="wr-input-label" for="proxy-host">
<span class="helper" title="Username for the proxy server."> Proxy Host
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="helper required" title="Host name/IP address of the proxy server.">
</span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</label> </span>
<input id="proxy-username" class="form-control operationDataKeys" </label>
data-key="proxyUsername" maxlength="50"/> <input id="proxy-host" class="form-control operationDataKeys" data-key="proxyHost"
placeholder="[ 192.168.8.1 ]" disabled/>
</div>
<div class="wr-input-control">
<label class="wr-input-label" for="proxy-port">
Proxy Port
<span class="helper required" title="Target port for the proxy server">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<label id="proxyPortValidationText" class="wr-input-label hidden">
Target port should be between 0 - 65535
</label>
<input id="proxy-port" class="form-control operationDataKeys" data-key="proxyPort"
placeholder="[ Target port 0-65535 ]" disabled/>
</div>
<div class="wr-input-control">
<label class="wr-input-label" for="proxy-excl">
Proxy Exclusion List
<span class="helper"
title="Add hostnames to this separated by commas to prevent them from routing
through the proxy server. The hostname entries can be wildcards such as
*.example.com">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<input id="proxy-excl" class="form-control operationDataKeys" data-key="proxyExclList"
placeholder="[ Example: localhost, *.example.com ]" disabled/>
</div>
<div class="wr-input-control" id="control-proxy-username">
<label class="wr-input-label" for="proxy-username">
Username
<span class="helper" title="Username for the proxy server.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<input id="proxy-username" class="form-control operationDataKeys"
data-key="proxyUsername" maxlength="50" disabled/>
</div>
<div class="wr-input-control" id="control-proxy-password">
<label class="wr-input-label" for="proxy-password">
Password
<span class="helper" title="Password for the proxy server.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<input id="proxy-password" type="password" class="form-control operationDataKeys"
data-key="proxyPassword" maxlength="100" disabled/>
</div>
</div> </div>
<div class="wr-input-control" id="control-proxy-password"> <div id="global-proxy-configuration-type-auto" class="wr-input-control">
<label class="wr-input-label" for="proxy-password"> <div class="wr-input-control">
Password <label class="wr-input-label" for="proxy-host">
<span class="helper" title="Password for the proxy server."> Proxy PAC File URL
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="helper required" title="URL for the proxy auto config PAC script">
</span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</label> </span>
<input id="proxy-password" type="password" class="form-control operationDataKeys" </label>
data-key="proxyPassword" maxlength="100"/> <input id="proxy-pac-url" class="form-control operationDataKeys" data-key="proxyPacUrl"
placeholder="[ http://exampleproxy.com/proxy.pac ]" disabled/>
</div>
</div> </div>
<!--</div>-->
</div> </div>
</div> </div>
</div> </div>

@ -251,38 +251,50 @@ var validatePolicyProfile = function () {
// initializing continueToCheckNextInputs to true // initializing continueToCheckNextInputs to true
continueToCheckNextInputs = true; continueToCheckNextInputs = true;
var proxyHost = $("input#proxy-host").val(); if ($("input#manual-proxy-configuration-radio-button").is(":checked")) {
var proxyPort = $("input#proxy-port").val(); var proxyHost = $("input#proxy-host").val();
if (!proxyHost) { var proxyPort = $("input#proxy-port").val();
validationStatus = { if (!proxyHost) {
"error": true, validationStatus = {
"subErrorMsg": "Proxy server host name is required.", "error": true,
"erroneousFeature": operation "subErrorMsg": "Proxy server host name is required.",
}; "erroneousFeature": operation
continueToCheckNextInputs = false; };
} continueToCheckNextInputs = false;
}
if (!proxyPort) { if (!proxyPort) {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "Proxy server port is required.", "subErrorMsg": "Proxy server port is required.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
}else if (!$.isNumeric(proxyPort)) { } else if (!$.isNumeric(proxyPort)) {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "Proxy server port requires a number input.", "subErrorMsg": "Proxy server port requires a number input.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
} else if (!inputIsValidAgainstRange(proxyPort, 0, 65535)) { } else if (!inputIsValidAgainstRange(proxyPort, 0, 65535)) {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "Proxy server port is not within the range of valid port numbers.", "subErrorMsg": "Proxy server port is not within the range of valid port numbers.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
}
} else if ($("input#auto-proxy-configuration-radio-button").is(":checked")) {
var pacFileUrl = $("input#proxy-pac-url").val();
if (!pacFileUrl) {
validationStatus = {
"error": true,
"subErrorMsg": "Proxy pac file URL is required for proxy auto config.",
"erroneousFeature": operation
};
continueToCheckNextInputs = false;
}
} }
// at-last, if the value of continueToCheckNextInputs is still true // at-last, if the value of continueToCheckNextInputs is still true
@ -795,6 +807,33 @@ var slideDownPaneAgainstValueSetForRadioButtons = function (selectElement, paneI
} }
}; };
/**
* Method to switch panes based on the selected radio button.
*
* The method will un hide the element with the id (paneIdPrefix + selectElement.value)
*
* @param selectElement selected HTML element
* @param paneIdPrefix prefix of the id of the pane to un hide.
* @param valueSet applicable value set
*/
var switchPaneAgainstValueSetForRadioButtons = function (selectElement, paneIdPrefix, valueSet) {
var selectedValueOnChange = selectElement.value;
var paneSelector = "#" + paneIdPrefix;
for (var i = 0; i < valueSet.length; ++i) {
if (selectedValueOnChange !== valueSet[i]) {
if ($(paneSelector).hasClass("expanded")) {
$(paneSelector).removeClass("expanded");
}
$(paneSelector + valueSet[i]).slideUp();
} else {
if (!$(paneSelector).hasClass("expanded")) {
$(paneSelector).addClass("expanded");
}
$(paneSelector + selectedValueOnChange).slideDown();
}
}
};
// End of HTML embedded invoke methods // End of HTML embedded invoke methods

@ -1003,79 +1003,133 @@
device. Once this configuration profile is installed on a device, all the network traffic device. Once this configuration profile is installed on a device, all the network traffic
will be routed through the proxy server. will be routed through the proxy server.
</p> </p>
<p>
<b>This method requires the caller to be the device owner.</b>
</p>
<p>
This proxy is only a recommendation and it is possible that some apps will ignore it.
</p>
</div> </div>
</div> </div>
<div id="global-proxy-body" class="panel-collapse panel-body collapse" role="tabpanel" <div id="global-proxy-body" class="panel-collapse panel-body collapse" role="tabpanel"
aria-labelledby="global-proxy-body"> aria-labelledby="global-proxy-body">
<hr/> <hr/>
<ul class="message message-info">
<i class="icon fw fw-info"></i>
<a id="global-proxy-info-message">
This profile requires the agent application to be the device owner.
</a>
</ul>
<br>
<ul class="message message-warning">
<i class="icon fw fw-warning"></i>
<a id="global-proxy-warning-message">
This proxy is only a recommendation and it is possible that some apps will ignore it.
</a>
</ul>
<br>
Please note that * sign represents required fields of data. Please note that * sign represents required fields of data.
<br> <br>
<br> <br>
<div id="global-proxy-feature-error-msg" class="alert alert-danger hidden" role="alert"> <div id="global-proxy-feature-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span> <i class="icon fw fw-error"></i><span></span>
</div> </div>
<div class="wr-input-control"> <label class="wr-input-label" for="proxy-config-type-container">
<label class="wr-input-label" for="proxy-host"> Proxy Configuration Type
Proxy Host <span class="helper" title="Select the configuration type.">
<span class="helper required" title="Host name of the proxy server."> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> </span>
</span> </label>
</label> <div class="wr-input-control" id="proxy-config-type-container">
<input id="proxy-host" class="form-control operationDataKeys" data-key="proxyHost"/> <label class="wr-input-control radio light">
</div> <input id="manual-proxy-configuration-radio-button" type="radio" name="global-proxy-config-type"
<div class="wr-input-control"> class="form-control operationDataKeys" data-key="proxyConfigType"
<label class="wr-input-label" for="proxy-port"> value="manual"
Proxy Port onload="switchPaneAgainstValueSetForRadioButtons(this,
<span class="helper required" title="The port which the proxy server is running."> 'global-proxy-configuration-type-', ['manual','auto'])"
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> onchange="switchPaneAgainstValueSetForRadioButtons(this,
</span> 'global-proxy-configuration-type-', ['manual','auto'])" checked/>
</label> <span class="helper"title="Manually enter proxy configurations.">
<label id="proxyPortValidationText" class="wr-input-label hidden"> Manual
Port number should be between 0 - 65535 </span>
</label> </label>
<input id="proxy-port" class="form-control operationDataKeys" data-key="proxyPort" <label class="wr-input-control radio light">
placeholder="[ Port number 0-65535 ]"/> <input id="auto-proxy-configuration-radio-button" type="radio" name="global-proxy-config-type"
</div> class="form-control operationDataKeys" data-key="proxyConfigType"
<div class="wr-input-control"> value="auto"
<label class="wr-input-label" for="proxy-excl"> onload="switchPaneAgainstValueSetForRadioButtons(this,
Excluded List 'global-proxy-configuration-type-', ['auto','manual'])"
onchange="switchPaneAgainstValueSetForRadioButtons(this,
'global-proxy-configuration-type-', ['auto','manual'])"/>
<span class="helper" <span class="helper"
title="Hosts to exclude using the proxy on connections for. These hosts can use title="Proxy configurations will be automatically fetched from Proxy PAC file.">
wildcards such as *.example.com."> Auto
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span> </span>
</label> </label>
<input id="proxy-excl" class="form-control operationDataKeys" data-key="proxyExclList"
placeholder="[ Comma (,) separated list of proxy exclusions. These hosts can use
wildcards such as *.example.com. ]"/>
</div> </div>
<div class="wr-input-control" id="control-proxy-username"> <div id="global-proxy-configuration-type-manual" class="wr-input-control" style="display:block">
<label class="wr-input-label" for="proxy-username"> <div class="wr-input-control">
Username <label class="wr-input-label" for="proxy-host">
<span class="helper" title="Username for the proxy server."> Proxy Host
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="helper required" title="Host name/IP address of the proxy server.">
</span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</label> </span>
<input id="proxy-username" class="form-control operationDataKeys" </label>
data-key="proxyUsername" maxlength="50"/> <input id="proxy-host" class="form-control operationDataKeys" data-key="proxyHost"
placeholder="[ 192.168.8.1 ]"/>
</div>
<div class="wr-input-control">
<label class="wr-input-label" for="proxy-port">
Proxy Port
<span class="helper required" title="Target port for the proxy server">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<label id="proxyPortValidationText" class="wr-input-label hidden">
Target port should be between 0 - 65535
</label>
<input id="proxy-port" class="form-control operationDataKeys" data-key="proxyPort"
placeholder="[ Target port 0-65535 ]"/>
</div>
<div class="wr-input-control">
<label class="wr-input-label" for="proxy-excl">
Proxy Exclusion List
<span class="helper"
title="Add hostnames to this separated by commas to prevent them from routing through the proxy server.
The hostname entries can be wildcards such as *.example.com">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<input id="proxy-excl" class="form-control operationDataKeys" data-key="proxyExclList"
placeholder="[ Example: localhost, *.example.com ]"/>
</div>
<div class="wr-input-control" id="control-proxy-username">
<label class="wr-input-label" for="proxy-username">
Username
<span class="helper" title="Username for the proxy server.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<input id="proxy-username" class="form-control operationDataKeys"
data-key="proxyUsername" maxlength="50"/>
</div>
<div class="wr-input-control" id="control-proxy-password">
<label class="wr-input-label" for="proxy-password">
Password
<span class="helper" title="Password for the proxy server.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
</label>
<input id="proxy-password" type="password" class="form-control operationDataKeys"
data-key="proxyPassword" maxlength="100"/>
</div>
</div> </div>
<div class="wr-input-control" id="control-proxy-password"> <div id="global-proxy-configuration-type-auto" class="wr-input-control" style="display:none">
<label class="wr-input-label" for="proxy-password"> <div class="wr-input-control">
Password <label class="wr-input-label" for="proxy-host">
<span class="helper" title="Password for the proxy server."> Proxy PAC File URL
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="helper required" title="URL for the proxy auto config PAC script">
</span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</label> </span>
<input id="proxy-password" type="password" class="form-control operationDataKeys" </label>
data-key="proxyPassword" maxlength="100"/> <input id="proxy-pac-url" class="form-control operationDataKeys" data-key="proxyPacUrl"
placeholder="[ http://exampleproxy.com/proxy.pac ]"/>
</div>
</div> </div>
<!--</div>-->
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save