Repository: ambari
Updated Branches:
  refs/heads/branch-1.7.0 25d0b121e -> f3b44b329


AMBARI-7827 Admin View: the user is allowed to go to the dashboard while 
cluster deploy is happening. (Levgen Gorbachev via atkach)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f3b44b32
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f3b44b32
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f3b44b32

Branch: refs/heads/branch-1.7.0
Commit: f3b44b329ddad03db51f86f647609cf8556a6fa2
Parents: 25d0b12
Author: atkach <atk...@hortonworks.com>
Authored: Fri Oct 17 13:46:49 2014 +0300
Committer: atkach <atk...@hortonworks.com>
Committed: Fri Oct 17 13:46:49 2014 +0300

----------------------------------------------------------------------
 .../app/scripts/controllers/NavbarCtrl.js        | 16 +++++++++++-----
 .../app/scripts/controllers/mainCtrl.js          | 19 ++++++++++++-------
 2 files changed, 23 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f3b44b32/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/NavbarCtrl.js
----------------------------------------------------------------------
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/NavbarCtrl.js
 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/NavbarCtrl.js
index d88864b..d020111 100644
--- 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/NavbarCtrl.js
+++ 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/NavbarCtrl.js
@@ -25,11 +25,17 @@ angular.module('ambariAdminConsole')
     editingName : false
   };
 
-  Cluster.getStatus().then(function(cluster) {
-    $scope.cluster = cluster;
-  }).catch(function(data) {
-    Alert.error('Cannot load cluster status', data.data.message);
-  });
+  function loadClusterData(){
+    Cluster.getStatus().then(function(cluster) {
+      $scope.cluster = cluster;
+      if(cluster.Clusters.provisioning_state === 'INIT'){
+        setTimeout(loadClusterData, 1000);
+      }
+    }).catch(function(data) {
+      Alert.error('Cannot load cluster status', data.data.message);
+    });
+  };
+  loadClusterData();
 
   $scope.toggleEditName = function($event) {
     if ($event && $event.keyCode !== 27) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/f3b44b32/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
----------------------------------------------------------------------
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
index eaed5f5..8b8aacc 100644
--- 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
+++ 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
@@ -46,13 +46,18 @@ angular.module('ambariAdminConsole')
   $scope.cluster = null;
   $scope.isLoaded = null;
 
-  Cluster.getStatus().then(function(cluster) {
-    $scope.cluster = cluster;
-    $scope.isLoaded = true;
-  }).catch(function(data) {
-    Alert.error('Check cluster status error', data.data.message);
-  });
-
+  function loadClusterData(){
+    Cluster.getStatus().then(function(cluster) {
+      $scope.cluster = cluster;
+      $scope.isLoaded = true;
+      if(cluster.Clusters.provisioning_state === 'INIT'){
+        setTimeout(loadClusterData, 1000);
+      }
+    }).catch(function(data) {
+      Alert.error('Cannot load cluster status', data.data.message);
+    });
+  };
+  loadClusterData();
   $scope.viewInstances = [];
   View.getAllVisibleInstance().then(function(instances) {
     $scope.viewInstances = instances;

Reply via email to