Repository: ambari Updated Branches: refs/heads/trunk 8c59e4a3d -> 4abb993ee
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/4abb993e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4abb993e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4abb993e Branch: refs/heads/trunk Commit: 4abb993ee4e519a6bdfa6f1bedea85563b401cac Parents: 8c59e4a Author: atkach <atk...@hortonworks.com> Authored: Fri Oct 17 13:45:35 2014 +0300 Committer: atkach <atk...@hortonworks.com> Committed: Fri Oct 17 13:45:35 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/4abb993e/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/4abb993e/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;