Commit 9abb0b35 authored by BaiJiangJie's avatar BaiJiangJie Committed by 老广

[Update] 资产列表显示,支持不分页 (#139)

parent 063d9db7
......@@ -302,6 +302,7 @@ default_config = {
'REPLAY_STORAGE': {'TYPE': 'server'},
'LANGUAGE_CODE': 'zh',
'SECURITY_MAX_IDLE_TIME': 60,
'ASSET_LIST_PAGE_SIZE': 'auto',
}
config = Config(root_path, default_config)
......
......@@ -24,6 +24,7 @@ PAGE_DOWN = 'down'
PAGE_UP = 'up'
BACK = 'back'
PROXY = 'proxy'
PAGE_SIZE_ALL = 100000000
class InteractiveServer:
......@@ -47,7 +48,14 @@ class InteractiveServer:
@property
def page_size(self):
return self.client.request.meta['height'] - 8
_page_size = config['ASSET_LIST_PAGE_SIZE']
if _page_size.isdigit():
return int(_page_size)
elif _page_size == 'auto':
return self.client.request.meta['height'] - 8
else:
return PAGE_SIZE_ALL
@property
def search_result(self):
......@@ -396,6 +404,9 @@ class InteractiveServer:
page -= 1
left -= self.page_size
else:
if self.page_size == PAGE_SIZE_ALL:
# 如果全部显示左下标不做修改
continue
# PAGE_DOWN
page += 1
left += len(result)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment