Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
coco
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
coco
Commits
9abb0b35
Commit
9abb0b35
authored
Dec 17, 2018
by
BaiJiangJie
Committed by
老广
Dec 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 资产列表显示,支持不分页 (#139)
parent
063d9db7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
config.py
coco/config.py
+1
-0
interactive.py
coco/interactive.py
+12
-1
No files found.
coco/config.py
View file @
9abb0b35
...
...
@@ -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
)
...
...
coco/interactive.py
View file @
9abb0b35
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment