From 69fe0b07fd8cd893e4cfa1a9debae58acfae85b8 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Thu, 15 Dec 2022 16:08:19 +0800 Subject: [PATCH] perf: k8s tree (#9214) Co-authored-by: feng <1304903146@qq.com> --- apps/assets/utils/k8s.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/assets/utils/k8s.py b/apps/assets/utils/k8s.py index 3c5452272..7b287d740 100644 --- a/apps/assets/utils/k8s.py +++ b/apps/assets/utils/k8s.py @@ -112,7 +112,7 @@ class KubernetesTree: def as_asset_tree_node(self, asset): i = urlencode({'asset_id': self.tree_id}) node = self.create_tree_node( - i, str(asset.id), str(asset), 'asset', + i, str(asset.id), str(asset), 'asset', is_open=True, ) return node @@ -136,14 +136,14 @@ class KubernetesTree: return node @staticmethod - def create_tree_node(id_, pid, name, identity, icon='', is_container=False): + def create_tree_node(id_, pid, name, identity, icon='', is_container=False, is_open=False): node = { 'id': id_, 'name': name, 'title': name, 'pId': pid, 'isParent': not is_container, - 'open': False, + 'open': is_open, 'iconSkin': icon, 'meta': { 'type': 'k8s',