[ui] disabled cluster removal during validation running

This commit is contained in:
Kirill Ishanov
2013-10-22 04:39:31 -07:00
parent 0e9a41d1e6
commit 94f35651d7
2 changed files with 16 additions and 7 deletions

View File

@@ -54,7 +54,6 @@ angular.module('rubick.controllers', []).
}
$scope.showAddClusterModal = function() {
$('#add-cluster-modal').modal();
$('#add-cluster-modal').modal('show');
}
@@ -94,11 +93,19 @@ angular.module('rubick.controllers', []).
$scope.diagnosticsFinished = false;
}
$scope.removeCluster = function(clusterId) {
$('#remove-cluster-confirm-modal').modal();
$('#remove-cluster-confirm-modal').modal('show');
$scope.unselectCluster = function() {
if (!$scope.runningValidation) {
$scope.selectedCluster = undefined;
}
}
$scope.clusterIdToRemove = clusterId;
$scope.removeCluster = function(clusterId) {
if (!$scope.runningValidation) {
$('#remove-cluster-confirm-modal').modal('show');
$scope.clusterIdToRemove = clusterId;
}
}
$scope.removeConfirm = function() {
@@ -106,6 +113,7 @@ angular.module('rubick.controllers', []).
$scope.clusterIdToRemove = undefined;
$http.delete(url).success(function() {
$scope.selectedCluster = undefined;
$scope.fetchClusters();
$('#remove-cluster-confirm-modal').modal('hide');
}).error(function() {

View File

@@ -18,7 +18,7 @@
<div class="ui pointing left red label" ng-show="selectedCluster">
Selected Cluster:
<div class="detail">{{selectedCluster.name}}</div>
<i class="delete icon" ng-click="selectedCluster = undefined"></i>
<i class="delete icon" ng-click="unselectCluster()"></i>
</div>
</div>
@@ -46,6 +46,7 @@
<div class="item" ng-repeat="cluster in clusters">
<div class="content">
<a class="remove ui corner label"
ng-disabled="runningValidation"
ng-click="removeCluster(cluster.id)">
<i class="remove icon"></i>
</a>
@@ -106,7 +107,7 @@
name="nodes"
id="nodes"
required
ng-pattern="/^(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))$/"
ng-pattern="/(?:(\w+)@)?([^:]+)(?::(\d+))?/"
ng-model="newCluster.nodes">
<i class="terminal icon"></i>
<div class="ui corner label">