Sfoglia il codice sorgente

AMBARI-5069. Restart button on host details page doesn't have confirm popup. (onechiporenko)

Oleg Nechiporenko 11 anni fa
parent
commit
df85df87ef

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

@@ -1223,8 +1223,11 @@ App.MainHostDetailsController = Em.Controller.extend({
   },
 
   restartAllStaleConfigComponents: function() {
-    var staleComponents = this.get('content.componentsWithStaleConfigs');
-    batchUtils.restartHostComponents(staleComponents, Em.I18n.t('rollingrestart.context.allWithStaleConfigsOnSelectedHost').format(this.get('content.hostName')));
+    var self = this;
+    App.showConfirmationPopup(function () {
+      var staleComponents = self.get('content.componentsWithStaleConfigs');
+      batchUtils.restartHostComponents(staleComponents, Em.I18n.t('rollingrestart.context.allWithStaleConfigsOnSelectedHost').format(self.get('content.hostName')));
+    });
   },
 
   /**

+ 4 - 12
ambari-web/app/controllers/main/service/info/configs.js

@@ -1626,18 +1626,10 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
   },
 
   restartAllStaleConfigComponents: function() {
-    var content = this;
-    return App.ModalPopup.show({
-      primary: Em.I18n.t('ok'),
-      secondary: Em.I18n.t('common.cancel'),
-      header: Em.I18n.t('popup.confirmation.commonHeader'),
-      body: Em.I18n.t('question.sure'),
-      content: content,
-      onPrimary: function () {
-        var selectedService = this.content.get('content.id');
-        this.hide();
-        batchUtils.restartAllServiceHostComponents(selectedService, true);
-      }
+    var self = this;
+    App.showConfirmationPopup(function () {
+      var selectedService = self.get('content.id');
+      batchUtils.restartAllServiceHostComponents(selectedService, true);
     });
   },