Selaa lähdekoodia

AMBARI-3331. Add default threshold data for newly added widgets after Upgrade from HDP 1.x. (xiwang via yusaku)

Yusaku Sako 12 vuotta sitten
vanhempi
commit
8167851a0d
1 muutettua tiedostoa jossa 5 lisäystä ja 0 poistoa
  1. 5 0
      ambari-web/app/views/main/dashboard.js

+ 5 - 0
ambari-web/app/views/main/dashboard.js

@@ -324,6 +324,11 @@ App.MainDashboardView = Em.View.extend({
     }
     if (toAdd.length) {
       value.visible = value.visible.concat(toAdd);
+      var allThreshold = this.get('initPrefObject').threshold;
+      // add new threshold OR override with default value
+      toAdd.forEach ( function (item) {
+        value.threshold[item] = allThreshold[item];
+      }, this);
     }
     //post to server
     this.postUserPref(this.get('persistKey'), value);