|
|
|
@ -22,12 +22,6 @@
|
|
|
|
|
|
|
|
|
|
<div class="ibox-content">
|
|
|
|
|
<div class="panel blank-panel">
|
|
|
|
|
{# <div class="panel-options">#}
|
|
|
|
|
{# <ul class="nav nav-tabs">#}
|
|
|
|
|
{# <li class="active"><a href="{% url 'assets:asset-add' %}" class="text-center"><i class="fa fa-laptop"></i> 单台添加 </a></li>#}
|
|
|
|
|
{# <li><a href="{% url 'asset_add_batch' %}" 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">
|
|
|
|
@ -40,90 +34,73 @@
|
|
|
|
|
|
|
|
|
|
<form id="assetForm" method="post" class="form-horizontal">
|
|
|
|
|
{% csrf_token %}
|
|
|
|
|
<h3 class="widget-head-color-box">基本信息</h3>
|
|
|
|
|
<h2 class="widget-head-color-box">基本信息</h2>
|
|
|
|
|
|
|
|
|
|
{{ form.hostname|bootstrap_horizontal }}
|
|
|
|
|
|
|
|
|
|
<div class="hr-line-dashed"></div>
|
|
|
|
|
{{ form.ip|bootstrap_horizontal }}
|
|
|
|
|
<p class="col-sm-offset-2">Tips: 如果IP地址不填写, IP默认会设置与主机名一致</p>
|
|
|
|
|
|
|
|
|
|
{# <div class="hr-line-dashed"></div>#}
|
|
|
|
|
{# <div class="form-group">#}
|
|
|
|
|
{# <label for="j_group" class="col-sm-2 control-label">管理用户<span class="red-fonts"> *</span></label>#}
|
|
|
|
|
{# <div class="col-sm-2">#}
|
|
|
|
|
{# <div class="radio i-checks">#}
|
|
|
|
|
{# <label style="padding-left: 0">#}
|
|
|
|
|
{# <input type="checkbox" checked="checked" id="id_use_default_auth" name="use_default_auth"><span> 使用默认 </span>#}
|
|
|
|
|
{# </label>#}
|
|
|
|
|
{# </div>#}
|
|
|
|
|
{# </div>#}
|
|
|
|
|
{# </div>#}
|
|
|
|
|
{# <p class="col-sm-offset-2">Tips: 管理用户是服务器存在的root或拥有sudo的用户,用来推送系统用户</p>#}
|
|
|
|
|
{# <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">#}
|
|
|
|
|
{# </div>#}
|
|
|
|
|
{##}
|
|
|
|
|
{# <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">#}
|
|
|
|
|
{# </div>#}
|
|
|
|
|
{# </div>#}
|
|
|
|
|
{# <p class="col-sm-offset-2">Tips: 如果IP地址不填写, IP默认会设置与主机名一致</p>#}
|
|
|
|
|
|
|
|
|
|
<div class="form-group" id="id_port">
|
|
|
|
|
<div class="hr-line-dashed"></div>
|
|
|
|
|
<label class="col-sm-2 control-label"> 端口<span class="red-fonts">*</span> </label>
|
|
|
|
|
<div class="col-sm-8">
|
|
|
|
|
<input type="text" placeholder="Port" name="port" class="form-control" value="{{ default_port }}">
|
|
|
|
|
<label class="col-sm-2 control-label">端口</label>
|
|
|
|
|
<div class="col-sm-9">
|
|
|
|
|
<input type="text" placeholder="" name="port" class="form-control">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{# <div class="hr-line-dashed"></div>#}
|
|
|
|
|
{# {{ form.group|bootstrap_horizontal }}#}
|
|
|
|
|
|
|
|
|
|
{# {{ af.is_active|bootstrap_horizontal }}#}
|
|
|
|
|
{# <div class="form-group" id="id_type">#}
|
|
|
|
|
{# <div class="hr-line-dashed"></div>#}
|
|
|
|
|
{# <label class="col-sm-2 control-label">资产类型</label>#}
|
|
|
|
|
{# <div class="col-sm-9">#}
|
|
|
|
|
{# <input type="text" placeholder="" name="type" class="form-control">#}
|
|
|
|
|
{# </div>#}
|
|
|
|
|
{# </div>#}
|
|
|
|
|
|
|
|
|
|
<div class="hr-line-dashed"></div>
|
|
|
|
|
{{ form.comment|bootstrap_horizontal }}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="hr-line-dashed"></div>
|
|
|
|
|
<h3>关联资产用户</h3>
|
|
|
|
|
<h2>关联资产用户</h2>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="j_group" class="col-sm-2 control-label">管理用户<span class="red-fonts"> *</span></label>
|
|
|
|
|
<div class="col-sm-8">
|
|
|
|
|
<label for="j_group" class="col-sm-2 control-label">管理用户</label>
|
|
|
|
|
<div class="col-sm-9">
|
|
|
|
|
<div class="radio i-checks">
|
|
|
|
|
<label><input type="radio" checked="checked" id="id_use_default_auth" name="use_default_auth"><span>使用预定义管理用户</span></label>
|
|
|
|
|
<label><input type="radio" checked="checked" id="id_use_default_auth" name="use_default_auth"><span>自定义</span></label>
|
|
|
|
|
<label><input type="radio" id="id_use_default_auth" name="use_default_auth"><span>自定义</span></label>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<p class="col-sm-offset-2">Tips: 管理用户是服务器存在的root或拥有sudo的用户,用来推送系统用户</p>
|
|
|
|
|
<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">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<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">
|
|
|
|
|
<div class="form-group" id="id_port">
|
|
|
|
|
<div class="col-sm-offset-2 col-sm-9">
|
|
|
|
|
<input type="text" placeholder="请选择管理用户" name="manager_user" class="form-control">
|
|
|
|
|
</div>
|
|
|
|
|
</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="" value="1" name="is_active">激活 </label>
|
|
|
|
|
<label> <input type="radio" value="0" name="is_active"> 禁用</label>
|
|
|
|
|
</div>
|
|
|
|
|
<p class="col-sm-offset-2">Tips: 管理用户是服务器存在的root或拥有sudo的用户,用来推送系统用户</p>
|
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<div class="hr-line-dashed"></div>
|
|
|
|
|
<label for="system_user" class="col-sm-2 control-label">系统用户</label>
|
|
|
|
|
<div class="col-sm-9">
|
|
|
|
|
<input type="text" placeholder="" name="system_user" class="form-control">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="hr-line-dashed"></div>
|
|
|
|
|
<h2>所属</h2>
|
|
|
|
|
{{ form.idc|bootstrap_horizontal }}
|
|
|
|
|
|
|
|
|
|
<div class="hr-line-dashed"></div>
|
|
|
|
|
{{ form.group|bootstrap_horizontal }}
|
|
|
|
|
|
|
|
|
|
<div class="hr-line-dashed"></div>
|
|
|
|
|
<h2>标签</h2>
|
|
|
|
|
|
|
|
|
|
<div class="hr-line-dashed"></div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<div class="col-sm-4 col-sm-offset-2">
|
|
|
|
|
<div class="col-sm-4 col-sm-offset-5">
|
|
|
|
|
<button class="btn btn-white" type="reset"> 重置 </button>
|
|
|
|
|
<button class="btn btn-primary" type="submit"> 提交 </button>
|
|
|
|
|
</div>
|
|
|
|
@ -162,7 +139,7 @@
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var required_fields = ["id_hostname", "id_port"];
|
|
|
|
|
var required_fields = ["id_ip", "id_hostname", "id_port"];
|
|
|
|
|
required_fields.forEach(function(field) {
|
|
|
|
|
$('label[for="' + field + '"]').parent().addClass("required");
|
|
|
|
|
});
|
|
|
|
|