[ui] making loading indicator on 'run validation' button during validation
This commit is contained in:
@@ -115,6 +115,7 @@ angular.module('rubick.controllers', []).
|
||||
|
||||
$scope.runValidation = function() {
|
||||
var postData = { cluster_id: $scope.selectedCluster.id }
|
||||
$scope.runningValidation = true;
|
||||
|
||||
$http.post('/validation', postData).success(function(job) {
|
||||
$scope.currentJobId = job.id;
|
||||
@@ -127,9 +128,11 @@ angular.module('rubick.controllers', []).
|
||||
case "success":
|
||||
$scope.results = jobData.result;
|
||||
$scope.diagnosticsFinished = true;
|
||||
$scope.runningValidation = false;
|
||||
break;
|
||||
case "failure":
|
||||
$scope.jobError = jobData.message;
|
||||
$scope.runningValidation = false;
|
||||
break;
|
||||
default:
|
||||
poll();
|
||||
|
||||
@@ -187,7 +187,10 @@
|
||||
<div><strong>Cluster Name: </strong>{{selectedCluster.name}}</div>
|
||||
<div><strong>Rules selected: </strong>{{rules.length}}</div>
|
||||
<div style="margin-top: 15px;">
|
||||
<a class="ui blue button" ng-click="runValidation()">Run Validation</a>
|
||||
<a class="ui blue button"
|
||||
ng-click="runValidation()"
|
||||
ng-class="{'loading': runningValidation}"
|
||||
ng-disabled="runningValidation">Run Validation</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user