mirror of https://github.com/jumpserver/jumpserver
pref: 优化没有获取到节点的问题
parent
10adb4e6b7
commit
8c839784fb
|
@ -36,6 +36,22 @@ class GrantedAppTreeUtil:
|
|||
})
|
||||
return node
|
||||
|
||||
@staticmethod
|
||||
def create_empty_node():
|
||||
name = _("Empty")
|
||||
node = TreeNode(**{
|
||||
'id': 'empty',
|
||||
'name': name,
|
||||
'title': name,
|
||||
'pId': '',
|
||||
'isParent': True,
|
||||
'children': [],
|
||||
'meta': {
|
||||
'type': 'application'
|
||||
}
|
||||
})
|
||||
return node
|
||||
|
||||
@staticmethod
|
||||
def get_children_nodes(tree_id, parent_info, user):
|
||||
tree_nodes = []
|
||||
|
@ -61,7 +77,7 @@ class GrantedAppTreeUtil:
|
|||
def create_tree_nodes(self, applications):
|
||||
tree_nodes = []
|
||||
if not applications:
|
||||
return tree_nodes
|
||||
return [self.create_empty_node()]
|
||||
|
||||
root_node = self.create_root_node()
|
||||
organizations = self.filter_organizations(applications)
|
||||
|
|
Loading…
Reference in New Issue