Browse Source

AMBARI-8697-2. Alerts UI: thresholds validation.(xiwang)

Xi Wang 10 năm trước cách đây
mục cha
commit
c6ccbf4278

+ 2 - 2
ambari-web/app/models/alert_config.js

@@ -355,7 +355,7 @@ App.AlertConfigProperties = {
     valueWasChanged: function () {
     valueWasChanged: function () {
       var displayValue = this.get('displayValue');
       var displayValue = this.get('displayValue');
       var newDisplayValue = this.getNewValue();
       var newDisplayValue = this.getNewValue();
-      if (newDisplayValue != displayValue) {
+      if (Math.abs(newDisplayValue - displayValue) > 0.000001) {
         this.set('displayValue', newDisplayValue);
         this.set('displayValue', newDisplayValue);
       }
       }
     }.observes('value'),
     }.observes('value'),
@@ -372,7 +372,7 @@ App.AlertConfigProperties = {
     displayValueWasChanged: function () {
     displayValueWasChanged: function () {
       var value = this.get('value');
       var value = this.get('value');
       var newValue = this.getNewDisplayValue();
       var newValue = this.getNewDisplayValue();
-      if (newValue != value) {
+      if (Math.abs(newValue - value) > 0.000001) {
         this.set('value', newValue);
         this.set('value', newValue);
       }
       }
     }.observes('displayValue')
     }.observes('displayValue')