perf: 统一应用树 (#6535)

* perf: 添加应用树api

* perf: perms tree

* perf: 统一应用树

* perf: 修改icon

* perf: stash it

* perf: 优化应用账号

* perf: 基本完成应用账号重构

* perf: 修改翻译

Co-authored-by: ibuler <ibuler@qq.com>
This commit is contained in:
fit2bot
2021-07-27 16:06:00 +08:00
committed by GitHub
parent d347ed9862
commit 905d0d5131
29 changed files with 626 additions and 421 deletions

View File

@@ -4,6 +4,7 @@ from rest_framework.generics import ListAPIView
from rest_framework.response import Response
from common.mixins.api import CommonApiMixin
from common.tree import TreeNodeSerializer
from applications.api.mixin import (
SerializeApplicationToTreeNodeMixin
)
@@ -52,11 +53,13 @@ class ApplicationsAsTreeMixin(SerializeApplicationToTreeNodeMixin):
"""
将应用序列化成树的结构返回
"""
serializer_class = TreeNodeSerializer
def list(self, request, *args, **kwargs):
queryset = self.filter_queryset(self.get_queryset())
data = self.serialize_applications_with_org(queryset)
return Response(data=data)
tree_nodes = self.serialize_applications_with_org(queryset)
serializer = self.get_serializer(tree_nodes, many=True)
return Response(data=serializer.data)
class UserAllGrantedApplicationsAsTreeApi(ApplicationsAsTreeMixin, UserAllGrantedApplicationsApi):