parent
40473f9fbd
commit
adaeeba5d0
7 changed files with 129 additions and 43 deletions
|
@ -467,6 +467,10 @@ a:focus {
|
|||
width: 400px;
|
||||
}
|
||||
|
||||
.config-setup-tool-element .config-table > tbody > tr > td .config-string-list-field-element {
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
.config-map-field-element table {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
|
|
@ -595,23 +595,36 @@
|
|||
<tr>
|
||||
<td>Base DN:</td>
|
||||
<td>
|
||||
<span class="config-list-field" item-title="DN" binding="config.LDAP_BASE_DN"></span>
|
||||
<span class="config-string-list-field" item-title="DN piece" item-delimiter="," binding="config.LDAP_BASE_DN"></span>
|
||||
<div class="help-text">
|
||||
A list of Distinguished Name pieces which forms the base path for
|
||||
looking up all LDAP records.
|
||||
A Distinguished Name path which forms the base path for looking up all LDAP records.
|
||||
</div>
|
||||
<div class="help-text">
|
||||
Example: [dc=my,dc=domain,dc=com]
|
||||
Example: dc=my,dc=domain,dc=com
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>User Relative DN:</td>
|
||||
<td>
|
||||
<span class="config-list-field" item-title="RDN" binding="config.LDAP_USER_RDN"></span>
|
||||
<span class="config-string-list-field" item-title="RDN piece" item-delimiter="," binding="config.LDAP_USER_RDN"></span>
|
||||
<div class="help-text">
|
||||
A list of Distinguished Name pieces which forms the base path for
|
||||
looking up all user LDAP records, relative to the Base DN defined above.
|
||||
A Distinguished Name path which forms the base path for looking up all user LDAP records,
|
||||
relative to the Base DN defined above.
|
||||
</div>
|
||||
<div class="help-text">
|
||||
Example: ou=employees
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Secondary User Relative DNs:</td>
|
||||
<td>
|
||||
<span class="config-list-field" item-title="RDN" binding="config.LDAP_SECONDARY_USER_RDNS"></span>
|
||||
<div class="help-text">
|
||||
A list of Distinguished Name path(s) which forms the secondary base path(s) for
|
||||
looking up all user LDAP records, relative to the Base DN defined above. These path(s)
|
||||
will be tried if the user is not found via the primary relative DN.
|
||||
</div>
|
||||
<div class="help-text">
|
||||
Example: [ou=employees]
|
||||
|
|
6
static/directives/config/config-string-list-field.html
Normal file
6
static/directives/config/config-string-list-field.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
<div class="config-string-list-field-element">
|
||||
<form name="fieldform" novalidate>
|
||||
<input type="text" class="form-control" placeholder="{{ placeholder || '' }}"
|
||||
ng-model="internalBinding" ng-trim="true" ng-minlength="1" ng-required="!isOptional">
|
||||
</form>
|
||||
</div>
|
|
@ -1162,16 +1162,16 @@ angular.module("core-config-setup", ['angularFileUpload'])
|
|||
$scope.patternMap = {};
|
||||
|
||||
$scope.getRegexp = function(pattern) {
|
||||
if (!pattern) {
|
||||
pattern = '.*';
|
||||
}
|
||||
if (!pattern) {
|
||||
pattern = '.*';
|
||||
}
|
||||
|
||||
if ($scope.patternMap[pattern]) {
|
||||
return $scope.patternMap[pattern];
|
||||
}
|
||||
if ($scope.patternMap[pattern]) {
|
||||
return $scope.patternMap[pattern];
|
||||
}
|
||||
|
||||
return $scope.patternMap[pattern] = new RegExp(pattern);
|
||||
};
|
||||
return $scope.patternMap[pattern] = new RegExp(pattern);
|
||||
};
|
||||
|
||||
$scope.$watch('binding', function(binding) {
|
||||
if (firstSet && !binding && $scope.defaultValue) {
|
||||
|
@ -1184,4 +1184,36 @@ angular.module("core-config-setup", ['angularFileUpload'])
|
|||
}
|
||||
};
|
||||
return directiveDefinitionObject;
|
||||
})
|
||||
|
||||
.directive('configStringListField', function () {
|
||||
var directiveDefinitionObject = {
|
||||
priority: 0,
|
||||
templateUrl: '/static/directives/config/config-string-list-field.html',
|
||||
replace: false,
|
||||
transclude: false,
|
||||
restrict: 'C',
|
||||
scope: {
|
||||
'binding': '=binding',
|
||||
'itemTitle': '@itemTitle',
|
||||
'itemDelimiter': '@itemDelimiter',
|
||||
'placeholder': '@placeholder',
|
||||
'isOptional': '=isOptional'
|
||||
},
|
||||
controller: function($scope, $element) {
|
||||
$scope.$watch('internalBinding', function(value) {
|
||||
if (value) {
|
||||
$scope.binding = value.split($scope.itemDelimiter);
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$watch('binding', function(value) {
|
||||
if (value) {
|
||||
$scope.internalBinding = value.join($scope.itemDelimiter);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
return directiveDefinitionObject;
|
||||
});
|
||||
|
||||
|
|
Reference in a new issue