Przeglądaj źródła

AMBARI-8693. Alerts UI: add support for modifying thresholds on PORT type alerts(xiwang)

Xi Wang 10 lat temu
rodzic
commit
0d78d6ab49

+ 7 - 1
ambari-web/app/controllers/main/alerts/definition_configs_controller.js

@@ -170,8 +170,14 @@ App.MainAlertDefinitionConfigsController = Em.Controller.extend({
         text: isWizard ? '' : this.getThresholdsProperty('ok', 'text'),
         value: isWizard ? '' : this.getThresholdsProperty('ok', 'value')
       }),
+      App.AlertConfigProperties.Thresholds.WarningThreshold.create({
+        valueMetric: 'sec',
+        text: isWizard ? '' : this.getThresholdsProperty('warning', 'text'),
+        value: isWizard ? '' : this.getThresholdsProperty('warning', 'value')
+
+      }),
       App.AlertConfigProperties.Thresholds.CriticalThreshold.create({
-        showInputForValue: false,
+        valueMetric: 'sec',
         text: isWizard ? '' : this.getThresholdsProperty('critical', 'text'),
         value: isWizard ? '' : this.getThresholdsProperty('critical', 'value')
       })

+ 1 - 1
ambari-web/app/templates/main/alerts/configs/alert_config_threshold.hbs

@@ -20,7 +20,7 @@
   <div class="span2 badge-container"><span {{bindAttr class="view.property.badgeCssClass :alert-threshold-badge :alert-state-single-host :label"}}>{{view.property.badge}}</span>&nbsp;</div>
   {{#if view.property.showInputForValue}}
     <div {{bindAttr class=":span2 view.property.valueMetric:input-append"}}>
-        {{view Em.TextField valueBinding="view.property.displayValue" disabledBinding="view.property.isDisabled" class="span11"}}
+        {{view Em.TextField valueBinding="view.property.displayValue" disabledBinding="view.property.isDisabled" class="span10"}}
         {{#if view.property.valueMetric}}
           <span class="add-on">{{view.property.valueMetric}}</span>
         {{/if}}

+ 2 - 2
ambari-web/test/controllers/main/alerts/definitions_configs_controller_test.js

@@ -123,12 +123,12 @@ describe('App.MainAlertDefinitionConfigsController', function () {
       controller.set('isWizard', true);
       var result = controller.renderPortConfigs();
 
-      expect(result.length).to.equal(10);
+      expect(result.length).to.equal(11);
 
       controller.set('isWizard', false);
       result = controller.renderPortConfigs();
 
-      expect(result.length).to.equal(4);
+      expect(result.length).to.equal(5);
     });
 
   });