瀏覽代碼

AMBARI-2005. When adding a component to a host (after cluster deployment), UI should warn that nagios server need to be restarted. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1471205 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 年之前
父節點
當前提交
20c909ab70
共有 3 個文件被更改,包括 61 次插入44 次删除
  1. 3 0
      CHANGES.txt
  2. 57 44
      ambari-web/app/controllers/main/host/details.js
  3. 1 0
      ambari-web/app/messages.js

+ 3 - 0
CHANGES.txt

@@ -269,6 +269,9 @@ Trunk (unreleased changes):
 
 
  IMPROVEMENTS
  IMPROVEMENTS
 
 
+ AMBARI-2005. When adding a component to a host (after cluster deployment),
+ UI should warn that nagios server need to be restarted. (yusaku)
+
  AMBARI-2004. Background Operation Popup needs label/styling fixes.
  AMBARI-2004. Background Operation Popup needs label/styling fixes.
  (yusaku)
  (yusaku)
 
 

+ 57 - 44
ambari-web/app/controllers/main/host/details.js

@@ -216,57 +216,70 @@ App.MainHostDetailsController = Em.Controller.extend({
     var component = event.context;
     var component = event.context;
     var componentName = component.get('componentName').toUpperCase().toString();
     var componentName = component.get('componentName').toUpperCase().toString();
 
 
-    App.showConfirmationPopup(function() {
-
-      self.sendCommandToServer('/hosts?Hosts/host_name=' + self.get('content.hostName'),{
-        RequestInfo : {
-          "context" : Em.I18n.t('requestInfo.installHostComponent') + " " + componentName
-        },
-        Body:{
-          host_components: [{
-            HostRoles:{
-              component_name: componentName
+    App.ModalPopup.show({
+      primary: Em.I18n.t('yes'),
+      secondary: Em.I18n.t('no'),
+      header: Em.I18n.t('popup.confirmation.commonHeader'),
+      bodyClass: Ember.View.extend({
+        template: Ember.Handlebars.compile([
+          '{{t hosts.delete.popup.body}}<br><br>',
+          '{{t hosts.host.addComponent.note}}'
+        ].join(''))
+      }),
+      onPrimary: function () {
+        this.hide();
+        self.sendCommandToServer('/hosts?Hosts/host_name=' + self.get('content.hostName'), {
+            RequestInfo: {
+              "context": Em.I18n.t('requestInfo.installHostComponent') + " " + componentName
+            },
+            Body: {
+              host_components: [
+                {
+                  HostRoles: {
+                    component_name: componentName
+                  }
+                }
+              ]
             }
             }
-          }]
-        }
-      },
-        'POST',
-        function(requestId){
-
-          console.log('Send request for ADDING NEW COMPONENT successfully');
-
-          self.sendCommandToServer('/host_components?HostRoles/host_name=' + self.get('content.hostName') + '\&HostRoles/component_name=' + componentName + '\&HostRoles/state=INIT',{
-              RequestInfo : {
-                "context" : Em.I18n.t('requestInfo.installNewHostComponent')+ " " + componentName
+          },
+          'POST',
+          function (requestId) {
+
+            console.log('Send request for ADDING NEW COMPONENT successfully');
+
+            self.sendCommandToServer('/host_components?HostRoles/host_name=' + self.get('content.hostName') + '\&HostRoles/component_name=' + componentName + '\&HostRoles/state=INIT', {
+                RequestInfo: {
+                  "context": Em.I18n.t('requestInfo.installNewHostComponent') + " " + componentName
+                },
+                Body: {
+                  HostRoles: {
+                    state: 'INSTALLED'
+                  }
+                }
               },
               },
-              Body:{
-                HostRoles:{
-                  state: 'INSTALLED'
+              'PUT',
+              function (requestId) {
+                if (!requestId) {
+                  return;
                 }
                 }
-              }
-            },
-            'PUT',
-            function(requestId){
-              if(!requestId){
-                return;
-              }
 
 
-              console.log('Send request for INSTALLING NEW COMPONENT successfully');
+                console.log('Send request for INSTALLING NEW COMPONENT successfully');
 
 
-              if (App.testMode) {
-                component.set('workStatus', App.HostComponentStatus.installing);
-                setTimeout(function(){
-                  component.set('workStatus', App.HostComponentStatus.stopped);
-                },App.testModeDelayForActions);
-              } else {
-                App.router.get('clusterController').loadUpdatedStatus();
-              }
+                if (App.testMode) {
+                  component.set('workStatus', App.HostComponentStatus.installing);
+                  setTimeout(function () {
+                    component.set('workStatus', App.HostComponentStatus.stopped);
+                  }, App.testModeDelayForActions);
+                } else {
+                  App.router.get('clusterController').loadUpdatedStatus();
+                }
 
 
-              App.router.get('backgroundOperationsController').showPopup();
+                App.router.get('backgroundOperationsController').showPopup();
 
 
-            });
-          return;
-        });
+              });
+            return;
+          });
+      }
     });
     });
   },
   },
   /**
   /**

+ 1 - 0
ambari-web/app/messages.js

@@ -849,6 +849,7 @@ Em.I18n.translations = {
   'host.host.componentFilter.master':'Master Components',
   'host.host.componentFilter.master':'Master Components',
   'host.host.componentFilter.slave':'Slave Components',
   'host.host.componentFilter.slave':'Slave Components',
   'host.host.componentFilter.client':'Client Components',
   'host.host.componentFilter.client':'Client Components',
+  '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.alert.noAlerts':'No alerts',
   'hosts.host.alert.noAlerts':'No alerts',
   'hosts.host.alert.noAlerts.message':'There are no alerts for this host.',
   'hosts.host.alert.noAlerts.message':'There are no alerts for this host.',