Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gjl2004yn
jumpserver
提交
c931d317
J
jumpserver
项目概览
gjl2004yn
/
jumpserver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jumpserver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c931d317
编写于
3月 24, 2017
作者:
右
右书僮
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复资产组更新中 用户己选择的资产项不全问题
上级
c5666f13
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
8 deletion
+18
-8
apps/assets/templates/assets/asset_modal_list.html
apps/assets/templates/assets/asset_modal_list.html
+5
-5
apps/assets/views.py
apps/assets/views.py
+13
-3
未找到文件。
apps/assets/templates/assets/asset_modal_list.html
浏览文件 @
c931d317
...
...
@@ -18,7 +18,7 @@
</tr>
</thead>
<tbody>
{% for asset in asset
_modal_list
%}
{% for asset in asset
s
%}
{% if asset.id in all_assets %}
<tr
name=
"oAssets"
class=
"odd selected text-center"
>
<td
class=
"text-center"
><input
type=
"checkbox"
name=
"checked"
value=
"{{ asset.id }}"
checked=
"checked"
></td>
...
...
@@ -26,10 +26,10 @@
<tr
name=
"oAssets"
>
<td
class=
"text-center"
><input
type=
"checkbox"
name=
"checked"
value=
"{{ asset.id }}"
></td>
{% endif %}
<td>
{{ asset.id }}
</td>
<td>
{{ asset.hostname }}
</td>
<td>
{{ asset.ip }}
</td>
<td>
{{ asset.env }}-{{ asset.type }}
</td>
<td
class=
"text-center"
>
{{ asset.id }}
</td>
<td
class=
"text-center"
>
{{ asset.hostname }}
</td>
<td
class=
"text-center"
>
{{ asset.ip }}
</td>
<td
class=
"text-center"
>
{{ asset.env }}-{{ asset.type }}
</td>
</tr>
{% endfor %}
</tbody>
...
...
apps/assets/views.py
浏览文件 @
c931d317
...
...
@@ -195,6 +195,7 @@ class AssetModalListView(AdminUserRequiredMixin, ListView):
tag_id
=
self
.
request
.
GET
.
get
(
'tag_id'
)
plain_id_lists
=
self
.
request
.
GET
.
get
(
'plain_id_lists'
)
self
.
s
=
self
.
request
.
GET
.
get
(
'plain_id_lists'
)
assets
=
Asset
.
objects
.
all
()
if
","
in
str
(
self
.
s
):
self
.
plain_id_lists
=
[
int
(
x
)
for
x
in
self
.
s
.
split
(
','
)]
else
:
...
...
@@ -206,19 +207,28 @@ class AssetModalListView(AdminUserRequiredMixin, ListView):
else
:
plain_id_lists
=
[
int
(
self
.
s
)]
context
=
{
'all_assets'
:
plain_id_lists
'all_assets'
:
plain_id_lists
,
'assets'
:
assets
}
kwargs
.
update
(
context
)
if
group_id
:
group
=
AssetGroup
.
objects
.
get
(
id
=
group_id
)
print
group
context
=
{
'all_assets'
:
[
x
.
id
for
x
in
group
.
assets
.
all
()]
'all_assets'
:
[
x
.
id
for
x
in
group
.
assets
.
all
()],
'assets'
:
assets
}
kwargs
.
update
(
context
)
if
tag_id
:
tag
=
Tag
.
objects
.
get
(
id
=
tag_id
)
context
=
{
'all_assets'
:
[
x
.
id
for
x
in
tag
.
asset_set
.
all
()]
'all_assets'
:
[
x
.
id
for
x
in
tag
.
asset_set
.
all
()],
'assets'
:
assets
}
kwargs
.
update
(
context
)
else
:
context
=
{
'assets'
:
assets
}
kwargs
.
update
(
context
)
return
super
(
AssetModalListView
,
self
).
get_context_data
(
**
kwargs
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录