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
b3114a1f
Commit
b3114a1f
authored
Dec 27, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bugfix] 修复vault导出选择id的bug
parent
7193d7fc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
63 deletions
+4
-63
base.py
apps/assets/backends/base.py
+4
-3
_asset_update_modal.html
apps/assets/templates/assets/_asset_update_modal.html
+0
-4
_import_modal.html
apps/templates/_import_modal.html
+0
-28
_update_modal.html
apps/templates/_update_modal.html
+0
-28
No files found.
apps/assets/backends/base.py
View file @
b3114a1f
...
...
@@ -43,7 +43,7 @@ class AssetUserQuerySet(list):
else
:
in_kwargs
[
k
]
=
v
for
k
in
in_kwargs
:
kwargs
.
pop
(
k
)
kwargs
.
pop
(
k
,
None
)
if
len
(
in_kwargs
)
==
0
:
return
self
...
...
@@ -56,7 +56,7 @@ class AssetUserQuerySet(list):
v
=
[
str
(
i
)
for
i
in
v
]
if
isinstance
(
attr
,
uuid
.
UUID
):
attr
=
str
(
attr
)
if
v
in
attr
:
if
attr
in
v
:
matched
=
True
if
matched
:
queryset
.
append
(
i
)
...
...
@@ -68,11 +68,12 @@ class AssetUserQuerySet(list):
real
=
[]
for
k
,
v
in
kwargs
.
items
():
wanted
.
append
(
v
)
value
=
getattr
(
obj
,
k
)
value
=
getattr
(
obj
,
k
,
None
)
if
isinstance
(
value
,
uuid
.
UUID
):
value
=
str
(
value
)
real
.
append
(
value
)
return
wanted
==
real
kwargs
=
{
k
:
v
for
k
,
v
in
kwargs
.
items
()
if
k
.
find
(
'__in'
)
==
-
1
}
if
len
(
kwargs
)
>
0
:
queryset
=
AssetUserQuerySet
([
i
for
i
in
self
if
filter_it
(
i
)])
else
:
...
...
apps/assets/templates/assets/_asset_update_modal.html
deleted
100644 → 0
View file @
7193d7fc
{% extends '_update_modal.html' %}
{% load i18n %}
{% block modal_title%}{% trans "Update assets" %}{% endblock %}
apps/templates/_import_modal.html
deleted
100644 → 0
View file @
7193d7fc
{% extends '_modal.html' %}
{% load i18n %}
{% block modal_id %}import_modal{% endblock %}
{% block modal_confirm_id %}btn_import_confirm{% endblock %}
{% block modal_body %}
<form
method=
"post"
id=
"fm_import"
>
{% csrf_token %}
<div
class=
"form-group"
>
<label
class=
"control-label"
>
{% trans "Download the imported template or use the exported CSV file format" %}
</label>
<a
href=
"{% block import_modal_download_template_url %}{% endblock %}?format=csv&template=import&limit=1"
style=
"display: block"
>
{% trans 'Download the import template' %}
</a>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label"
for=
"id_file"
>
{% trans "Select the CSV file to import" %}
</label>
<input
id=
"id_file"
type=
"file"
name=
"file"
/>
</div>
</form>
<div>
<p
class=
"text-success"
id=
"success_created"
></p>
<p
id=
"success_created_detail"
></p>
<p
class=
"text-danger"
id=
"created_failed"
></p>
<p
id=
"created_failed_detail"
></p>
</div>
{% endblock %}
apps/templates/_update_modal.html
deleted
100644 → 0
View file @
7193d7fc
{% extends '_modal.html' %}
{% load i18n %}
{% block modal_id %}update_modal{% endblock %}
{% block modal_confirm_id %}btn_update_confirm{% endblock %}
{% block modal_body %}
<form
method=
"post"
id=
"fm_import"
>
{% csrf_token %}
<div
class=
"form-group"
>
<label
class=
"control-label"
>
{% trans "Download the update template or use the exported CSV file format" %}
</label>
<a
id=
"download_update_template"
style=
"display: block"
>
{% trans 'Download the update template' %}
</a>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label"
for=
"update_file"
>
{% trans "Select the CSV file to import" %}
</label>
<input
id=
"update_file"
type=
"file"
name=
"file"
/>
</div>
</form>
<div>
<p
class=
"text-warning"
id=
"success_updated"
></p>
<p
id=
"success_updated_detail"
></p>
<p
class=
"text-danger"
id=
"updated_failed"
></p>
<p
id=
"updated_failed_detail"
></p>
</div>
{% endblock %}
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