ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathanhur...@apache.org
Subject [12/50] [abbrv] git commit: AMBARI-7612 Installer page opens before monitoring loading. (Buzhor Denys via atkach)
Date Sat, 04 Oct 2014 03:16:55 GMT
AMBARI-7612 Installer page opens before monitoring loading. (Buzhor Denys via atkach)


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

Branch: refs/heads/branch-alerts-dev
Commit: 5c45997e1f4b5a3c6c26323779379b6ca697c2ea
Parents: efbaf5c
Author: atkach <atkach@hortonworks.com>
Authored: Thu Oct 2 16:14:05 2014 +0300
Committer: atkach <atkach@hortonworks.com>
Committed: Thu Oct 2 16:14:05 2014 +0300

----------------------------------------------------------------------
 ambari-web/app/router.js | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5c45997e/ambari-web/app/router.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/router.js b/ambari-web/app/router.js
index 60967a8..e1c2a5c 100644
--- a/ambari-web/app/router.js
+++ b/ambari-web/app/router.js
@@ -126,7 +126,7 @@ App.Router = Em.Router.extend({
   onAuthenticationSuccess: function (data) {
     this.set('loggedIn', true);
     if (data.items.length) {
-      this.set('clusterInstallCompleted', data.items[0].Clusters.provisioning_state === 'INSTALLED');
+      this.setClusterInstalled(data);
     }
   },
 
@@ -198,6 +198,15 @@ App.Router = Em.Router.extend({
     this.setUser(App.User.find().findProperty('id', userName));
   },
 
+  /**
+   * Set `clusterInstallCompleted` property based on cluster info response.
+   *
+   * @param {Object} clusterObject
+   **/
+  setClusterInstalled: function(clusterObject) {
+    this.set('clusterInstallCompleted', clusterObject.items[0].Clusters.provisioning_state
=== 'INSTALLED')
+  },
+
   login: function () {
     var controller = this.get('loginController');
     var loginName = controller.get('loginName').toLowerCase();
@@ -279,6 +288,7 @@ App.Router = Em.Router.extend({
       if (isAdmin) {
         App.set('isAdmin', true);
         if (clustersData.items.length) {
+          router.setClusterInstalled(clustersData);
           transitionToApp = true;
         } else {
           window.location = adminViewUrl;
@@ -286,7 +296,7 @@ App.Router = Em.Router.extend({
         }
       } else {
         if (clustersData.items.length) {
-          this.set('clusterInstallCompleted', clustersData.items[0].Clusters.provisioning_state
=== 'INSTALLED');
+          router.setClusterInstalled(clustersData);
           //TODO: Iterate over clusters
           var clusterName = clustersData.items[0].Clusters.cluster_name;
           var clusterPermissions = privileges.items.filterProperty('PrivilegeInfo.cluster_name',
clusterName).mapProperty('PrivilegeInfo.permission_name');


Mime
View raw message