Author: yusaku
Date: Wed Apr 24 23:41:55 2013
New Revision: 1471782

URL: http://svn.apache.org/r1471782
Log:
AMBARI-2017. Admin Misc page tweaks. (yusaku)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    
incubator/ambari/trunk/ambari-web/app/controllers/main/admin/misc_controller.js
    incubator/ambari/trunk/ambari-web/app/messages.js
    
incubator/ambari/trunk/ambari-web/app/templates/common/configs/service_config.hbs
    
incubator/ambari/trunk/ambari-web/app/views/common/configs/services_config.js

Modified: incubator/ambari/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1471782&r1=1471781&r2=1471782&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Wed Apr 24 23:41:55 2013
@@ -269,6 +269,8 @@ Trunk (unreleased changes):
 
  IMPROVEMENTS
 
+ AMBARI-2017. Admin Misc page tweaks. (yusaku)
+
  AMBARI-2022. Service Component metric collection API takes over a minute
  on large cluster. (tbeerbower)
 

Modified: 
incubator/ambari/trunk/ambari-web/app/controllers/main/admin/misc_controller.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/main/admin/misc_controller.js?rev=1471782&r1=1471781&r2=1471782&view=diff
==============================================================================
--- 
incubator/ambari/trunk/ambari-web/app/controllers/main/admin/misc_controller.js 
(original)
+++ 
incubator/ambari/trunk/ambari-web/app/controllers/main/admin/misc_controller.js 
Wed Apr 24 23:41:55 2013
@@ -27,7 +27,7 @@ App.MainAdminMiscController = App.MainSe
     serviceName: 'MISC'
   },
   loadUsers: function() {
-    this.set('selectedService', 'MISC');
+    this.set('selectedService', this.get('content.serviceName'));
     this.loadServiceConfig();
   },
   loadServiceConfig: function() {
@@ -55,10 +55,21 @@ App.MainAdminMiscController = App.MainSe
     var configGroups = 
App.config.loadConfigsByTags(this.get('serviceConfigTags'));
     var configSet = App.config.mergePreDefinedWithLoaded(configGroups, [], 
this.get('serviceConfigTags'), serviceName);
 
-    var misc_configs = configSet.globalConfigs.filterProperty('serviceName', 
'MISC').filterProperty('category', 'Users and 
Groups').filterProperty('isVisible', true);
-    this.set('users', misc_configs);
-    this.set('dataIsLoaded', true);
+    var misc_configs = configSet.globalConfigs.filterProperty('serviceName', 
this.get('selectedService')).filterProperty('category', 'Users and 
Groups').filterProperty('isVisible', true);
 
-  }
+    var sortOrder = this.get('configs').filterProperty('serviceName', 
this.get('selectedService')).filterProperty('category', 'Users and 
Groups').filterProperty('isVisible', true).mapProperty('name');
 
+    var sorted = [];
+
+    if(sortOrder) {
+      sortOrder.forEach(function(name) {
+        sorted.push(misc_configs.findProperty('name', name));
+      });
+      this.set('users', sorted);
+    }
+    else {
+      this.set('users', misc_configs);
+    }
+    this.set('dataIsLoaded', true);
+  }
 });

Modified: incubator/ambari/trunk/ambari-web/app/messages.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/messages.js?rev=1471782&r1=1471781&r2=1471782&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/messages.js (original)
+++ incubator/ambari/trunk/ambari-web/app/messages.js Wed Apr 24 23:41:55 2013
@@ -596,7 +596,7 @@ Em.I18n.translations = {
   'admin.cluster.upgradeAvailable':'Upgrade available',
   'admin.cluster.upgradeUnavailable':'Upgrade unavailable',
 
-  'admin.misc.header': 'Service user accounts',
+  'admin.misc.header': 'Service Users and Groups',
   'admin.misc.nothingToShow': 'No user accounts to display',
 
   'services.service.start':'Start',

Modified: 
incubator/ambari/trunk/ambari-web/app/templates/common/configs/service_config.hbs
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/common/configs/service_config.hbs?rev=1471782&r1=1471781&r2=1471782&view=diff
==============================================================================
--- 
incubator/ambari/trunk/ambari-web/app/templates/common/configs/service_config.hbs
 (original)
+++ 
incubator/ambari/trunk/ambari-web/app/templates/common/configs/service_config.hbs
 Wed Apr 24 23:41:55 2013
@@ -50,7 +50,7 @@
   {{#each category in selectedService.configCategories}}
     {{#if category.isCustomView}}
       {{#if App.supports.capacitySchedulerUi}}
-      {{view category.customView categoryBinding="category" 
serviceBinding="selectedService" canEditBinding="view.canEdit" 
serviceConfigsBinding="selectedService.configs"}}
+        {{view category.customView categoryBinding="category" 
serviceBinding="selectedService" canEditBinding="view.canEdit" 
serviceConfigsBinding="selectedService.configs"}}
       {{/if}}
     {{else}}
     {{#view App.ServiceConfigsByCategoryView categoryBinding="category" 
canEditBinding="view.canEdit" serviceBinding="selectedService" 
serviceConfigsBinding="selectedService.configs"}}

Modified: 
incubator/ambari/trunk/ambari-web/app/views/common/configs/services_config.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/common/configs/services_config.js?rev=1471782&r1=1471781&r2=1471782&view=diff
==============================================================================
--- 
incubator/ambari/trunk/ambari-web/app/views/common/configs/services_config.js 
(original)
+++ 
incubator/ambari/trunk/ambari-web/app/views/common/configs/services_config.js 
Wed Apr 24 23:41:55 2013
@@ -67,7 +67,7 @@ App.ServiceConfigsByCategoryView = Ember
    * This method provides all the properties which apply
    * to this category, irrespective of visibility. This
    * is helpful in Oozie/Hive database configuration, where
-   * MySQL etc. database options dont show up, because
+   * MySQL etc. database options don't show up, because
    * they were not visible initially.
    */
   categoryConfigsAll: function () {
@@ -91,7 +91,7 @@ App.ServiceConfigsByCategoryView = Ember
   /**
    * Filtered <code>categoryConfigs</code> array. Used to show filtered result
    */
-  filteredCategoryConfigs: function(){
+  filteredCategoryConfigs: function() {
     var filter = this.get('parentView.filter').toLowerCase();
     var isOnlyModified = this.get('parentView.columns').length && 
this.get('parentView.columns')[1].get('selected');
     var isOnlyOverridden = this.get('parentView.columns').length && 
this.get('parentView.columns')[0].get('selected');
@@ -128,20 +128,22 @@ App.ServiceConfigsByCategoryView = Ember
       }, 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;
+    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;
+      }
     }
 
   }.property('categoryConfigs','parentView.filter', 
'[email protected]'),
@@ -173,9 +175,6 @@ App.ServiceConfigsByCategoryView = Ember
   changeFlag: Ember.Object.create({
     val: 1
   }),
-  invokeMe: function () {
-    alert("parent");
-  },
   isOneOfAdvancedSections: function () {
     var category = this.get('category');
     return category.indexOf("Advanced") != -1;


Reply via email to