浏览代码

AMBARI-8241. Hosts page shows only 25 hosts after logging out and logging back in if page size is set to 50 or 100. (atkach via yusaku)

Yusaku Sako 10 年之前
父节点
当前提交
a9a641d513
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      ambari-web/app/controllers/main/host.js

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

@@ -125,7 +125,12 @@ App.MainHostController = Em.ArrayController.extend({
         var name = controller.get('name');
         var name = controller.get('name');
         var dbValue = App.db.getDisplayLength(name);
         var dbValue = App.db.getDisplayLength(name);
         if (Em.isNone(this.get('viewValue'))) {
         if (Em.isNone(this.get('viewValue'))) {
-          this.set('viewValue', dbValue || '25'); //25 is default displayLength value for hosts page
+          if (dbValue) {
+            this.set('viewValue', dbValue);
+          } else {
+            this.set('viewValue', '25'); //25 is default displayLength value for hosts page
+            App.db.setDisplayLength(name, '25');
+          }
         }
         }
         return this.get('viewValue');
         return this.get('viewValue');
       },
       },
@@ -144,6 +149,7 @@ App.MainHostController = Em.ArrayController.extend({
             value = 0;
             value = 0;
           } else {
           } else {
             value = startIndex;
             value = startIndex;
+            App.db.setStartIndex(name, startIndex);
           }
           }
         }
         }
         return (value > 0) ? value - 1 : value;
         return (value > 0) ? value - 1 : value;