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
cc387bf5
Commit
cc387bf5
authored
Oct 24, 2018
by
BaiJiangJie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 用户列表页,添加分页,搜索
parent
54b6e06d
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 @
cc387bf5
...
@@ -9,6 +9,7 @@ from rest_framework import generics
...
@@ -9,6 +9,7 @@ from rest_framework import generics
from
rest_framework.response
import
Response
from
rest_framework.response
import
Response
from
rest_framework.permissions
import
IsAuthenticated
from
rest_framework.permissions
import
IsAuthenticated
from
rest_framework_bulk
import
BulkModelViewSet
from
rest_framework_bulk
import
BulkModelViewSet
from
rest_framework.pagination
import
LimitOffsetPagination
from
..serializers
import
UserSerializer
,
UserPKUpdateSerializer
,
\
from
..serializers
import
UserSerializer
,
UserPKUpdateSerializer
,
\
UserUpdateGroupSerializer
,
ChangeUserPasswordSerializer
UserUpdateGroupSerializer
,
ChangeUserPasswordSerializer
...
@@ -28,10 +29,12 @@ __all__ = [
...
@@ -28,10 +29,12 @@ __all__ = [
class
UserViewSet
(
IDInFilterMixin
,
BulkModelViewSet
):
class
UserViewSet
(
IDInFilterMixin
,
BulkModelViewSet
):
filter_fields
=
(
'username'
,
'email'
,
'name'
,
'id'
)
search_fields
=
filter_fields
queryset
=
User
.
objects
.
exclude
(
role
=
"App"
)
queryset
=
User
.
objects
.
exclude
(
role
=
"App"
)
serializer_class
=
UserSerializer
serializer_class
=
UserSerializer
permission_classes
=
(
IsOrgAdmin
,)
permission_classes
=
(
IsOrgAdmin
,)
filter_fields
=
(
'username'
,
'email'
,
'name'
,
'id'
)
pagination_class
=
LimitOffsetPagination
def
get_queryset
(
self
):
def
get_queryset
(
self
):
queryset
=
super
()
.
get_queryset
()
queryset
=
super
()
.
get_queryset
()
...
...
apps/users/templates/users/user_list.html
View file @
cc387bf5
...
@@ -95,7 +95,7 @@ function initTable() {
...
@@ -95,7 +95,7 @@ function initTable() {
],
],
op_html
:
$
(
'#actions'
).
html
()
op_html
:
$
(
'#actions'
).
html
()
};
};
table
=
jumpserver
.
init
DataTable
(
options
);
var
table
=
jumpserver
.
initServerSide
DataTable
(
options
);
return
table
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