瀏覽代碼

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

Yusaku Sako 12 年之前
父節點
當前提交
8167851a0d
共有 1 個文件被更改,包括 5 次插入0 次删除
  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);