Kaynağa Gözat

AMBARI-4119 Host Detail page: Add Component acts randomly. (atkach)

atkach 11 yıl önce
ebeveyn
işleme
b35f7b8e53

+ 12 - 4
ambari-web/app/controllers/global/cluster_controller.js

@@ -368,10 +368,6 @@ App.ClusterController = Em.Controller.extend({
       });
     }
     
-    this.requestHosts(hostsRealUrl, function (jqXHR, textStatus) {
-      self.updateLoadStatus('hosts');
-    });
-
     App.HttpClient.get(usersUrl, App.usersMapper, {
       complete:function (jqXHR, textStatus) {
         self.updateLoadStatus('users');
@@ -380,6 +376,15 @@ App.ClusterController = Em.Controller.extend({
         self.updateLoadStatus('users');
     });
 
+    /**
+     * Order of loading:
+     * 1. put services in cache
+     * 2. load host-components to model
+     * 3. load services from cache with metrics to model
+     * 4. update stale_configs of host-components (depends on App.supports.hostOverrides)
+     * 5. load hosts to model
+     */
+
     App.router.get('updateController').updateServices(function () {
       self.updateLoadStatus('services');
       self.loadUpdatedStatus(function () {
@@ -393,6 +398,9 @@ App.ClusterController = Em.Controller.extend({
             self.updateLoadStatus('componentConfigs');
           }
           self.updateLoadStatus('serviceMetrics');
+          self.requestHosts(hostsRealUrl, function (jqXHR, textStatus) {
+            self.updateLoadStatus('hosts');
+          });
         }, true);
       });
     });