2015-04-20 02:12:11 +00:00
|
|
|
{% extends 'base.html' %}
|
|
|
|
{% load mytags %}
|
2015-10-31 01:23:10 +00:00
|
|
|
{% load bootstrap %}
|
2015-04-20 02:12:11 +00:00
|
|
|
{% block content %}
|
|
|
|
{% include 'nav_cat_bar.html' %}
|
|
|
|
<div class="wrapper wrapper-content animated fadeInRight">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-10">
|
|
|
|
<div class="ibox float-e-margins">
|
|
|
|
<div id="ibox-content" class="ibox-title">
|
2015-09-08 16:19:17 +00:00
|
|
|
<h5> 填写资产基本信息 </h5>
|
2015-04-20 02:12:11 +00:00
|
|
|
<div class="ibox-tools">
|
|
|
|
<a class="collapse-link">
|
|
|
|
<i class="fa fa-chevron-up"></i>
|
|
|
|
</a>
|
|
|
|
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
|
|
|
<i class="fa fa-wrench"></i>
|
|
|
|
</a>
|
|
|
|
<a class="close-link">
|
|
|
|
<i class="fa fa-times"></i>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="ibox-content">
|
|
|
|
<div class="panel blank-panel">
|
|
|
|
<div class="panel-options">
|
|
|
|
<ul class="nav nav-tabs">
|
2015-09-08 16:19:17 +00:00
|
|
|
<li class="active"><a href="/jasset/asset_add/" class="text-center"><i class="fa fa-laptop"></i> 单台添加 </a></li>
|
2015-04-20 02:12:11 +00:00
|
|
|
<li><a href="/jasset/host_add_multi" class="text-center"><i class="fa fa-bar-chart-o"></i> 批量添加 </a></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<div class="tab-content">
|
|
|
|
<div id="tab-1" class="ibox float-e-margins tab-pane active">
|
2015-09-08 16:19:17 +00:00
|
|
|
{% if error %}
|
|
|
|
<div class="alert alert-warning text-center">{{ error }}</div>
|
2015-04-20 02:12:11 +00:00
|
|
|
{% endif %}
|
2015-09-08 16:19:17 +00:00
|
|
|
{% if msg %}
|
|
|
|
<div class="alert alert-success text-center">{{ msg }}</div>
|
2015-04-20 02:12:11 +00:00
|
|
|
{% endif %}
|
2015-11-03 09:07:46 +00:00
|
|
|
|
2015-04-20 02:12:11 +00:00
|
|
|
<form id="assetForm" method="post" class="form-horizontal">
|
2015-11-03 09:07:46 +00:00
|
|
|
|
2015-10-31 01:23:10 +00:00
|
|
|
{{ af.ip|bootstrap_horizontal }}
|
2015-04-20 02:12:11 +00:00
|
|
|
|
|
|
|
<div class="hr-line-dashed"></div>
|
2015-11-03 09:07:46 +00:00
|
|
|
{{ af.port|bootstrap_horizontal }}
|
|
|
|
|
|
|
|
<div class="hr-line-dashed"></div>
|
|
|
|
{{ af.idc|bootstrap_horizontal }}
|
|
|
|
|
|
|
|
{# {{ af.use_default_auth|bootstrap_horizontal }}#}
|
2015-04-20 02:12:11 +00:00
|
|
|
|
|
|
|
<div class="hr-line-dashed"></div>
|
|
|
|
<div class="form-group">
|
2015-11-03 09:07:46 +00:00
|
|
|
<label for="j_group" class="col-sm-2 control-label">管理账号</label>
|
|
|
|
<div class="col-sm-2">
|
2015-09-08 16:19:17 +00:00
|
|
|
<div class="radio i-checks">
|
|
|
|
<label>
|
2015-11-03 09:07:46 +00:00
|
|
|
<input type="checkbox" checked="" id="id_use_default_auth" name="use_default_auth"><span> 使用默认 </span>
|
2015-09-08 16:19:17 +00:00
|
|
|
</label>
|
|
|
|
</div>
|
2015-04-20 02:12:11 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2015-09-08 16:19:17 +00:00
|
|
|
<div class="form-group" id="admin_account" style="display: none">
|
|
|
|
<label class="col-sm-2 control-label"> 管理用户名<span class="red-fonts">*</span> </label>
|
|
|
|
<div class="col-sm-3">
|
|
|
|
<input type="text" placeholder="Username" name="username" class="form-control">
|
2015-04-20 02:12:11 +00:00
|
|
|
</div>
|
|
|
|
|
2015-09-08 16:19:17 +00:00
|
|
|
<label class="col-sm-1 control-label"> 密码<span class="red-fonts">*</span> </label>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<input type="password" placeholder="Password" name="password" class="form-control">
|
2015-04-20 02:12:11 +00:00
|
|
|
</div>
|
2015-09-08 16:19:17 +00:00
|
|
|
</div>
|
2015-04-20 02:12:11 +00:00
|
|
|
|
|
|
|
<div class="hr-line-dashed"></div>
|
2015-11-03 09:07:46 +00:00
|
|
|
{{ af.group|bootstrap_horizontal }}
|
2015-04-20 02:12:11 +00:00
|
|
|
|
|
|
|
<div class="hr-line-dashed"></div>
|
2015-11-03 09:07:46 +00:00
|
|
|
{{ af.is_active|bootstrap_horizontal }}
|
|
|
|
|
|
|
|
{# <div class="hr-line-dashed"></div>#}
|
|
|
|
{# <div class="form-group"><label class="col-sm-2 control-label"> 是否激活<span class="red-fonts">*</span> </label>#}
|
|
|
|
{# <div class="col-sm-8">#}
|
|
|
|
{# <div class="radio i-checks">#}
|
|
|
|
{# <label> <input type="radio" checked="" name="is_active">激活 </label>#}
|
|
|
|
{# <label> <input type="radio" name="is_active"> 禁用</label>#}
|
|
|
|
{# </div>#}
|
|
|
|
{# </div>#}
|
|
|
|
{# </div>#}
|
2015-04-20 02:12:11 +00:00
|
|
|
|
|
|
|
<div class="hr-line-dashed"></div>
|
2015-11-03 09:07:46 +00:00
|
|
|
{{ af.comment|bootstrap_horizontal }}
|
2015-04-20 02:12:11 +00:00
|
|
|
|
|
|
|
<div class="hr-line-dashed"></div>
|
|
|
|
<div class="form-group">
|
2015-09-08 16:19:17 +00:00
|
|
|
<div class="col-sm-4 col-sm-offset-2">
|
|
|
|
<button class="btn btn-white" type="reset"> 重置 </button>
|
2015-04-20 02:12:11 +00:00
|
|
|
<button class="btn btn-primary" type="submit"> 提交 </button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2015-09-08 16:19:17 +00:00
|
|
|
{% endblock %}
|
2015-04-20 02:12:11 +00:00
|
|
|
|
2015-09-08 16:19:17 +00:00
|
|
|
{% block self_footer_js %}
|
2015-04-20 02:12:11 +00:00
|
|
|
<script>
|
2015-09-08 16:19:17 +00:00
|
|
|
|
|
|
|
$('document').ready(function(){
|
2015-11-03 09:07:46 +00:00
|
|
|
$('#id_use_default_auth').click(function(){
|
2015-09-08 16:19:17 +00:00
|
|
|
if ($(this).is(':checked')){
|
|
|
|
$('#admin_account').css('display', 'none')
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$('#admin_account').css('display', 'block')
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|
2015-04-20 02:12:11 +00:00
|
|
|
|
|
|
|
$('#assetForm').validator({
|
|
|
|
timely: 2,
|
|
|
|
theme: "yellow_right_effect",
|
|
|
|
rules: {
|
|
|
|
check_ip: [/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])(\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])){3}$/, 'ip地址不正确'],
|
|
|
|
check_port: [/^\d{1,5}$/, '端口号不正确'],
|
|
|
|
},
|
|
|
|
fields: {
|
2015-09-08 16:19:17 +00:00
|
|
|
"ip": {
|
2015-04-20 02:12:11 +00:00
|
|
|
rule: "required;check_ip",
|
|
|
|
tip: "输入IP",
|
|
|
|
ok: "",
|
|
|
|
msg: {required: "必须填写!"}
|
|
|
|
},
|
2015-09-08 16:19:17 +00:00
|
|
|
"port": {
|
2015-04-20 02:12:11 +00:00
|
|
|
rule: "required;check_port",
|
|
|
|
tip: "输入端口号",
|
|
|
|
ok: "",
|
|
|
|
msg: {required: "必须填写!"}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
valid: function(form) {
|
|
|
|
form.submit();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
{% endblock %}
|