You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by on...@apache.org on 2017/02/09 12:29:39 UTC

ambari git commit: AMBARI-19934. Confusing Auto Start settings page behavior when loading and API takes a while (onechiporenko)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 971887938 -> 6fed7e276


AMBARI-19934. Confusing Auto Start settings page behavior when loading and API takes a while (onechiporenko)


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

Branch: refs/heads/branch-2.5
Commit: 6fed7e276d86f5536edea73d2ac246a268d63b34
Parents: 9718879
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Thu Feb 9 11:45:26 2017 +0200
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Thu Feb 9 14:29:35 2017 +0200

----------------------------------------------------------------------
 .../templates/main/admin/service_auto_start.hbs   | 10 +++++++---
 .../app/views/main/admin/service_auto_start.js    | 18 +++++++++++++-----
 2 files changed, 20 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6fed7e27/ambari-web/app/templates/main/admin/service_auto_start.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/service_auto_start.hbs b/ambari-web/app/templates/main/admin/service_auto_start.hbs
index 87fc915..eec159c 100644
--- a/ambari-web/app/templates/main/admin/service_auto_start.hbs
+++ b/ambari-web/app/templates/main/admin/service_auto_start.hbs
@@ -24,8 +24,9 @@
     {{t admin.serviceAutoStart.header.text}}
   </div>
   <br/>
+  {{#if view.isLoaded}}
   <div class="cluster-switcher row-fluid">
-      <div class="span2">
+      <div class="span3">
           <strong>{{t admin.serviceAutoStart.body.text}}</strong>
       </div>
       <div class="span4">
@@ -38,9 +39,9 @@
   </div>
     {{#if view.switcherValue}}
         <hr>
-        <div class="row-fluid mlm"><h5 class="span2">{{t common.service}}</h5><h5 class="span4">{{t common.component}}</h5><h5 class="span4">{{t common.status}}</h5></div>
+        <div class="row-fluid mlm"><h5 class="span3">{{t common.service}}</h5><h5 class="span4">{{t common.component}}</h5><h5 class="span4">{{t common.status}}</h5></div>
         <div class="tabs-left">
-            <ul class="nav nav-tabs span2">
+            <ul class="nav nav-tabs span3">
                 {{#each tab in controller.tabs}}
                     <li {{bindAttr class="tab.isActive:active"}}>
                         <a href="#" data-toggle="tab" {{bindAttr data-target="tab.headingClass"}}>
@@ -74,4 +75,7 @@
             </div>
         </div>
     {{/if}}
+  {{else}}
+    {{view App.SpinnerView}}
+  {{/if}}
 </div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/6fed7e27/ambari-web/app/views/main/admin/service_auto_start.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/service_auto_start.js b/ambari-web/app/views/main/admin/service_auto_start.js
index be928ed..ce487d0 100644
--- a/ambari-web/app/views/main/admin/service_auto_start.js
+++ b/ambari-web/app/views/main/admin/service_auto_start.js
@@ -30,6 +30,12 @@ App.MainAdminServiceAutoStartView = Em.View.extend({
 
   savedRecoveryEnabled: false,
 
+  /**
+   * @type {boolean}
+   * @default false
+   */
+  isLoaded: false,
+
   isDisabled: false,
 
   didInsertElement: function () {
@@ -47,11 +53,13 @@ App.MainAdminServiceAutoStartView = Em.View.extend({
         self.set('controller.clusterConfigs', data[0].properties);
         self.set('switcherValue', data[0].properties.recovery_enabled === 'true');
         self.set('savedRecoveryEnabled', self.get('switcherValue'));
-        // plugin should be initiated after applying binding for switcherValue
-        Em.run.later('sync', function() {
-          self.initSwitcher();
-        }.bind(self), 10);
-        self.get('controller').loadComponentsConfigs();
+        self.get('controller').loadComponentsConfigs().then(function () {
+          Em.run.later('sync', function() {
+            // plugin should be initiated after applying binding for switcherValue
+            self.initSwitcher();
+          }.bind(self), 10);
+          self.set('isLoaded', true);
+        });
       });
     });
   },