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
00928dd4
Commit
00928dd4
authored
Aug 15, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 不选择节点默认导出所有
parent
7ddf7f2a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
asset_list.html
apps/assets/templates/assets/asset_list.html
+2
-1
asset.py
apps/assets/views/asset.py
+4
-4
No files found.
apps/assets/templates/assets/asset_list.html
View file @
00928dd4
...
...
@@ -451,10 +451,11 @@ $(document).ready(function(){
$
.
each
(
rows
,
function
(
index
,
obj
)
{
assets
.
push
(
obj
.
id
)
});
var
_node_id
=
current_node
?
current_node
:
null
;
$
.
ajax
({
url
:
"{% url "
assets
:
asset
-
export
" %}"
,
method
:
'POST'
,
data
:
JSON
.
stringify
({
assets_id
:
assets
,
node_id
:
current_node
.
node_id
}),
data
:
JSON
.
stringify
({
assets_id
:
assets
,
node_id
:
_
node_id
}),
dataType
:
"json"
,
success
:
function
(
data
,
textStatus
)
{
window
.
open
(
data
.
redirect
)
...
...
apps/assets/views/asset.py
View file @
00928dd4
...
...
@@ -214,13 +214,13 @@ class AssetExportView(LoginRequiredMixin, View):
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
try
:
assets_id
=
json
.
loads
(
request
.
body
)
.
get
(
'assets_id'
,
[])
assets_
node_id
=
json
.
loads
(
request
.
body
)
.
get
(
'node_id'
,
None
)
node_id
=
json
.
loads
(
request
.
body
)
.
get
(
'node_id'
,
None
)
except
ValueError
:
return
HttpResponse
(
'Json object not valid'
,
status
=
400
)
if
not
assets_id
and
assets_node_id
:
assets_node
=
get_object_or_none
(
Node
,
id
=
assets_node_id
)
assets
=
assets_
node
.
get_all_assets
()
if
not
assets_id
:
node
=
get_object_or_none
(
Node
,
id
=
node_id
)
if
node_id
else
Node
.
root
(
)
assets
=
node
.
get_all_assets
()
for
asset
in
assets
:
assets_id
.
append
(
asset
.
id
)
...
...
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