Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gjl2004yn
jumpserver
提交
13589960
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,发现更多精彩内容 >>
提交
13589960
编写于
3月 31, 2017
作者:
baltery
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of code.jumpserver.org:Jumpserver/jumpserver
上级
7720e9f3
b34c5dde
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
133 addition
and
163 deletion
+133
-163
apps/assets/templates/assets/asset_group_create.html
apps/assets/templates/assets/asset_group_create.html
+2
-2
apps/assets/templates/assets/asset_group_detail.html
apps/assets/templates/assets/asset_group_detail.html
+0
-36
apps/assets/templates/assets/asset_list.html
apps/assets/templates/assets/asset_list.html
+103
-98
apps/assets/templates/assets/idc_list.html
apps/assets/templates/assets/idc_list.html
+28
-27
未找到文件。
apps/assets/templates/assets/asset_group_create.html
浏览文件 @
13589960
...
...
@@ -51,8 +51,8 @@
</div>
</div>
<div
class=
"hr-line-dashed"
></div>
<h3
class=
"widget-head-color-box"
>
资产用户
</h3>
{{ form.system_users|bootstrap_horizontal }
}
{#
<h3
class=
"widget-head-color-box"
>
资产用户
</h3>
#}
{# {{ form.system_users|bootstrap_horizontal }}#
}
<div
class=
"form-group"
>
<div
class=
"col-sm-4 col-sm-offset-5"
>
<button
class=
"btn btn-white"
type=
"reset"
>
重置
</button>
...
...
apps/assets/templates/assets/asset_group_detail.html
浏览文件 @
13589960
...
...
@@ -101,42 +101,6 @@
</div>
</div>
<div
class=
"panel panel-info"
>
<div
class=
"panel-heading"
>
<i
class=
"fa fa-info-circle"
></i>
{% trans 'Associate system user' %}
</div>
<div
class=
"panel-body"
>
<table
class=
"table system-user-table"
>
<tbody>
<form>
<tr
class=
"no-borders-tr"
>
<td
colspan=
"2"
>
<select
data-placeholder=
"{% trans 'Select system user' %}"
class=
"select2"
style=
"width: 100%"
multiple=
""
tabindex=
"4"
>
{% for system_user in system_users_remain %}
<option
value=
"{{ system_user.id }}"
id=
"opt_{{ system_user.id }}"
>
{{ system_user.name }}
</option>
{% endfor %}
</select>
</td>
</tr>
<tr
class=
"no-borders-tr"
>
<td
colspan=
"2"
>
<button
type=
"button"
class=
"btn btn-info btn-sm btn-asset-add-groups-system-users"
>
{% trans 'Associate' %}
</button>
</td>
</tr>
</form>
{% for system_user in system_users %}
<tr>
<td
><b
class=
"bdg_system_user"
data-sid=
{{
system_user.id
}}
>
{{ system_user.name }}
</b></td>
<td>
<button
class=
"btn btn-danger btn-xs pull-right btn_leave_asset_group"
type=
"button"
style=
"float: right;"
><i
class=
"fa fa-minus"
></i></button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
...
...
apps/assets/templates/assets/asset_list.html
浏览文件 @
13589960
...
...
@@ -71,7 +71,7 @@
<option
value=
"delete"
>
{% trans 'Delete selected' %}
</option>
<option
value=
"update"
>
{% trans 'Update selected' %}
</option>
<option
value=
"deactive"
>
{% trans 'Deactive selected' %}
</option>
<option
value=
"active"
>
{% trans 'Active' %}
</option>
<option
value=
"active"
>
{% trans 'Active' %}
</option>
</select>
<div
class=
"input-group-btn pull-left"
style=
"padding-left: 5px;"
>
<button
id=
'btn_bulk_update'
style=
"height: 32px;"
class=
"btn btn-sm btn-primary"
>
...
...
@@ -96,103 +96,108 @@ window.onload = function (){
};
function
tagShow
()
{
var
oDiv
=
document
.
getElementById
(
"
ydxbd
"
);
if
(
oDiv
.
style
.
display
==
'
none
'
){
oDiv
.
style
.
display
=
"
block
"
;
}
else
{
oDiv
.
style
.
display
=
"
none
"
;
}
var
oDiv
=
document
.
getElementById
(
"
ydxbd
"
);
if
(
oDiv
.
style
.
display
==
'
none
'
){
oDiv
.
style
.
display
=
"
block
"
;
}
else
{
oDiv
.
style
.
display
=
"
none
"
;
}
}
//onload;
$
(
document
).
ready
(
function
(){
var
options
=
{
ele
:
$
(
'
#asset_list_table
'
),
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
detail_btn
=
'
<a href="{% url "assets:asset-detail" pk=99991937 %}">
'
+
cellData
+
'
</a>
'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
99991937
'
,
rowData
.
id
));
}},
{
targets
:
7
,
createdCell
:
function
(
td
,
cellData
)
{
if
(
!
cellData
)
{
$
(
td
).
html
(
'
<i class="fa fa-times text-danger"></i>
'
)
}
else
{
$
(
td
).
html
(
'
<i class="fa fa-check text-navy"></i>
'
)
}
}},
{
targets
:
8
,
createdCell
:
function
(
td
,
cellData
)
{
if
(
!
cellData
)
{
$
(
td
).
html
(
'
<i class="fa fa-circle text-danger"></i>
'
)
}
else
{
$
(
td
).
html
(
'
<i class="fa fa-circle text-navy"></i>
'
)
}
}},
{
targets
:
9
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
update_btn
=
'
<a href="{% url "assets:asset-update" pk=99991937 %}" class="btn btn-xs btn-info">{% trans "Update" %}</a>
'
.
replace
(
'
99991937
'
,
cellData
);
var
del_btn
=
'
<a class="btn btn-xs btn-danger m-l-xs btn_asset_delete" data-uid="99991937">{% trans "Delete" %}</a>
'
.
replace
(
'
99991937
'
,
cellData
);
$
(
td
).
html
(
update_btn
+
del_btn
)
}}
],
ajax_url
:
'
{% url "api-assets:asset-list" %}
'
,
columns
:
[{
data
:
"
id
"
},
{
data
:
"
hostname
"
},
{
data
:
"
ip
"
},
{
data
:
"
port
"
},
{
data
:
"
get_type_display
"
},
{
data
:
"
get_env_display
"
},
{
data
:
"
hardware
"
},
{
data
:
"
is_active
"
},
{
data
:
"
is_active
"
},
{
data
:
"
id
"
}],
op_html
:
$
(
'
#actions
'
).
html
()
};
var
table
=
jumpserver
.
initDataTable
(
options
);
$
(
'
.btn_export
'
).
click
(
function
()
{
var
assets
=
[];
var
rows
=
table
.
rows
(
'
.selected
'
).
data
();
$
.
each
(
rows
,
function
(
index
,
obj
)
{
assets
.
push
(
obj
.
id
)
});
console
.
log
(
assets
);
$
.
ajax
({
url
:
"
{% url
"
assets
:
asset
-
export
"
%}
"
,
method
:
'
POST
'
,
data
:
JSON
.
stringify
({
assets_id
:
assets
}),
dataType
:
"
json
"
,
success
:
function
(
data
,
textStatus
)
{
window
.
open
(
data
.
redirect
)
},
error
:
function
()
{
toastr
.
error
(
'
Export failed
'
);
}
})
});
$
(
'
#btn_asset_import
'
).
click
(
function
()
{
var
$form
=
$
(
'
#fm_asset_import
'
);
$form
.
find
(
'
.help-block
'
).
remove
();
function
success
(
data
)
{
if
(
data
.
valid
===
false
)
{
$
(
'
<span />
'
,
{
class
:
'
help-block text-danger
'
}).
html
(
data
.
msg
).
insertAfter
(
$
(
'
#id_assets
'
));
}
else
{
$
(
'
#id_created
'
).
html
(
data
.
created_info
);
$
(
'
#id_created_detail
'
).
html
(
data
.
created
.
join
(
'
,
'
));
$
(
'
#id_updated
'
).
html
(
data
.
updated_info
);
$
(
'
#id_updated_detail
'
).
html
(
data
.
updated
.
join
(
'
,
'
));
$
(
'
#id_failed
'
).
html
(
data
.
failed_info
);
$
(
'
#id_failed_detail
'
).
html
(
data
.
failed
.
join
(
'
,
'
));
var
$data_table
=
$
(
'
#asset_list_table
'
).
DataTable
();
$data_table
.
ajax
.
reload
();
}
}
$form
.
ajaxSubmit
({
success
:
success
});
})
var
options
=
{
ele
:
$
(
'
#asset_list_table
'
),
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
detail_btn
=
'
<a href="{% url "assets:asset-detail" pk=99991937 %}">
'
+
cellData
+
'
</a>
'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
99991937
'
,
rowData
.
id
));
}},
{
targets
:
7
,
createdCell
:
function
(
td
,
cellData
)
{
if
(
!
cellData
)
{
$
(
td
).
html
(
'
<i class="fa fa-times text-danger"></i>
'
)
}
else
{
$
(
td
).
html
(
'
<i class="fa fa-check text-navy"></i>
'
)
}
}},
{
targets
:
8
,
createdCell
:
function
(
td
,
cellData
)
{
if
(
!
cellData
)
{
$
(
td
).
html
(
'
<i class="fa fa-circle text-danger"></i>
'
)
}
else
{
$
(
td
).
html
(
'
<i class="fa fa-circle text-navy"></i>
'
)
}
}},
{
targets
:
9
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
update_btn
=
'
<a href="{% url "assets:asset-update" pk=99991937 %}" class="btn btn-xs btn-info">{% trans "Update" %}</a>
'
.
replace
(
'
99991937
'
,
cellData
);
var
del_btn
=
'
<a class="btn btn-xs btn-danger m-l-xs btn_asset_delete" data-uid="99991937">{% trans "Delete" %}</a>
'
.
replace
(
'
99991937
'
,
cellData
);
$
(
td
).
html
(
update_btn
+
del_btn
)
}}
],
ajax_url
:
'
{% url "api-assets:asset-list" %}
'
,
columns
:
[{
data
:
"
id
"
},
{
data
:
"
hostname
"
},
{
data
:
"
ip
"
},
{
data
:
"
port
"
},
{
data
:
"
get_type_display
"
},
{
data
:
"
get_env_display
"
},
{
data
:
"
hardware
"
},
{
data
:
"
is_active
"
},
{
data
:
"
is_active
"
},
{
data
:
"
id
"
}],
op_html
:
$
(
'
#actions
'
).
html
()
};
var
table
=
jumpserver
.
initDataTable
(
options
);
$
(
'
.btn_export
'
).
click
(
function
()
{
var
assets
=
[];
var
rows
=
table
.
rows
(
'
.selected
'
).
data
();
$
.
each
(
rows
,
function
(
index
,
obj
)
{
assets
.
push
(
obj
.
id
)
});
console
.
log
(
assets
);
$
.
ajax
({
url
:
"
{% url
"
assets
:
asset
-
export
"
%}
"
,
method
:
'
POST
'
,
data
:
JSON
.
stringify
({
assets_id
:
assets
}),
dataType
:
"
json
"
,
success
:
function
(
data
,
textStatus
)
{
window
.
open
(
data
.
redirect
)
},
error
:
function
()
{
toastr
.
error
(
'
Export failed
'
);
}
})
});
$
(
'
#btn_asset_import
'
).
click
(
function
()
{
var
$form
=
$
(
'
#fm_asset_import
'
);
$form
.
find
(
'
.help-block
'
).
remove
();
function
success
(
data
)
{
if
(
data
.
valid
===
false
)
{
$
(
'
<span />
'
,
{
class
:
'
help-block text-danger
'
}).
html
(
data
.
msg
).
insertAfter
(
$
(
'
#id_assets
'
));
}
else
{
$
(
'
#id_created
'
).
html
(
data
.
created_info
);
$
(
'
#id_created_detail
'
).
html
(
data
.
created
.
join
(
'
,
'
));
$
(
'
#id_updated
'
).
html
(
data
.
updated_info
);
$
(
'
#id_updated_detail
'
).
html
(
data
.
updated
.
join
(
'
,
'
));
$
(
'
#id_failed
'
).
html
(
data
.
failed_info
);
$
(
'
#id_failed_detail
'
).
html
(
data
.
failed
.
join
(
'
,
'
));
var
$data_table
=
$
(
'
#asset_list_table
'
).
DataTable
();
$data_table
.
ajax
.
reload
();
}
}
$form
.
ajaxSubmit
({
success
:
success
});
})
})
.
on
(
'
click
'
,
'
.btn_asset_delete
'
,
function
()
{
var
$this
=
$
(
this
);
var
name
=
$
(
this
).
closest
(
"
tr
"
).
find
(
"
:nth-child(2)
"
).
children
(
'
a
'
).
html
();
var
uid
=
$this
.
data
(
'
uid
'
);
var
the_url
=
'
{% url "api-assets:asset-detail" pk=99991937 %}
'
.
replace
(
'
99991937
'
,
uid
);
objectDelete
(
$this
,
name
,
the_url
);
var
$this
=
$
(
this
);
var
$data_table
=
$
(
"
#asset_list_table
"
).
DataTable
();
var
name
=
$
(
this
).
closest
(
"
tr
"
).
find
(
"
:nth-child(2)
"
).
children
(
'
a
'
).
html
();
var
uid
=
$this
.
data
(
'
uid
'
);
var
the_url
=
'
{% url "api-assets:asset-detail" pk=99991937 %}
'
.
replace
(
'
99991937
'
,
uid
);
console
.
log
(
the_url
);
objDelete
(
$this
,
name
,
the_url
);
setTimeout
(
function
()
{
$data_table
.
ajax
.
reload
();
},
3000
);
})
.
on
(
'
click
'
,
'
#btn_bulk_update
'
,
function
()
{
var
action
=
$
(
'
#slct_bulk_update
'
).
val
();
var
$data_table
=
$
(
'
#asset_list_table
'
).
DataTable
();
var
id_list
=
[];
var
action
=
$
(
'
#slct_bulk_update
'
).
val
();
var
$data_table
=
$
(
'
#asset_list_table
'
).
DataTable
();
var
id_list
=
[];
var
plain_id_list
=
[];
$data_table
.
rows
({
selected
:
true
}).
every
(
function
(){
id_list
.
push
({
id
:
this
.
data
().
id
});
...
...
@@ -265,8 +270,8 @@ $(document).ready(function(){
})
.
on
(
'
click
'
,
'
#btn_asset_bulk_update
'
,
function
()
{
var
json_data
=
$
(
"
#fm_asset_bulk_update
"
).
serializeObject
();
var
body
=
{};
var
json_data
=
$
(
"
#fm_asset_bulk_update
"
).
serializeObject
();
var
body
=
{};
body
.
enable_otp
=
(
json_data
.
enable_otp
===
'
on
'
)?
true
:
false
;
if
(
json_data
.
type
!=
''
)
{
body
.
type
=
json_data
.
type
;
...
...
@@ -282,23 +287,23 @@ $(document).ready(function(){
}
if
(
json_data
.
system_users
!=
undefined
)
{
body
.
system_users
=
json_data
.
system_users
;
body
.
system_users
=
json_data
.
system_users
;
}
if
(
typeof
body
.
system_users
===
'
string
'
)
{
body
.
system_users
=
[
parseInt
(
body
.
system_users
)]
body
.
system_users
=
[
parseInt
(
body
.
system_users
)]
}
else
if
(
typeof
body
.
system_users
===
'
array
'
)
{
var
new_users
=
body
.
system_users
.
map
(
Number
);
body
.
system_users
=
new_users
;
var
new_users
=
body
.
system_users
.
map
(
Number
);
body
.
system_users
=
new_users
;
}
if
(
json_data
.
tags
!=
undefined
)
{
body
.
tags
=
json_data
.
tags
;
body
.
tags
=
json_data
.
tags
;
}
if
(
typeof
body
.
tags
==
'
string
'
)
{
body
.
tags
=
[
parseInt
(
body
.
tags
)];
body
.
tags
=
[
parseInt
(
body
.
tags
)];
}
else
if
(
typeof
body
.
tags
===
'
array
'
)
{
var
new_tags
=
body
.
tags
.
map
(
Number
);
body
.
tags
=
new_tags
;
var
new_tags
=
body
.
tags
.
map
(
Number
);
body
.
tags
=
new_tags
;
}
var
$data_table
=
$
(
'
#asset_list_table
'
).
DataTable
();
...
...
apps/assets/templates/assets/idc_list.html
浏览文件 @
13589960
...
...
@@ -27,16 +27,16 @@
</tbody>
</table>
<div
id=
"actions"
class=
"hide"
>
<div
class=
"input-group"
>
<select
class=
"form-control m-b"
style=
"width: auto"
id=
"slct_bulk_update"
>
<option
value=
"delete"
>
{% trans 'Delete selected' %}
</option>
</select>
<div
class=
"input-group-btn pull-left"
style=
"padding-left: 5px;"
>
<button
id=
'btn_bulk_update'
style=
"height: 32px;"
class=
"btn btn-sm btn-primary"
>
{% trans 'Submit' %}
</button>
</div>
</div>
<div
class=
"input-group"
>
<select
class=
"form-control m-b"
style=
"width: auto"
id=
"slct_bulk_update"
>
<option
value=
"delete"
>
{% trans 'Delete selected' %}
</option>
</select>
<div
class=
"input-group-btn pull-left"
style=
"padding-left: 5px;"
>
<button
id=
'btn_bulk_update'
style=
"height: 32px;"
class=
"btn btn-sm btn-primary"
>
{% trans 'Submit' %}
</button>
</div>
</div>
</div>
{% endblock %}
{% block content_bottom_left %}{% endblock %}
...
...
@@ -65,19 +65,20 @@ $(document).ready(function(){
})
.
on
(
'
click
'
,
'
.btn_idc_delete
'
,
function
()
{
var
$this
=
$
(
this
);
var
$data_table
=
$
(
'
#idc_list_table
'
).
DataTable
();
var
name
=
$
(
this
).
closest
(
"
tr
"
).
find
(
"
:nth-child(2)
"
).
children
(
'
a
'
).
html
();
var
uid
=
$this
.
data
(
'
uid
'
);
var
the_url
=
'
{% url "api-assets:idc-detail" pk=99991937 %}
'
.
replace
(
'
99991937
'
,
uid
);
objectDelete
(
$this
,
name
,
the_url
);
$data_table
.
ajax
.
reload
();
{
#
TODO
:
reload
the
tale
#
}
var
$this
=
$
(
this
);
var
$data_table
=
$
(
'
#idc_list_table
'
).
DataTable
();
var
name
=
$
(
this
).
closest
(
"
tr
"
).
find
(
"
:nth-child(2)
"
).
children
(
'
a
'
).
html
();
var
uid
=
$this
.
data
(
'
uid
'
);
var
the_url
=
'
{% url "api-assets:idc-detail" pk=99991937 %}
'
.
replace
(
'
99991937
'
,
uid
);
objectDelete
(
$this
,
name
,
the_url
);
setTimeout
(
function
()
{
$data_table
.
ajax
.
reload
();
},
3000
);
})
.
on
(
'
click
'
,
'
#btn_bulk_update
'
,
function
()
{
var
action
=
$
(
'
#slct_bulk_update
'
).
val
();
var
$data_table
=
$
(
'
#idc_list_table
'
).
DataTable
();
var
action
=
$
(
'
#slct_bulk_update
'
).
val
();
var
$data_table
=
$
(
'
#idc_list_table
'
).
DataTable
();
var
id_list
=
[];
var
plain_id_list
=
[];
$data_table
.
rows
({
selected
:
true
}).
every
(
function
(){
...
...
@@ -113,13 +114,13 @@ $(document).ready(function(){
jumpserver
.
checked
=
false
;
});
}
switch
(
action
)
{
case
'
delete
'
:
doDelete
();
break
;
default
:
break
;
}
switch
(
action
)
{
case
'
delete
'
:
doDelete
();
break
;
default
:
break
;
}
});
</script>
{% endblock %}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录