[ui] disabled cluster removal during validation running
This commit is contained in:
		@@ -54,7 +54,6 @@ angular.module('rubick.controllers', []).
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    $scope.showAddClusterModal = function() {
 | 
			
		||||
        $('#add-cluster-modal').modal();
 | 
			
		||||
        $('#add-cluster-modal').modal('show');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -94,18 +93,27 @@ angular.module('rubick.controllers', []).
 | 
			
		||||
        $scope.diagnosticsFinished = false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    $scope.unselectCluster = function() {
 | 
			
		||||
        if (!$scope.runningValidation) {
 | 
			
		||||
            $scope.selectedCluster = undefined;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    $scope.removeCluster = function(clusterId) {
 | 
			
		||||
        $('#remove-cluster-confirm-modal').modal();
 | 
			
		||||
        if (!$scope.runningValidation) {
 | 
			
		||||
            $('#remove-cluster-confirm-modal').modal('show');
 | 
			
		||||
 | 
			
		||||
            $scope.clusterIdToRemove = clusterId;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    $scope.removeConfirm = function() {
 | 
			
		||||
        var url = '/clusters/' + $scope.clusterIdToRemove;
 | 
			
		||||
        $scope.clusterIdToRemove = undefined;
 | 
			
		||||
 | 
			
		||||
        $http.delete(url).success(function() {
 | 
			
		||||
            $scope.selectedCluster = undefined;
 | 
			
		||||
            $scope.fetchClusters();
 | 
			
		||||
            $('#remove-cluster-confirm-modal').modal('hide');
 | 
			
		||||
        }).error(function() {
 | 
			
		||||
 
 | 
			
		||||
@@ -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">
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user