mirror of
https://github.com/Yubico/yubiadmin.git
synced 2025-02-22 11:54:16 +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'
|
template = 'table'
|
||||||
script = 'table'
|
script = 'table'
|
||||||
selectable = True
|
selectable = True
|
||||||
|
max_limit = 100
|
||||||
|
|
||||||
def _size(self):
|
def _size(self):
|
||||||
return 0
|
return 0
|
||||||
@ -155,6 +156,7 @@ class CollectionApp(App):
|
|||||||
return self.list()
|
return self.list()
|
||||||
|
|
||||||
def list(self, offset=0, limit=10):
|
def list(self, offset=0, limit=10):
|
||||||
|
limit = min(self.max_limit, limit)
|
||||||
items = self._get(offset, limit)
|
items = self._get(offset, limit)
|
||||||
total = self._size()
|
total = self._size()
|
||||||
shown = (min(offset + 1, total), min(offset + limit, total))
|
shown = (min(offset + 1, total), min(offset + limit, total))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user