Przeglądaj źródła

AMBARI-5044. Host Details: when deleting a component, show a message saying Nagios needs to be restarted.(xiwang)

Xi Wang 11 lat temu
rodzic
commit
af7a889bb0

+ 13 - 5
ambari-web/app/controllers/main/host/details.js

@@ -177,6 +177,7 @@ App.MainHostDetailsController = Em.Controller.extend({
     var isLastComponent = (App.HostComponent.find().filterProperty('componentName', componentName).get('length') === 1);
     App.ModalPopup.show({
       header: Em.I18n.t('popup.confirmation.commonHeader'),
+      primary: Em.I18n.t('hosts.host.deleteComponent.popup.confirm'),
       bodyClass: Ember.View.extend({
         templateName: require('templates/main/host/details/deleteComponentPopup')
       }),
@@ -193,8 +194,11 @@ App.MainHostDetailsController = Em.Controller.extend({
       lastComponentError:  Em.View.extend({
         template: Ember.Handlebars.compile(Em.I18n.t('hosts.host.deleteComponent.popup.warning').format(displayName))
       }),
+      restartNagiosMsg: Em.View.extend({
+        template: Ember.Handlebars.compile(Em.I18n.t('hosts.host.deleteComponent.popup.msg2').format(displayName))
+      }),
       deleteComponentMsg: function() {
-        return Em.I18n.t('hosts.host.deleteComponent.popup.msg').format(displayName);
+        return Em.I18n.t('hosts.host.deleteComponent.popup.msg1').format(displayName);
       }.property(),
       onPrimary: function () {
         if (!this.get('enablePrimary')) return;
@@ -413,8 +417,7 @@ App.MainHostDetailsController = Em.Controller.extend({
           dn += " ("+dns.join(", ")+")";
         }
         App.ModalPopup.show({
-          primary: Em.I18n.t('yes'),
-          secondary: Em.I18n.t('no'),
+          primary: Em.I18n.t('hosts.host.addComponent.popup.confirm'),
           header: Em.I18n.t('popup.confirmation.commonHeader'),
           addComponentMsg: function() {
             return Em.I18n.t('hosts.host.addComponent.msg').format(dn);
@@ -422,6 +425,9 @@ App.MainHostDetailsController = Em.Controller.extend({
           bodyClass: Ember.View.extend({
             templateName: require('templates/main/host/details/addComponentPopup')
           }),
+          restartNagiosMsg : Em.View.extend({
+            template: Ember.Handlebars.compile(Em.I18n.t('hosts.host.addComponent.note').format(dn))
+          }),
           onPrimary: function () {
             this.hide();
             if (component.get('componentName') === 'CLIENTS') {
@@ -620,12 +626,14 @@ App.MainHostDetailsController = Em.Controller.extend({
     var displayName = component.get('displayName');
 
     App.ModalPopup.show({
-      primary: Em.I18n.t('yes'),
-      secondary: Em.I18n.t('no'),
+      primary: Em.I18n.t('hosts.host.addComponent.popup.confirm'),
       header: Em.I18n.t('popup.confirmation.commonHeader'),
       installComponentMessage: function(){
         return Em.I18n.t('hosts.host.installComponent.msg').format(displayName);
       }.property(),
+      restartNagiosMsg : Em.View.extend({
+        template: Ember.Handlebars.compile(Em.I18n.t('hosts.host.addComponent.note').format(displayName))
+      }),
       bodyClass: Ember.View.extend({
         templateName: require('templates/main/host/details/installComponentPopup')
       }),

+ 6 - 3
ambari-web/app/messages.js

@@ -638,7 +638,7 @@ Em.I18n.translations = {
 
   'installer.step10.header':'Summary',
   'installer.step10.body':'Here is the summary of the install process.',
-  'installer.step10.nagiosRestartRequired':'<b>Important!</b> Restarting Nagios service is required for alerts and notifications to work properly.  After clicking on the Complete button to dismiss this wizard, go to Services -> Nagios to restart the Nagios service.',
+  'installer.step10.nagiosRestartRequired':'<b>Important!</b> Restarting Nagios service is required for alerts and notifications to work properly.  After clicking on the Complete button to dismiss this wizard, go to <i>Services -> Nagios</i> to restart the Nagios service.',
   'installer.step10.hostsSummary':'The cluster consists of {0} hosts',
   'installer.step10.servicesSummary':'Installed and started services successfully on {0} new ',
   'installer.step10.warnings':' warnings',
@@ -1480,14 +1480,17 @@ Em.I18n.translations = {
   'host.host.componentFilter.master':'Master Components',
   'host.host.componentFilter.slave':'Slave Components',
   'host.host.componentFilter.client':'Client Components',
-  'hosts.host.deleteComponent.popup.msg':'Are you sure you want to delete {0}?',
+  'hosts.host.deleteComponent.popup.msg1':'Are you sure you want to delete {0}?',
+  'hosts.host.deleteComponent.popup.msg2':'<b>Important:</b> After this <i>{0}</i> is deleted, go to <i>Services -> Nagios</i> to restart the Nagios service.  This is required for the alerts and notifications to work properly.',
   'hosts.host.deleteComponent.popup.warning':'<b>WARNING!</b> Delete the last <i>{0}</i> component in the cluster?</br>Deleting the last component in the cluster could result in permanent loss of service data.',
+  'hosts.host.deleteComponent.popup.confirm':'Confirm Delete',
   'hosts.host.installComponent.msg':'Are you sure you want to install {0}?',
   'hosts.host.addComponent.msg':'Are you sure you want to add {0}?',
   'hosts.host.addComponent.addZooKeeper':'Adding ZooKeeper Server may reconfigure such properties:<ul><li>ha.zookeeper.quorum</li><li>hbase.zookeeper.quorum</li><li>templeton.zookeeper.hosts</li></ul>',
   'hosts.host.addComponent.deleteHostWithZooKeeper':'Deleting host with ZooKeeper Server may reconfigure such properties:<ul><li>ha.zookeeper.quorum</li><li>hbase.zookeeper.quorum</li><li>templeton.zookeeper.hosts</li></ul>',
-  'hosts.host.addComponent.note':'Note: After this component is installed, go to Services -> Nagios to restart the Nagios service.  This is required for the alerts and notifications to work properly.',
+  'hosts.host.addComponent.note':'<b>Important:</b> After this <i>{0}</i> is installed, go to <i>Services -> Nagios</i> to restart the Nagios service.  This is required for the alerts and notifications to work properly.',
   'hosts.host.addComponent.securityNote':'You are running your cluster in secure mode. You must set up the keytab for {0} on {1} before you proceed. Otherwise, the component will not be able to start properly.',
+  'hosts.host.addComponent.popup.confirm':'Confirm Add',
   'hosts.host.datanode.decommission':'Decommission DataNode',
   'hosts.host.datanode.recommission':'Recommission DataNode',
   'hosts.host.nodemanager.decommission':'Decommission NodeManager',

+ 1 - 1
ambari-web/app/templates/main/host/details/addComponentPopup.hbs

@@ -17,4 +17,4 @@
 }}
 
 {{addComponentMsg}}<br /><br />
-{{t hosts.host.addComponent.note}}
+<div class='alert'>{{view restartNagiosMsg}}</div>

+ 2 - 1
ambari-web/app/templates/main/host/details/deleteComponentPopup.hbs

@@ -22,4 +22,5 @@
         <div class='tinyspan tinyoffset'>{{view Ember.Checkbox checkedBinding="enablePrimary"}}</div>
         <div class='span10'>{{view lastComponentError}}</div>
     </div>
-{{/if}}
+{{/if}}
+<div class='alert'>{{view restartNagiosMsg}}</div>

+ 1 - 1
ambari-web/app/templates/main/host/details/installComponentPopup.hbs

@@ -17,4 +17,4 @@
 }}
 
 {{installComponentMessage}}<br /><br />
-{{t hosts.host.addComponent.note}}
+<div class='alert'>{{view restartNagiosMsg}}</div>