Bladeren bron

AMBARI-2028. Customize Services: make the services display consistent. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1476474 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 jaren geleden
bovenliggende
commit
b4bd7be446

+ 3 - 0
CHANGES.txt

@@ -269,6 +269,9 @@ Trunk (unreleased changes):
 
  IMPROVEMENTS
 
+ AMBARI-2028. Customize Services: make the services display consistent.
+ (yusaku)
+
  AMBARI-2027. Add validation checks for Add Property on custom site configs.
  (yusaku)
 

+ 10 - 0
ambari-web/app/controllers/main/service/info/configs.js

@@ -1356,6 +1356,16 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
         hbaseMasterHost.defaultValue = this.get('content.hostComponents').filterProperty('componentName', 'HBASE_MASTER').mapProperty('host.hostName');
         globalConfigs.push(hbaseMasterHost);
         break;
+      case 'HUE':
+        var hueServerHost = serviceConfigs.findProperty('name', 'hueserver_host');
+        hueServerHost.defaultValue = this.get('content.hostComponents').findProperty('componentName', 'HUE_SERVER').get('host.hostName');
+        globalConfigs.push(hueServerHost);
+        break;
+      case 'WEBHCAT':
+        var webhcatMasterHost = serviceConfigs.findProperty('name', 'webhcatserver_host');
+        webhcatMasterHost.defaultValue = this.get('content.hostComponents').filterProperty('componentName', 'WEBHCAT_SERVER').mapProperty('host.hostName');
+        globalConfigs.push(webhcatMasterHost);
+        break;
     }
   },
   

+ 28 - 0
ambari-web/app/data/config_properties.js

@@ -1184,6 +1184,20 @@ module.exports =
       "category": "General"
     },
     */
+    {
+      "id": "puppet var",
+      "name": "webhcatserver_host",
+      "displayName": "WebHCat Server host",
+      "value": "",
+      "defaultValue": "",
+      "description": "The host that has been assigned to run WebHCat Server",
+      "displayType": "masterHost",
+      "isOverridable": false,
+      "isVisible": true,
+      "domain": "global",
+      "serviceName": "WEBHCAT",
+      "category": "WebHCat Server"
+    },
     {
       "id": "puppet var",
       "name": "hcat_log_dir",
@@ -2629,6 +2643,20 @@ module.exports =
       "serviceName": "MISC",
       "category": "General"
     },
+    {
+      "id": "puppet var",
+      "name": "hueserver_host",
+      "displayName": "Hue Server host",
+      "value": "",
+      "defaultValue": "",
+      "description": "The host that has been assigned to run Hue Server",
+      "displayType": "masterHost",
+      "isOverridable": false,
+      "isVisible": true,
+      "domain": "global",
+      "serviceName": "HUE",
+      "category": "Hue Server"
+    },
     {
       "id": "puppet var",
       "name": "hue_log_dir",

+ 2 - 0
ambari-web/app/data/service_configs.js

@@ -73,6 +73,7 @@ module.exports = [
     displayName: 'WebHCat',
     filename: 'webhcat-site',
     configCategories: [
+      App.ServiceConfigCategory.create({ name: 'WebHCat Server', displayName : 'WebHCat Server'}),
       App.ServiceConfigCategory.create({ name: 'Advanced', displayName : 'Advanced'}),
       App.ServiceConfigCategory.create({ name: 'AdvancedWebHCatSite', displayName : 'Custom webhcat-site.xml', siteFileName: 'webhcat-site.xml', canAddProperty: true})
     ],
@@ -134,6 +135,7 @@ module.exports = [
     displayName: 'Hue',
     filename: 'hue-site',
     configCategories: [
+      App.ServiceConfigCategory.create({ name: 'Hue Server', displayName : 'Hue Server'}),
       App.ServiceConfigCategory.create({ name: 'Advanced', displayName : 'Advanced'})
     ],
     sites: ['hue-site'],

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

@@ -264,6 +264,12 @@ App.ServiceConfigProperty = Ember.Object.extend({
       case 'oozieserver_host':
         this.set('value', masterComponentHostsInDB.findProperty('component', 'OOZIE_SERVER').hostName);
         break;
+      case 'webhcatserver_host':
+        this.set('value', masterComponentHostsInDB.findProperty('component', 'WEBHCAT_SERVER').hostName);
+        break;
+      case 'hueserver_host':
+        this.set('value', masterComponentHostsInDB.findProperty('component', 'HUE_SERVER').hostName);
+        break;
       case 'oozie_ambari_host':
         this.set('value', masterComponentHostsInDB.findProperty('component', 'OOZIE_SERVER').hostName);
         break;

+ 1 - 31
ambari-web/app/views/common/configs/services_config.js

@@ -115,37 +115,7 @@ App.ServiceConfigsByCategoryView = Ember.View.extend({
 
       return searchString.toLowerCase().indexOf(filter) > -1;
     });
-
-    // modify the display order of Oozie/Hive server category to make it look in the same order
-    if(filteredResult.someProperty('displayName', 'Oozie Database')) {
-      var displayNameArray = ['Oozie Database', 'Database Type', 'Database Name', 'Database Username', 'Database Password', 'Database Host', 'Oozie Data Dir', 'Oozie Server host'];
-      var sortedArray = [];
-      displayNameArray.forEach(function(item){
-        var obj = filteredResult.findProperty('displayName', item);
-        if(obj) {
-          sortedArray.push(obj);
-        }
-      }, this);
-      return sortedArray;
-
-    }
-    else {
-      if(filteredResult.someProperty('displayName', 'Hive Database')) {
-        var displayNameArray = ['Hive Database', 'Database Type', 'Database Name', 'Database Username', 'Database Password', 'Database Host', 'Hive Metastore host'];
-        var sortedArray = [];
-        displayNameArray.forEach(function(item){
-          var obj = filteredResult.findProperty('displayName', item);
-          if(obj) {
-            sortedArray.push(obj);
-          }
-        }, this);
-        return sortedArray;
-      }
-      else {
-        return filteredResult;
-      }
-    }
-
+    return filteredResult;
   }.property('categoryConfigs','parentView.filter', 'parentView.columns.@each.selected'),
 
   /**