mirror of
https://github.com/Yubico/yubiadmin.git
synced 2025-02-21 17:54:17 +01:00
Limit max number of items displayed per page.
This commit is contained in:
parent
aa8712f46f
commit
8f9fd30a7c
@ -128,6 +128,7 @@ class CollectionApp(App):
|
||||
template = 'table'
|
||||
script = 'table'
|
||||
selectable = True
|
||||
max_limit = 100
|
||||
|
||||
def _size(self):
|
||||
return 0
|
||||
@ -155,6 +156,7 @@ class CollectionApp(App):
|
||||
return self.list()
|
||||
|
||||
def list(self, offset=0, limit=10):
|
||||
limit = min(self.max_limit, limit)
|
||||
items = self._get(offset, limit)
|
||||
total = self._size()
|
||||
shown = (min(offset + 1, total), min(offset + limit, total))
|
||||
|
Loading…
x
Reference in New Issue
Block a user