瀏覽代碼

AMBARI-6208. Nagios 'Restart all components' button does not work (Buzhor Denys via alexantonenko)

Alex Antonenko 11 年之前
父節點
當前提交
297ccb1b0a
共有 2 個文件被更改,包括 14 次插入1 次删除
  1. 2 1
      ambari-web/app/controllers/main/service/item.js
  2. 12 0
      ambari-web/app/models/service.js

+ 2 - 1
ambari-web/app/controllers/main/service/item.js

@@ -196,8 +196,9 @@ App.MainServiceItemController = Em.Controller.extend({
       confirmButton: Em.I18n.t('services.service.restartAll.confirmButton'),
       additionalWarningMsg: this.get('content.passiveState') === 'OFF' ? Em.I18n.t('services.service.restartAll.warningMsg.turnOnMM').format(serviceDisplayName): null
      });
+    var staleConfigsOnly = App.Service.find(serviceName).get('serviceTypes').contains('MONITORING');
     return App.showConfirmationFeedBackPopup(function(query) {
-      batchUtils.restartAllServiceHostComponents(serviceName, false, query);
+      batchUtils.restartAllServiceHostComponents(serviceName, staleConfigsOnly, query);
     }, bodyMessage);
   },
 

+ 12 - 0
ambari-web/app/models/service.js

@@ -101,6 +101,18 @@ App.Service = DS.Model.extend({
     return configurableServices.contains(this.get('serviceName'));
   }.property('serviceName'),
 
+  /**
+   * Service Tagging by their type.
+   * @type {String[]}
+   **/
+  serviceTypes: function() {
+    var typeServiceMap = {
+      GANGLIA: ['MONITORING'],
+      NAGIOS:  ['MONITORING']
+    };
+    return typeServiceMap[this.get('serviceName')] || [];
+  }.property('serviceName'),
+
   displayName: function () {
     return App.Service.DisplayNames[this.get('serviceName')];
   }.property('serviceName'),