mirror of https://github.com/jumpserver/jumpserver
temp: deactive test
parent
61d1d9ec90
commit
515406c05d
|
@ -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']
|
||||
|
|
|
@ -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 %}
|
||||
|
|
Loading…
Reference in New Issue