You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sr...@apache.org on 2013/11/25 20:07:01 UTC

git commit: AMBARI-3869. Better messages needed for restart components popup. (Mikhail Bayuk via srimanth)

Updated Branches:
  refs/heads/trunk cbca25d63 -> 47d7da54b


AMBARI-3869. Better messages needed for restart components popup. (Mikhail Bayuk via srimanth)


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

Branch: refs/heads/trunk
Commit: 47d7da54b9885413d4aa3d49b8b61c2978bfbf8a
Parents: cbca25d
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Mon Nov 25 11:00:05 2013 -0800
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Mon Nov 25 11:02:03 2013 -0800

----------------------------------------------------------------------
 .../app/controllers/main/service/info/configs.js       | 13 ++++++++++++-
 ambari-web/app/messages.js                             |  4 ++--
 2 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/47d7da54/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js
index b37a1ff..e00f0b3 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -1796,12 +1796,23 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
   showComponentsShouldBeRestarted: function() {
     var rhc = this.get('content.restartRequiredHostsAndComponents');
     var hostsComponets = [];
+    var componentsObject = {};
     for(var hostName in rhc) {
       rhc[hostName].forEach(function(hostComponent) {
         hostsComponets.push(hostComponent);
+        if(componentsObject[hostComponent] != undefined) {
+          componentsObject[hostComponent]++;
+        } else {
+          componentsObject[hostComponent] = 1;
+        }
       })
     }
-    hostsComponets = hostsComponets.join(', ');
+    var componentsList = [];
+    for( var obj in componentsObject) {
+      var componentDisplayName = (componentsObject[obj] > 1) ? obj + 's' : obj;
+      componentsList.push(componentsObject[obj] + ' ' + componentDisplayName);
+    }
+    hostsComponets = componentsList.join(', ');
     this.showItemsShouldBeRestarted(hostsComponets, Em.I18n.t('service.service.config.restartService.componentsShouldBeRestarted'));
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/47d7da54/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 9b022e5..78d8653 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1102,8 +1102,8 @@ Em.I18n.translations = {
   'services.service.config.restartService.TooltipMessage':'<b>Restart Service</b><br>Stale configuration used by {0} components on {1} hosts:{2}',
   'services.service.config.restartService.needToRestart':'<strong>Restart Required.</strong> ',
   'services.service.config.restartService.needToRestartEnd':'should be restarted',
-  'service.service.config.restartService.hostsShouldBeRestarted':'Hosts should be restarted',
-  'service.service.config.restartService.componentsShouldBeRestarted':'Components should be restarted',
+  'service.service.config.restartService.hostsShouldBeRestarted':'Hosts Requiring Restart',
+  'service.service.config.restartService.componentsShouldBeRestarted':'Components Requiring Restart',
   'services.service.config.saved.message':'Service configuration changes saved successfully.',
   'services.service.config.msgServiceStop':'Could not save configuration changes.  Please stop the service first. You will be able to save configuration changes after all of its components are stopped.',
   'services.service.config.msgHDFSMapRServiceStop':'Could not save configuration changes.  Please stop both HDFS and MapReduce first.  You will be able to save configuration changes after all HDFS and MapReduce components are stopped.',