You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2013/03/07 23:43:53 UTC

svn commit: r1454142 - in /incubator/ambari/trunk: CHANGES.txt ambari-web/app/controllers/global/cluster_controller.js ambari-web/app/controllers/main.js ambari-web/app/templates/main.hbs

Author: yusaku
Date: Thu Mar  7 22:43:52 2013
New Revision: 1454142

URL: http://svn.apache.org/r1454142
Log:
AMBARI-1546. Improve Cluster Management loading screen. (Xi Wang via yusaku)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/controllers/global/cluster_controller.js
    incubator/ambari/trunk/ambari-web/app/controllers/main.js
    incubator/ambari/trunk/ambari-web/app/templates/main.hbs

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1454142&r1=1454141&r2=1454142&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Thu Mar  7 22:43:52 2013
@@ -105,6 +105,8 @@ Trunk (unreleased changes):
 
  IMPROVEMENTS
 
+ AMBARI-1546. Improve Cluster Management loading screen. (Xi Wang via yusaku)
+
  AMBARI-1537. Constrain the width of all wizard popups. (Xi Wang via yusaku)
 
  AMBARI-1536. Hosts page layout fixes. (Xi Wang via yusaku)

Modified: incubator/ambari/trunk/ambari-web/app/controllers/global/cluster_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/global/cluster_controller.js?rev=1454142&r1=1454141&r2=1454142&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/global/cluster_controller.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/global/cluster_controller.js Thu Mar  7 22:43:52 2013
@@ -22,6 +22,7 @@ App.ClusterController = Em.Controller.ex
   name:'clusterController',
   cluster:null,
   isLoaded:false,
+  clusterDataLoadedPercent: 'width:0', // 0 to 1
   /**
    * Whether we need to update statuses automatically or not
    */
@@ -29,13 +30,19 @@ App.ClusterController = Em.Controller.ex
   updateLoadStatus:function (item) {
     var loadList = this.get('dataLoadList');
     var loaded = true;
+    var numLoaded= 0;
     loadList.set(item, true);
     for (var i in loadList) {
       if (loadList.hasOwnProperty(i) && !loadList[i] && loaded) {
         loaded = false;
       }
+      // calculate the number of true
+      if (loadList.hasOwnProperty(i) && loadList[i]){
+        numLoaded++;
+      }
     }
     this.set('isLoaded', loaded);
+    this.set('clusterDataLoadedPercent', 'width:' + (Math.floor(numLoaded/6*100)).toString() + '%');
   },
 
   dataLoadList:Em.Object.create({
@@ -294,7 +301,7 @@ App.ClusterController = Em.Controller.ex
         self.updateLoadStatus('cluster');
       }
     }, function (jqXHR, textStatus) {
-      self.updateLoadStatus('cluster');
+        self.updateLoadStatus('cluster');
     });
 
     App.HttpClient.get(hostsUrl, App.hostsMapper, {
@@ -302,7 +309,7 @@ App.ClusterController = Em.Controller.ex
         self.updateLoadStatus('hosts');
       }
     }, function (jqXHR, textStatus) {
-      self.updateLoadStatus('hosts');
+        self.updateLoadStatus('hosts');
     });
 
     App.HttpClient.get(usersUrl, App.usersMapper, {
@@ -310,15 +317,15 @@ App.ClusterController = Em.Controller.ex
         self.updateLoadStatus('users');
       }
     }, function (jqXHR, textStatus) {
-      self.updateLoadStatus('users');
+        self.updateLoadStatus('users');
     });
 
     App.router.get('updateController').updateServiceMetric(function(){
-      self.updateLoadStatus('services');
+        self.updateLoadStatus('services');
     }, true);
 
     this.loadAlerts(function(){
-      self.updateLoadStatus('alerts');
+        self.updateLoadStatus('alerts');
     });
 
   },

Modified: incubator/ambari/trunk/ambari-web/app/controllers/main.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/main.js?rev=1454142&r1=1454141&r2=1454142&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/main.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/main.js Thu Mar  7 22:43:52 2013
@@ -34,8 +34,12 @@ App.MainController = Em.Controller.exten
   }.observes('App.router.clusterController.clusterName'),
 
   isClusterDataLoaded: function(){
-      return App.router.get('clusterController.isLoaded');
+    return App.router.get('clusterController.isLoaded');
   }.property('App.router.clusterController.isLoaded'),
+
+  clusterDataLoadedPercent: function(){
+    return App.router.get('clusterController.clusterDataLoadedPercent');
+  }.property('App.router.clusterController.clusterDataLoadedPercent'),
   /**
    * run all processes and cluster's data loading
    */

Modified: incubator/ambari/trunk/ambari-web/app/templates/main.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main.hbs?rev=1454142&r1=1454141&r2=1454142&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/main.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/main.hbs Thu Mar  7 22:43:52 2013
@@ -17,14 +17,18 @@
 }}
 
 {{#if isClusterDataLoaded}}
-<div id="main-nav">
-  <div class="navbar">
-    <div class="navbar-inner">
-      {{view App.MainMenuView}}
+  <div id="main-nav">
+    <div class="navbar">
+      <div class="navbar-inner">
+        {{view App.MainMenuView}}
+      </div>
     </div>
   </div>
-</div>
-{{outlet}}
-{{else}}
-<h2>{{t app.loadingPlaceholder}}</h2>
-{{/if}}
\ No newline at end of file
+  {{outlet}}
+{{/if}}
+{{#unless isClusterDataLoaded}}
+  <h2>{{t app.loadingPlaceholder}} </h2>
+  <div class="progress progress-striped active">
+    <div class="bar" {{bindAttr style="controller.clusterDataLoadedPercent"}}></div>
+  </div>
+{{/unless}}
\ No newline at end of file