You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2016/03/09 04:06:39 UTC

ambari git commit: AMBARI-14830. Clients names different on host details page and filter. (xiwang via yusaku)

Repository: ambari
Updated Branches:
  refs/heads/trunk 249014b37 -> ec4b1d14b


AMBARI-14830. Clients names different on host details page and filter. (xiwang via yusaku)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ec4b1d14
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ec4b1d14
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ec4b1d14

Branch: refs/heads/trunk
Commit: ec4b1d14bbd5d38c9e4c42cab1c9b6b37730f762
Parents: 249014b
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Tue Mar 8 19:05:56 2016 -0800
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Tue Mar 8 19:05:56 2016 -0800

----------------------------------------------------------------------
 ambari-web/app/models/service.js       |  2 +-
 ambari-web/app/utils/ember_computed.js |  4 ++--
 ambari-web/app/utils/helper.js         | 13 +++++++++++--
 3 files changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ec4b1d14/ambari-web/app/models/service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service.js b/ambari-web/app/models/service.js
index c1ed776..8546812 100644
--- a/ambari-web/app/models/service.js
+++ b/ambari-web/app/models/service.js
@@ -22,7 +22,7 @@ require('utils/config');
 
 App.Service = DS.Model.extend({
   serviceName: DS.attr('string'),
-  displayName: Em.computed.formatRole('serviceName'),
+  displayName: Em.computed.formatRole('serviceName', 'SERVICE'),
   passiveState: DS.attr('string'),
   workStatus: DS.attr('string'),
   rand: DS.attr('string'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/ec4b1d14/ambari-web/app/utils/ember_computed.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ember_computed.js b/ambari-web/app/utils/ember_computed.js
index e3a2f63..ecab9a2 100644
--- a/ambari-web/app/utils/ember_computed.js
+++ b/ambari-web/app/utils/ember_computed.js
@@ -887,10 +887,10 @@ computed.percents = function (dependentKey1, dependentKey2, accuracy) {
  * @param {string} dependentKey
  * @returns {Ember.ComputedProperty}
  */
-computed.formatRole = function (dependentKey) {
+computed.formatRole = function (dependentKey, level) {
   return computed(dependentKey, function () {
     var value = get(this, dependentKey);
-    return App.format.role(value);
+    return App.format.role(value, level);
   });
 };
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ec4b1d14/ambari-web/app/utils/helper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/helper.js b/ambari-web/app/utils/helper.js
index eb73667..ec2dc42 100644
--- a/ambari-web/app/utils/helper.js
+++ b/ambari-web/app/utils/helper.js
@@ -535,8 +535,17 @@ App.format = {
    * @param {string} role
    * return {string}
    */
-  role: function (role) {
-    var models = [App.StackService, App.StackServiceComponent];
+  role: function (role, level) {
+    switch (level) {
+      case 'SERVICE':
+        var models = [App.StackService];
+        break;
+      case 'COMPONENT':
+        var models = [App.StackServiceComponent];
+        break;
+      default:
+        var models = [App.StackService, App.StackServiceComponent];
+    }
 
     if (App.isEmptyObject(this.stackRolesMap)) {
       models.forEach(function (model) {