incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject svn commit: r1476475 - in /incubator/ambari/trunk: CHANGES.txt ambari-web/app/controllers/main.js ambari-web/app/routes/main.js
Date Sat, 27 Apr 2013 03:04:59 GMT
Author: yusaku
Date: Sat Apr 27 03:04:58 2013
New Revision: 1476475

URL: http://svn.apache.org/r1476475
Log:
AMBARI-2029. Error when loading /main/services directly. (yusaku)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/controllers/main.js
    incubator/ambari/trunk/ambari-web/app/routes/main.js

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1476475&r1=1476474&r2=1476475&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Sat Apr 27 03:04:58 2013
@@ -798,6 +798,8 @@ Trunk (unreleased changes):
  Farrellee via mahadev)
 
  BUG FIXES
+
+ AMBARI-2029. Error when loading /main/services directly. (yusaku)
  
  AMBARI-2039. Service check should be scheduled on a client that is on
  a host in HEALTHY state. (smohanty)

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=1476475&r1=1476474&r2=1476475&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/main.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/main.js Sat Apr 27 03:04:58 2013
@@ -54,6 +54,23 @@ App.MainController = Em.Controller.exten
       console.log('Administrator logged in');
     }
   },
+
+  dataLoading: function () {
+    var self = this;
+    var dfd = $.Deferred();
+    if (App.router.get('clusterController.isLoaded')) {
+      dfd.resolve();
+    } else {
+      var interval = setInterval(function () {
+        if (self.get('isClusterDataLoaded')) {
+          dfd.resolve();
+          clearInterval(interval);
+        }
+      }, 50);
+    }
+    return dfd.promise();
+  },
+
   startPolling: function(){
     App.router.get('updateController').set('isWorking', true);
     App.router.get('backgroundOperationsController').set('isWorking', true);

Modified: incubator/ambari/trunk/ambari-web/app/routes/main.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/routes/main.js?rev=1476475&r1=1476474&r2=1476475&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/routes/main.js (original)
+++ incubator/ambari/trunk/ambari-web/app/routes/main.js Sat Apr 27 03:04:58 2013
@@ -785,13 +785,16 @@ module.exports = Em.Route.extend({
     index: Ember.Route.extend({
       route: '/',
       enter: function (router) {
-        Ember.run.next(function () {
+        Ember.run.next(function(){
+        var controller = router.get('mainController');
+        controller.dataLoading().done(function () {
           var service = router.get('mainServiceItemController.content');
           if (!service) {
             service = App.Service.find().objectAt(0); // getting the first service to display
           }
           router.transitionTo('service.summary', service);
         });
+      });
       }
     }),
     connectOutlets: function (router, context) {



Mime
View raw message