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
515406c0
Commit
515406c0
authored
Sep 21, 2016
by
xiaoyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
temp: deactive test
parent
61d1d9ec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
serializers.py
apps/users/serializers.py
+2
-0
user_list.html
apps/users/templates/users/user_list.html
+11
-9
No files found.
apps/users/serializers.py
View file @
515406c0
...
...
@@ -75,3 +75,5 @@ class UserBulkUpdateSerializer(BulkSerializerMixin, serializers.ModelSerializer)
class
Meta
(
object
):
model
=
User
list_serializer_class
=
BulkListSerializer
fields
=
[
'id'
,
'is_active'
,
'username'
,
'name'
,
'email'
,
'role'
,
'avatar'
,
'enable_otp'
,
'comment'
,
'groups'
]
apps/users/templates/users/user_list.html
View file @
515406c0
...
...
@@ -66,21 +66,23 @@
{% endblock %}
{% block custom_foot_js %}
<script>
jumpserver
.
bulk_delete
=
function
(){
}
$
(
document
).
on
(
'click'
,
'#btn_bulk_update'
,
function
(){
var
action
=
$
(
'#slct_bulk_update'
).
val
();
var
id_list
=
$
(
'.ipt_bulk_update:checked'
).
map
(
function
(){
return
{
'id'
:
$
(
this
).
val
(
)}}).
get
();
console
.
log
(
id_list
)
;
var
id_list
=
$
(
'.ipt_bulk_update:checked'
).
map
(
function
(){
return
{
'id'
:
parseInt
(
$
(
this
).
val
()
)}}).
get
();
var
the_url
=
"{% url 'users:user-bulk-update-api' %}"
;
function
doDeactive
()
{
var
body
=
$
.
each
(
id_list
,
function
(
dict
,
index
)
{
})
var
body
=
$
.
each
(
id_list
,
function
(
index
,
user_object
)
{
user_object
[
'is_active'
]
=
false
;
});
APIUpdateAttr
({
url
:
the_url
,
method
:
'PATCH'
,
body
:
JSON
.
stringify
(
body
)});
};
switch
(
action
)
{
case
'deactive'
:
}
doDeactive
();
break
;
default
:
break
;
};
})
</script>
{% endblock %}
...
...
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