Browse Source

Merge pull request #1515 from wstart/master

授权页面分页问题
pull/1542/head^2
老广 6 years ago committed by GitHub
parent
commit
91b3b7ce69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      apps/perms/api.py
  2. 2
      apps/perms/templates/perms/asset_permission_list.html

4
apps/perms/api.py

@ -5,6 +5,7 @@ from django.shortcuts import get_object_or_404
from rest_framework.views import APIView, Response
from rest_framework.generics import ListAPIView, get_object_or_404, RetrieveUpdateAPIView
from rest_framework import viewsets
from rest_framework.pagination import LimitOffsetPagination
from common.utils import set_or_append_attr_bulk, get_object_or_none
from users.permissions import IsValidUser, IsSuperUser, IsSuperUserOrAppUser
@ -19,9 +20,12 @@ class AssetPermissionViewSet(viewsets.ModelViewSet):
"""
资产授权列表的增删改查api
"""
filter_fields = ("name",)
search_fields = filter_fields
queryset = AssetPermission.objects.all()
serializer_class = serializers.AssetPermissionCreateUpdateSerializer
permission_classes = (IsSuperUser,)
pagination_class = LimitOffsetPagination
def get_serializer_class(self):
if self.action in ("list", 'retrieve'):

2
apps/perms/templates/perms/asset_permission_list.html

@ -208,7 +208,7 @@ function initTable() {
select: {},
op_html: $('#actions').html()
};
table = jumpserver.initDataTable(options);
table = jumpserver.initServerSideDataTable(options);
return table
}

Loading…
Cancel
Save