Explorar el Código

AMBARI-1145. Cluster Management refactoring. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1431783 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako hace 12 años
padre
commit
01eb8d93cc

+ 7 - 2
ambari-web/app/controllers/main/service/info/configs.js

@@ -21,6 +21,7 @@ require('controllers/wizard/slave_component_groups_controller');
 
 App.MainServiceInfoConfigsController = Em.Controller.extend({
   name: 'mainServiceInfoConfigsController',
+  dataIsLoaded: false,
   stepConfigs: [], //contains all field properties that are viewed in this service
   selectedService: null,
   serviceConfigTags: null,
@@ -40,6 +41,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
   slaveComponentGroups: null,
 
   clearStep: function () {
+    this.set('dataIsLoaded', false);
     this.get('stepConfigs').clear();
     this.get('globalConfigs').clear();
     this.get('uiConfigs').clear();
@@ -189,6 +191,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
         serviceConfig.configs = self.get('globalConfigs').concat(serviceConfigs);
 
         self.renderServiceConfigs(serviceConfig);
+        self.set('dataIsLoaded', true);
       },
 
       error: function (request, ajaxOptions, error) {
@@ -900,8 +903,10 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
 
     //zooKeeperserver_host
     var zooKeperHost = this.get('serviceConfigs').findProperty('serviceName', 'ZOOKEEPER').configs.findProperty('name', 'zookeeperserver_hosts');
-    zooKeperHost.defaultValue = App.Service.find('ZOOKEEPER').get('hostComponents').findProperty('componentName', 'ZOOKEEPER_SERVER').get('host.hostName');
-    globalConfigs.push(zooKeperHost);
+    if (serviceName === 'ZOOKEEPER' || serviceName === 'HBASE' || serviceName === 'WEBHCAT') {
+      zooKeperHost.defaultValue = App.Service.find('ZOOKEEPER').get('hostComponents').filterProperty('componentName', 'ZOOKEEPER_SERVER').mapProperty('host.hostName');
+      globalConfigs.push(zooKeperHost);
+    }
 
     switch (serviceName) {
       case 'HDFS':

+ 1 - 1
ambari-web/app/data/config_properties.js

@@ -2181,7 +2181,7 @@ module.exports =
       "value": "",
       "defaultValue": "",
       "description": "The host that has been assigned to run ZooKeeper Server",
-      "displayType": "masterHosts",
+      "displayType": "slaveHosts",
       "isVisible": true,
       "isRequired": false,
       "serviceName": "ZOOKEEPER",

+ 6 - 0
ambari-web/app/styles/application.less

@@ -364,6 +364,12 @@ h1 {
 
 #serviceConfig {
   margin-top: 20px;
+  .spinner {
+    width:36px;
+    height:36px;
+    background: url("/img/spinner.gif");
+    margin: 0 auto;
+  }
   .accordion-heading {
     background-color: #f0f0f0;
   }

+ 4 - 0
ambari-web/app/templates/main/service/info/configs.hbs

@@ -17,6 +17,7 @@
 }}
 
 <div id="serviceConfig">
+  {{#if dataIsLoaded}}
     <div class="accordion">
       {{#each category in selectedService.configCategories}}
           <div class="accordion-group {{unbound category.name}}">
@@ -58,4 +59,7 @@
         <a class="btn btn-primary" {{bindAttr disabled="isSubmitDisabled"}}
           {{action restartServicePopup target="controller"}}>Save and apply changes</a>
     </p>
+  {{else}}
+    <div class="spinner"></div>
+  {{/if}}
 </div>

+ 25 - 2
ambari-web/app/views/main/apps_view.js

@@ -467,6 +467,7 @@ App.MainAppsView = Em.View.extend({
       this.get(viewName).get('clearFilter')(this.get(viewName));
     }
   },
+
   /**
    * apply each filter to dataTable
    *
@@ -532,10 +533,14 @@ App.MainAppsView = Em.View.extend({
     },
 
     /**
-     * Custom filter for RunDate
+     * Custom filter view for RunDate
      */
-    customFilter: function(){
+    customFilter: function() {
       var rundateSelect = this;
+
+      /**
+       * Show popup with custom filters
+       */
       App.ModalPopup.show({
         lowerBound: null,
         upperBound: null,
@@ -544,6 +549,9 @@ App.MainAppsView = Em.View.extend({
         bodyClass: Ember.View.extend({
           templateName: require('templates/main/apps/custom_rundate_popup'),
 
+          /**
+           * Lower bound view for date-time range on custom filter popup.
+           */
           lowerBoundView: Ember.TextField.extend({
             elementId: 'lowerBound',
             classNames: 'lowerBound',
@@ -576,6 +584,9 @@ App.MainAppsView = Em.View.extend({
             }
           }),
 
+          /**
+           * Upper bound view for date-time range on custom filter popup.
+           */
           upperBoundView: Ember.TextField.extend({
             elementId: 'upperBound',
             classNames: 'upperBound',
@@ -608,6 +619,9 @@ App.MainAppsView = Em.View.extend({
             }
           }),
 
+          /**
+           * Equal view for custom filter popup.
+           */
           equalView: Ember.TextField.extend({
             attributeBindings:['readonly'],
             readonly: true,
@@ -625,11 +639,20 @@ App.MainAppsView = Em.View.extend({
             }
           })
         }),
+
+        /**
+         * apply each filter to dataTable
+         * @param lowerBound date-time
+         * @param upperBound date-time
+         * @param equal date-time
+         */
         applyFilter:function(lowerBound, upperBound, equal) {
           if (arguments.length == 1) {
+            //do if filtered by equal value
             equal = new Date(arguments[0]).getTime();
             jQuery('#custom_rundate_filter').val(equal);
           } else if (arguments.length == 2) {
+            //do if filtered by date-time range
             lowerBound = new Date(arguments[0]).getTime();
             upperBound = new Date(arguments[1]).getTime();
             var range = [lowerBound, upperBound];

+ 1 - 1
ambari-web/app/views/main/service/info/summary.js

@@ -158,7 +158,7 @@ App.MainServiceInfoSummaryView = Em.View.extend({
   clientObj: function() {
     var service = this.get('controller.content');
     if (service.get("id") == "OOZIE" || service.get("id") == "ZOOKEEPER") {
-      var clients = service.get('components').filterProperty('isClient');
+      var clients = service.get('components').filterProperty('isMaster', false);
       if (clients.length > 0) {
         return clients[0];
       }