Unverified Commit d8afe72d authored by 老广's avatar 老广 Committed by GitHub

Merge pull request #1947 from jumpserver/dev_user_paging

[Update] 用户列表页,添加分页,搜索
parents 54b6e06d cc387bf5
......@@ -9,6 +9,7 @@ from rest_framework import generics
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
from rest_framework_bulk import BulkModelViewSet
from rest_framework.pagination import LimitOffsetPagination
from ..serializers import UserSerializer, UserPKUpdateSerializer, \
UserUpdateGroupSerializer, ChangeUserPasswordSerializer
......@@ -28,10 +29,12 @@ __all__ = [
class UserViewSet(IDInFilterMixin, BulkModelViewSet):
filter_fields = ('username', 'email', 'name', 'id')
search_fields = filter_fields
queryset = User.objects.exclude(role="App")
serializer_class = UserSerializer
permission_classes = (IsOrgAdmin,)
filter_fields = ('username', 'email', 'name', 'id')
pagination_class = LimitOffsetPagination
def get_queryset(self):
queryset = super().get_queryset()
......
......@@ -95,7 +95,7 @@ function initTable() {
],
op_html: $('#actions').html()
};
table = jumpserver.initDataTable(options);
var table = jumpserver.initServerSideDataTable(options);
return table
}
......
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