Check if passwords match on OS Global Config page
Change-Id: Ia4d2ccb57687595e0efb13f5783f8a4ebc8819be
This commit is contained in:
parent
9da83e84da
commit
03f6c7610a
@ -709,8 +709,8 @@ compassAppDev.run(function($httpBackend, settings, $http) {
|
||||
var config = {
|
||||
"os_config": {
|
||||
"server_credentials": {
|
||||
"username": "admin",
|
||||
"password": "admin"
|
||||
"username": "root",
|
||||
"password": "huawei"
|
||||
},
|
||||
"partition": {
|
||||
"/var": {
|
||||
|
@ -564,4 +564,4 @@ define(['angular'], function() {
|
||||
return "";
|
||||
};
|
||||
});
|
||||
})
|
||||
})
|
||||
|
@ -4,13 +4,13 @@
|
||||
<form id="generalForm" name="generalForm" class="form-horizontal" role="form">
|
||||
<!-- Use metadata to generate the form. might be used later -->
|
||||
<!--<div class="form-group" ng-repeat="(key, data) in os_global_config['general']">
|
||||
<div ng-if="key!='_self'">
|
||||
<label class="col-sm-4 control-label no-padding-right">{{data.display}}</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="col-xs-10 col-sm-5" placeholder="{{data.display}}" name="{{key}}" popover-title="Help" popover="{{data.description}}" popover-trigger="focus" popover-placement="right">
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
<div ng-if="key!='_self'">
|
||||
<label class="col-sm-4 control-label no-padding-right">{{data.display}}</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="col-xs-10 col-sm-5" placeholder="{{data.display}}" name="{{key}}" popover-title="Help" popover="{{data.description}}" popover-trigger="focus" popover-placement="right">
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
<!--TODO: use json to generate inputs-->
|
||||
<div class="form-group">
|
||||
<div>
|
||||
@ -203,11 +203,13 @@
|
||||
<span class="text-danger">*</span>
|
||||
</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="password" class="col-xs-10 col-sm-5" placeholder="Confirm Password" ng-model="confirmPassword" name="server-confirmpassword" required>
|
||||
<input type="password" class="col-xs-10 col-sm-5" placeholder="Confirm Password" ng-model="confirmPassword" data-match="server_credentials.password" name="confirmPassword" required>
|
||||
<div class="margin-left-14 inline">
|
||||
<span class="text-danger" data-ng-show="generalForm.confirmPassword.$error.match">Passwords do not match</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<!--table class="table table-hover nowrap">
|
||||
|
@ -10,6 +10,7 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
|
||||
'angularSpinner',
|
||||
'ngAnimate'
|
||||
]);
|
||||
|
||||
wizardModule.config(function config($stateProvider) {
|
||||
$stateProvider
|
||||
.state('wizard', {
|
||||
@ -74,8 +75,6 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
// get pre-config data for wizard and set wizard steps based on different adapters
|
||||
var oldConfig = clusterConfigData;
|
||||
$scope.steps = [];
|
||||
@ -413,7 +412,7 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
|
||||
$scope.ifPreSelect = function(server) {
|
||||
server.disabled = false;
|
||||
if (server.clusters) {
|
||||
if(server.clusters.length > 0) {
|
||||
if (server.clusters.length > 0) {
|
||||
server.disabled = true;
|
||||
}
|
||||
angular.forEach(server.clusters, function(svCluster) {
|
||||
@ -611,9 +610,16 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
|
||||
wizardFactory.setCommitState(commitState);
|
||||
});
|
||||
} else {
|
||||
var message = {
|
||||
"message": "The required(*) fields can not be empty !"
|
||||
};
|
||||
var message = {};
|
||||
if ($scope.generalForm.$error.required) {
|
||||
message = {
|
||||
"message": "The required(*) fields can not be empty !"
|
||||
};
|
||||
} else if ($scope.generalForm.$error.match) {
|
||||
message = {
|
||||
"message": "The passwords do not match"
|
||||
};
|
||||
}
|
||||
var commitState = {
|
||||
"name": "os_global",
|
||||
"state": "error",
|
||||
@ -880,7 +886,7 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
|
||||
var ip_start = $("#" + key + "-ipstart").val();
|
||||
var interval = parseInt($("#" + key + "-increase-num").val());
|
||||
$scope.fillIPBySequence(ip_start, interval, key);
|
||||
})
|
||||
});
|
||||
// Autofill hostname
|
||||
var hostname_rule = $("#hostname-rule").val();
|
||||
$scope.fillHostname(hostname_rule);
|
||||
@ -924,15 +930,15 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
|
||||
angular.forEach($scope.servers, function(server) {
|
||||
if (ipParts[3] > 255) {
|
||||
ipParts[3] = ipParts[3] - 256;
|
||||
ipParts[2]++;
|
||||
ipParts[2] ++;
|
||||
}
|
||||
if (ipParts[2] > 255) {
|
||||
ipParts[2] = ipParts[2] - 256;
|
||||
ipParts[1]++;
|
||||
ipParts[1] ++;
|
||||
}
|
||||
if (ipParts[1] > 255) {
|
||||
ipParts[1] = ipParts[1] - 256;
|
||||
ipParts[0]++;
|
||||
ipParts[0] ++;
|
||||
}
|
||||
if (ipParts[0] > 255) {
|
||||
server.networks[interface].ip = "";
|
||||
@ -1243,7 +1249,7 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
|
||||
}
|
||||
}
|
||||
};
|
||||
if($scope.currentAdapterName == "ceph_openstack_icehouse") {
|
||||
if ($scope.currentAdapterName == "ceph_openstack_icehouse") {
|
||||
targetSysConfigData["package_config"]["ceph_config"] = $scope.cephConfig;
|
||||
}
|
||||
dataService.updateClusterConfig(cluster.id, targetSysConfigData).success(function(data) {
|
||||
@ -1726,7 +1732,7 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne
|
||||
});
|
||||
}).error(function(data) {
|
||||
console.warn("Review hosts error: ", data);
|
||||
})
|
||||
});
|
||||
//TODO: error handling
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user