Author: yusaku
Date: Fri Jan 11 01:35:18 2013
New Revision: 1431783

URL: http://svn.apache.org/viewvc?rev=1431783&view=rev
Log:
AMBARI-1145. Cluster Management refactoring. (yusaku)

Modified:
    
incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js
    incubator/ambari/trunk/ambari-web/app/data/config_properties.js
    incubator/ambari/trunk/ambari-web/app/styles/application.less
    
incubator/ambari/trunk/ambari-web/app/templates/main/service/info/configs.hbs
    incubator/ambari/trunk/ambari-web/app/views/main/apps_view.js
    incubator/ambari/trunk/ambari-web/app/views/main/service/info/summary.js

Modified: 
incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js?rev=1431783&r1=1431782&r2=1431783&view=diff
==============================================================================
--- 
incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js 
(original)
+++ 
incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js 
Fri Jan 11 01:35:18 2013
@@ -21,6 +21,7 @@ require('controllers/wizard/slave_compon
 
 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 = E
   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 = E
         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 = E
 
     //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':

Modified: incubator/ambari/trunk/ambari-web/app/data/config_properties.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/data/config_properties.js?rev=1431783&r1=1431782&r2=1431783&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/data/config_properties.js (original)
+++ incubator/ambari/trunk/ambari-web/app/data/config_properties.js Fri Jan 11 
01:35:18 2013
@@ -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",

Modified: incubator/ambari/trunk/ambari-web/app/styles/application.less
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/styles/application.less?rev=1431783&r1=1431782&r2=1431783&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/styles/application.less (original)
+++ incubator/ambari/trunk/ambari-web/app/styles/application.less Fri Jan 11 
01:35:18 2013
@@ -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;
   }

Modified: 
incubator/ambari/trunk/ambari-web/app/templates/main/service/info/configs.hbs
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/service/info/configs.hbs?rev=1431783&r1=1431782&r2=1431783&view=diff
==============================================================================
--- 
incubator/ambari/trunk/ambari-web/app/templates/main/service/info/configs.hbs 
(original)
+++ 
incubator/ambari/trunk/ambari-web/app/templates/main/service/info/configs.hbs 
Fri Jan 11 01:35:18 2013
@@ -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>
\ No newline at end of file

Modified: incubator/ambari/trunk/ambari-web/app/views/main/apps_view.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/apps_view.js?rev=1431783&r1=1431782&r2=1431783&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/apps_view.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/apps_view.js Fri Jan 11 
01:35:18 2013
@@ -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];

Modified: 
incubator/ambari/trunk/ambari-web/app/views/main/service/info/summary.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/service/info/summary.js?rev=1431783&r1=1431782&r2=1431783&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/service/info/summary.js 
(original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/service/info/summary.js 
Fri Jan 11 01:35:18 2013
@@ -158,7 +158,7 @@ App.MainServiceInfoSummaryView = Em.View
   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];
       }


Reply via email to