- Make validation a bit nicer:

- Add timeout to the DB validation
  - Make DB validation exception handling a bit nicer
  - Move the DB validation error message

- Fix bug around RADOS config default for Is Secure
- Allow hiding of the validation box
This commit is contained in:
Joseph Schorr 2015-01-08 15:27:49 -05:00
parent 47fb10b79f
commit bfd273d16f
6 changed files with 56 additions and 20 deletions

View file

@ -110,6 +110,12 @@ angular.module("core-config-setup", ['angularFileUpload'])
return hasError ? 'failed' : 'success';
};
$scope.cancelValidation = function() {
$('#validateAndSaveModal').modal('hide');
$scope.validating = null;
$scope.savingConfiguration = false;
};
$scope.validateService = function(serviceInfo) {
var params = {
'service': serviceInfo.service.id
@ -238,6 +244,7 @@ angular.module("core-config-setup", ['angularFileUpload'])
var allowedFields = $scope.STORAGE_CONFIG_FIELDS[value];
var configObject = $scope.config.DISTRIBUTED_STORAGE_CONFIG.local[1];
// Remove any fields not allowed.
for (var fieldName in configObject) {
if (!configObject.hasOwnProperty(fieldName)) {
continue;
@ -251,6 +258,13 @@ angular.module("core-config-setup", ['angularFileUpload'])
delete configObject[fieldName];
}
}
// Set any boolean fields to false.
for (var i = 0; i < allowedFields.length; ++i) {
if (allowedFields[i].kind == 'bool') {
configObject[allowedFields[i].name] = false;
}
}
});
$scope.$watch('config', function(value) {