Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/duplicati/duplicati.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Skovhede <kenneth@hexad.dk>2015-12-12 17:31:07 +0300
committerKenneth Skovhede <kenneth@hexad.dk>2015-12-12 17:31:07 +0300
commitcf600cd8287bd36efb88183297ae7686ab10d51a (patch)
tree4d6cdcebecfba02340cd389d74b8843d5fdaf34c
parent83cdb07085f4b7d12e832e51cd182366852b6d66 (diff)
Fixed case insensitive lookup for advanced operations of the enum type.
This closes #1519
-rw-r--r--Duplicati/Server/webroot/ngax/scripts/directives/parseAdvancedOption.js14
-rw-r--r--Duplicati/Server/webroot/ngax/templates/advancedoptionseditor.html2
2 files changed, 14 insertions, 2 deletions
diff --git a/Duplicati/Server/webroot/ngax/scripts/directives/parseAdvancedOption.js b/Duplicati/Server/webroot/ngax/scripts/directives/parseAdvancedOption.js
index eb22dd9b2..9f362c38c 100644
--- a/Duplicati/Server/webroot/ngax/scripts/directives/parseAdvancedOption.js
+++ b/Duplicati/Server/webroot/ngax/scripts/directives/parseAdvancedOption.js
@@ -5,6 +5,7 @@ backupApp.directive('parseAdvancedOption', function(AppUtils) {
link: function(scope, element, attr, ctrl) {
var name = null;
+ var sc = scope;
ctrl[0].$parsers.push(function(txt) {
if (name == null)
@@ -18,7 +19,18 @@ backupApp.directive('parseAdvancedOption', function(AppUtils) {
var ix = src.indexOf('=');
if (ix >= 0) {
name = src.substr(0, ix);
- return src.substr(ix + 1);
+ val = src.substr(ix + 1);
+
+ if (attr.parseAdvancedOption != '') {
+ var items = sc.$eval(attr.parseAdvancedOption);
+ for(var x in items) {
+ if (items[x].toLowerCase() == val.toLowerCase())
+ return items[x];
+ }
+ }
+
+ return val;
+
}
else
{
diff --git a/Duplicati/Server/webroot/ngax/templates/advancedoptionseditor.html b/Duplicati/Server/webroot/ngax/templates/advancedoptionseditor.html
index 995315480..7da7200a9 100644
--- a/Duplicati/Server/webroot/ngax/templates/advancedoptionseditor.html
+++ b/Duplicati/Server/webroot/ngax/templates/advancedoptionseditor.html
@@ -3,7 +3,7 @@
<div>
<label class="shortname">{{getShortName(item)}}</label>
- <select ng-if="getInputType(item) == 'enum'" ng-options="n for n in getEnumerations(item)" ng-model="$parent.ngModel[$index]" parse-advanced-option ></select>
+ <select ng-if="getInputType(item) == 'enum'" ng-options="n for n in getEnumerations(item)" ng-model="$parent.ngModel[$index]" parse-advanced-option="getEnumerations(item)" ></select>
<input ng-if="getInputType(item) == 'bool'" type="checkbox" ng-model="$parent.ngModel[$index]" parse-advanced-option-bool ></input>
<input ng-if="getInputType(item) == 'password'" type="password" ng-model="$parent.ngModel[$index]" parse-advanced-option ></input>
<input ng-if="getInputType(item) == 'text'" type="text" ng-model="$parent.ngModel[$index]" parse-advanced-option ></input>