Browse Source

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

Srimanth Gunturi 11 years ago
parent
commit
47d7da54b9

+ 12 - 1
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'));
   },
 

+ 2 - 2
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.',