1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-08-29 01:50:00 +03:00

Added support for configurable admin pagesizes

This commit is contained in:
Adolfo Gómez García
2020-10-20 11:11:10 +02:00
parent 48e0577e9f
commit bafd3bc6b3
3 changed files with 6 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -93,6 +93,6 @@
</svg>
</div>
</uds-root>
<script src="/uds/res/admin/runtime.js?stamp=1602729551" defer></script><script src="/uds/res/admin/polyfills-es5.js?stamp=1602729551" nomodule defer></script><script src="/uds/res/admin/polyfills.js?stamp=1602729551" defer></script><script src="/uds/res/admin/main.js?stamp=1602729551" defer></script></body>
<script src="/uds/res/admin/runtime.js?stamp=1603184654" defer></script><script src="/uds/res/admin/polyfills-es5.js?stamp=1603184654" nomodule defer></script><script src="/uds/res/admin/polyfills.js?stamp=1603184654" defer></script><script src="/uds/res/admin/main.js?stamp=1603184654" defer></script></body>
</html>

View File

@ -198,8 +198,11 @@ def udsJs(request: 'HttpRequest') -> str:
config['urls']['admin'] = reverse('uds.admin.views.index')
config['urls']['rest'] = reverse('REST', kwargs={'arguments': ''})
# Admin config
page_size = GlobalConfig.ADMIN_PAGESIZE.getInt(True)
# Fix page size to razonable usable values
page_size = 10 if page_size < 10 else 50 if page_size > 50 else page_size
config['admin'] = {
'page_size': GlobalConfig.ADMIN_PAGESIZE.getInt(True),
'page_size': page_size,
}
errors: typing.List = []