Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
444f494c
Commit
444f494c
authored
Sep 11, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改节点资产数量的bug
parent
3fdec62e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
node.py
apps/assets/models/node.py
+2
-2
utils.py
apps/assets/utils.py
+2
-0
No files found.
apps/assets/models/node.py
View file @
444f494c
...
...
@@ -39,9 +39,9 @@ class TreeMixin:
tree_updated_time
=
cache
.
get
(
cls
.
tree_updated_time_cache_key
,
0
)
if
not
cls
.
tree_created_time
or
\
tree_updated_time
>
cls
.
tree_created_time
:
logger
.
debug
(
"Create node tree"
)
tree
=
TreeService
.
new
()
cls
.
tree_created_time
=
time
.
time
()
cls
.
refresh_tree
(
cls
.
tree_assets_created_time
)
cls
.
tree_assets_created_time
=
time
.
time
()
cls
.
_tree_service
=
tree
return
tree
...
...
@@ -50,7 +50,7 @@ class TreeMixin:
node_assets_updated_time
>
cls
.
tree_assets_created_time
:
cls
.
_tree_service
.
init_assets_async
()
cls
.
tree_assets_created_time
=
time
.
time
()
cls
.
refresh_node_assets
(
cls
.
tree_assets_created_time
)
logger
.
debug
(
"Refresh node tree assets"
)
return
cls
.
_tree_service
@classmethod
...
...
apps/assets/utils.py
View file @
444f494c
...
...
@@ -92,6 +92,8 @@ class TreeService(Tree):
def
init_assets
(
self
):
from
orgs.utils
import
tmp_to_root_org
self
.
all_nodes_assets_map
=
{}
self
.
nodes_assets_map
=
defaultdict
(
set
)
logger
.
debug
(
'Init tree assets'
)
with
tmp_to_root_org
():
queryset
=
Asset
.
objects
.
all
()
.
values_list
(
'id'
,
'nodes__key'
)
for
asset_id
,
key
in
queryset
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment