Ver código fonte

AMBARI-4327. Provide Restart All action for host in Ambari UI. (srimanth)

Srimanth Gunturi 11 anos atrás
pai
commit
53f05bebb4

+ 14 - 0
ambari-web/app/controllers/main/host/details.js

@@ -793,6 +793,9 @@ App.MainHostDetailsController = Em.Controller.extend({
       case "stopAllComponents":
         this.doStopAllComponents();
         break;
+      case "restartAllComponents":
+        this.doRestartAllComponents();
+        break;
       default:
         break;
     }
@@ -822,6 +825,17 @@ App.MainHostDetailsController = Em.Controller.extend({
     }
   },
 
+  doRestartAllComponents: function() {
+    var self = this;
+    var components = this.get('content.hostComponents');
+    var componentsLength = components == null ? 0 : components.get('length');
+    if (componentsLength > 0) {
+      App.showConfirmationPopup(function() {
+        batchUtils.restartHostComponents(components);
+      });
+    }
+  },
+
   /**
    * Deletion of hosts not supported for this version
    */

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

@@ -1382,6 +1382,7 @@ Em.I18n.translations = {
   'hosts.host.details.deleteHost':'Delete Host',
   'hosts.host.details.startAllComponents':'Start All Components',
   'hosts.host.details.stopAllComponents':'Stop All Components',
+  'hosts.host.details.restartAllComponents':'Restart All Components',
 
   'host.host.componentFilter.master':'Master Components',
   'host.host.componentFilter.slave':'Slave Components',

+ 1 - 0
ambari-web/app/views/main/host/details.js

@@ -30,6 +30,7 @@ App.MainHostDetailsView = Em.View.extend({
     var options = [
          {action: 'startAllComponents', 'label': this.t('hosts.host.details.startAllComponents')},
          {action: 'stopAllComponents', 'label': this.t('hosts.host.details.stopAllComponents')},
+         {action: 'restartAllComponents', 'label': this.t('hosts.host.details.restartAllComponents')},
          {action: 'deleteHost', 'label': this.t('hosts.host.details.deleteHost')}];
     return options;
   }.property('controller.content'),