From 94f35651d7a750fc4e4525115f48e0c8689c13be Mon Sep 17 00:00:00 2001 From: Kirill Ishanov Date: Tue, 22 Oct 2013 04:39:31 -0700 Subject: [PATCH] [ui] disabled cluster removal during validation running --- .../js/controllers/validate_controller.js | 18 +++++++++++++----- config-validator-ui-concept/partials/main.html | 5 +++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/config-validator-ui-concept/js/controllers/validate_controller.js b/config-validator-ui-concept/js/controllers/validate_controller.js index 6d56dcc..d3258a4 100644 --- a/config-validator-ui-concept/js/controllers/validate_controller.js +++ b/config-validator-ui-concept/js/controllers/validate_controller.js @@ -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() { diff --git a/config-validator-ui-concept/partials/main.html b/config-validator-ui-concept/partials/main.html index cc04365..6d324a4 100644 --- a/config-validator-ui-concept/partials/main.html +++ b/config-validator-ui-concept/partials/main.html @@ -18,7 +18,7 @@
Selected Cluster:
{{selectedCluster.name}}
- +
@@ -46,6 +46,7 @@
@@ -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">