Browse Source

Committing missed files. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1478215 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 years ago
parent
commit
0f43933404

BIN
ambari-web/app/assets/img/logo-small-gold.png


BIN
ambari-web/app/assets/img/logo-small-yellow.png


BIN
ambari-web/app/assets/img/logo-small.png


BIN
ambari-web/app/assets/img/logo.png


+ 25 - 12
ambari-web/app/controllers/main/service/info/configs.js

@@ -821,21 +821,28 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
     if (globals.someProperty('name', 'hive_database')) {
       var hiveDb = globals.findProperty('name', 'hive_database');
       if (hiveDb.value === 'New MySQL Database') {
-        if (globals.someProperty('name', 'hive_ambari_host')) {
-          globals.findProperty('name', 'hive_ambari_host').name = 'hive_hostname';
+        var ambariHost = globals.findProperty('name', 'hive_ambari_host');
+        if (ambariHost) {
+          ambariHost.name = 'hive_hostname';
         }
         globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_host'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_database'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_oracle_host'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_oracle_database'));
       } else if (hiveDb.value === 'Existing MySQL Database'){
-        globals.findProperty('name', 'hive_existing_mysql_host').name = 'hive_hostname';
+        var existingMySqlHost = globals.findProperty('name', 'hive_existing_mysql_host');
+        if (existingMySqlHost) {
+          existingMySqlHost.name = 'hive_hostname';
+        }
         globals = globals.without(globals.findProperty('name', 'hive_ambari_host'));
         globals = globals.without(globals.findProperty('name', 'hive_ambari_database'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_oracle_host'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_oracle_database'));
-      } else{ //existing oracle database
-        globals.findProperty('name', 'hive_existing_oracle_host').name = 'hive_hostname';
+      } else { //existing oracle database
+        var existingOracleHost = globals.findProperty('name', 'hive_existing_oracle_host');
+        if (existingOracleHost) {
+          existingOracleHost.name = 'hive_hostname';
+        }
         globals = globals.without(globals.findProperty('name', 'hive_ambari_host'));
         globals = globals.without(globals.findProperty('name', 'hive_ambari_database'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_host'));
@@ -846,7 +853,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
   },
 
   /**
-   * set hive hostnames in global configs
+   * set oozie hostnames in global configs
    * @param globals
    */
   setOozieHostName: function (globals) {
@@ -860,8 +867,9 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
         globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_host'));
         globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_database'));
       } else if (oozieDb.value === 'New MySQL Database') {
-        if (globals.someProperty('name', 'oozie_ambari_host')) {
-          globals.findProperty('name', 'oozie_ambari_host').name = 'oozie_hostname';
+        var ambariHost = globals.findProperty('name', 'oozie_ambari_host');
+        if (ambariHost) {
+          ambariHost.name = 'oozie_hostname';
         }
         globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_host'));
         globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_database'));
@@ -869,16 +877,21 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
         globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_database'));
         globals = globals.without(globals.findProperty('name', 'oozie_derby_database'));
 
-      } else if (oozieDb.value === 'Existing MySQL Database'){
-
-        globals.findProperty('name', 'oozie_existing_mysql_host').name = 'oozie_hostname';
+      } else if (oozieDb.value === 'Existing MySQL Database') {
+        var existingMySqlHost = globals.findProperty('name', 'oozie_existing_mysql_host');
+        if (existingMySqlHost) {
+          existingMySqlHost.name = 'oozie_hostname';
+        }
         globals = globals.without(globals.findProperty('name', 'oozie_ambari_host'));
         globals = globals.without(globals.findProperty('name', 'oozie_ambari_database'));
         globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_host'));
         globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_database'));
         globals = globals.without(globals.findProperty('name', 'oozie_derby_database'));
       } else{ //existing oracle database
-        globals.findProperty('name', 'oozie_existing_oracle_host').name = 'oozie_hostname';
+        var existingOracleHost = globals.findProperty('name', 'oozie_existing_oracle_host');
+        if (existingOracleHost) {
+          existingOracleHost.name = 'oozie_hostname';
+        }
         globals = globals.without(globals.findProperty('name', 'oozie_ambari_host'));
         globals = globals.without(globals.findProperty('name', 'oozie_ambari_database'));
         globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_host'));

File diff suppressed because it is too large
+ 1781 - 1644
ambari-web/app/data/config_properties.js


+ 1 - 0
ambari-web/app/models/service_config.js

@@ -162,6 +162,7 @@ App.ServiceConfigProperty = Ember.Object.extend({
   overrideErrorTrigger: 0, //Trigger for overrridable property error
   isRestartRequired: false,
   restartRequiredMessage: 'Restart required',
+  index: null, //sequence number in category
 
   /**
    * On Overridable property error message, change overrideErrorTrigger value to recount number of errors service have

+ 2 - 1
ambari-web/app/utils/config.js

@@ -130,7 +130,7 @@ App.config = Em.Object.create({
         return _tag.tagName === serviceConfigProperties.tag && _tag.siteName === serviceConfigProperties.type;
       });
 
-      properties = (properties.length) ? properties = properties.objectAt(0).properties : {};
+      properties = (properties.length) ? properties.objectAt(0).properties : {};
       for (var index in properties) {
         var configsPropertyDef = preDefinedConfigs.findProperty('name', index) || null;
         var serviceConfigObj = {
@@ -152,6 +152,7 @@ App.config = Em.Object.create({
           serviceConfigObj.description = (configsPropertyDef.description !== undefined) ? configsPropertyDef.description : undefined;
           serviceConfigObj.isOverridable = configsPropertyDef.isOverridable === undefined ? true : configsPropertyDef.isOverridable;
           serviceConfigObj.serviceName = configsPropertyDef ? configsPropertyDef.serviceName : null;
+          serviceConfigObj.index = configsPropertyDef.index;
         }
         // MAPREDUCE contains core-site properties but doesn't show them
         if(serviceConfigObj.serviceName === 'MAPREDUCE' && serviceConfigObj.filename === 'core-site.xml'){

+ 27 - 18
ambari-web/app/views/common/configs/services_config.js

@@ -115,9 +115,35 @@ App.ServiceConfigsByCategoryView = Ember.View.extend({
 
       return searchString.toLowerCase().indexOf(filter) > -1;
     });
+    filteredResult = this.sortByIndex(filteredResult);
     return filteredResult;
   }.property('categoryConfigs','parentView.filter', 'parentView.columns.@each.selected'),
 
+  /**
+   * sort configs in current category by index
+   * @param configs
+   * @return {*}
+   */
+  sortByIndex: function(configs){
+    var sortedConfigs = [];
+    var unSorted = [];
+    if (!configs.someProperty('index')) {
+      return configs;
+    }
+    configs.forEach(function (config) {
+      var index = config.get('index');
+      if ((index !== null) && isFinite(index)) {
+        sortedConfigs[index] ? sortedConfigs.splice(index, 0 ,config) : sortedConfigs[index] = config;
+      } else {
+        unSorted.push(config);
+      }
+    });
+    // remove undefined elements from array
+    sortedConfigs = sortedConfigs.filter(function(config){
+      if(config !== undefined) return true;
+    });
+    return sortedConfigs.concat(unSorted);
+  },
   /**
    * Onclick handler for Config Group Header. Used to show/hide block
    */
@@ -926,7 +952,7 @@ App.ServiceConfigCapacityScheduler = App.ServiceConfigsByCategoryView.extend({
           configs: configs
         };
         content = this.insertExtraConfigs(content);
-        content.configs = this.sortQueueProperties(content.configs);
+        content.configs = self.sortByIndex(content.configs);
         return content;
       }.property(),
       footerClass: Ember.View.extend({
@@ -1108,23 +1134,6 @@ App.ServiceConfigCapacityScheduler = App.ServiceConfigsByCategoryView.extend({
 
         return content;
       },
-      /**
-       * sort properties of queue by index
-       * @param configs
-       * @return {Array}
-       */
-      sortQueueProperties: function(configs){
-        var sortedConfigs = [];
-        var skippedConfigs = [];
-        configs.forEach(function(_config){
-          if(isFinite(_config.index)){
-            sortedConfigs[_config.index] = _config;
-          } else {
-            skippedConfigs.push(_config);
-          }
-        });
-        return sortedConfigs.concat(skippedConfigs);
-      },
       /**
        * Validate by follow rules:
        * Users can be blank. If this is blank, Groups must not be blank.

Some files were not shown because too many files changed in this diff