Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
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
jumpserver
Commits
d8afe72d
Unverified
Commit
d8afe72d
authored
Oct 27, 2018
by
老广
Committed by
GitHub
Oct 27, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1947 from jumpserver/dev_user_paging
[Update] 用户列表页,添加分页,搜索
parents
54b6e06d
cc387bf5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
user.py
apps/users/api/user.py
+4
-1
user_list.html
apps/users/templates/users/user_list.html
+1
-1
No files found.
apps/users/api/user.py
View file @
d8afe72d
...
...
@@ -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
()
...
...
apps/users/templates/users/user_list.html
View file @
d8afe72d
...
...
@@ -95,7 +95,7 @@ function initTable() {
],
op_html
:
$
(
'#actions'
).
html
()
};
table
=
jumpserver
.
init
DataTable
(
options
);
var
table
=
jumpserver
.
initServerSide
DataTable
(
options
);
return
table
}
...
...
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