mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
204 lines
9.6 KiB
204 lines
9.6 KiB
10 years ago
|
{% extends 'base.html' %}
|
||
|
{% block content %}
|
||
10 years ago
|
{% 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">
|
||
10 years ago
|
<div class="text-center">
|
||
|
<span>请选择添加内容: </span>
|
||
10 years ago
|
<a href="#" class="btn btn-xs btn-primary" id="addhost">添加主机</a>
|
||
|
<a href="#" class="btn btn-xs btn-primary" id="addidc">添加IDC</a>
|
||
|
<a href="#" class="btn btn-xs btn-primary" id="addbis">添加业务组</a>
|
||
10 years ago
|
</div>
|
||
|
<div id="ibox-content" class="ibox-title">
|
||
10 years ago
|
<h5> 填写主机基本信息 </h5>
|
||
|
<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>
|
||
|
<ul class="dropdown-menu dropdown-user">
|
||
|
<li><a href="#">未启用 1</a>
|
||
|
</li>
|
||
|
<li><a href="#">未启用 2</a>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<a class="close-link">
|
||
|
<i class="fa fa-times"></i>
|
||
|
</a>
|
||
10 years ago
|
</div>
|
||
10 years ago
|
</div>
|
||
|
|
||
10 years ago
|
<div class="ibox-content">
|
||
10 years ago
|
{% if emg %}
|
||
|
<div class="alert alert-warning text-center">{{ emg }}</div>
|
||
|
{% endif %}
|
||
10 years ago
|
{% if smg %}
|
||
|
<div class="alert alert-success text-center">{{ smg }}</div>
|
||
|
{% endif %}
|
||
|
<form id="assetForm" method="post" class="form-horizontal">
|
||
10 years ago
|
<div class="form-group"><label class="col-sm-2 control-label"> IP地址 </label>
|
||
10 years ago
|
<div class="col-sm-8"><input type="text" name="j_ip" placeholder="192.168.1.1" class="form-control"></div>
|
||
10 years ago
|
</div>
|
||
10 years ago
|
|
||
10 years ago
|
<div class="hr-line-dashed"></div>
|
||
|
<div class="form-group"><label class="col-sm-2 control-label"> 端口号 </label>
|
||
10 years ago
|
<div class="col-sm-8"><input type="text" placeholder="22" name="j_port" class="form-control"></div>
|
||
10 years ago
|
</div>
|
||
|
|
||
10 years ago
|
<div class="hr-line-dashed"></div>
|
||
|
<div class="form-group"><label class="col-sm-2 control-label"> 登录方式 </label>
|
||
|
<div class="col-sm-8">
|
||
10 years ago
|
<div class="radio i-checks"><label> <input type="radio" id="L" checked="" value="L" name="j_type" onclick="show(this)"> <i> LDAP </i></label></div>
|
||
|
<div class="radio i-checks"><label> <input type="radio" id="S" value="S" name="j_type" onclick="show(this)"> <i> SSH_KEY </i></label></div>
|
||
|
<div class="radio i-checks"><label> <input type="radio" id="P" value="P" name="j_type" onclick="show(this)"> <i> PASSWORD </i></label></div>
|
||
|
<div class="radio i-checks"><label> <input type="radio" id="M" value="M" name="j_type" onclick="show(this)"> <i> MAP </i></label></div>
|
||
10 years ago
|
</div>
|
||
|
|
||
10 years ago
|
<div name="a1" id=a1 style="display:none;">
|
||
|
<div class="form-group"><label class="col-sm-2 col-sm-offset-1 control-label"> 普通用户名 </label>
|
||
10 years ago
|
<div class="col-sm-6"><input type="text" name="j_user" placeholder="lilei" class="form-control"></div>
|
||
10 years ago
|
</div>
|
||
10 years ago
|
|
||
10 years ago
|
<div class="hr-line-dashed"></div>
|
||
|
<div class="form-group"><label class="col-sm-2 col-sm-offset-1 control-label"> 普通用户密码 </label>
|
||
10 years ago
|
<div class="col-sm-6"><input type="password" name="j_password" placeholder="Password" class="form-control"></div>
|
||
10 years ago
|
</div>
|
||
10 years ago
|
|
||
10 years ago
|
<div class="hr-line-dashed"></div>
|
||
|
<div class="form-group"><label class="col-sm-2 col-sm-offset-1 control-label"> 超管用户名 </label>
|
||
10 years ago
|
<div class="col-sm-6"><input type="text" name="j_root" placeholder="root" class="form-control"></div>
|
||
10 years ago
|
</div>
|
||
10 years ago
|
|
||
10 years ago
|
<div class="hr-line-dashed"></div>
|
||
|
<div class="form-group"><label class="col-sm-2 col-sm-offset-1 control-label"> 超管用户密码 </label>
|
||
10 years ago
|
<div class="col-sm-6"><input type="password" name="j_passwd" placeholder="Password" class="form-control"></div>
|
||
10 years ago
|
</div>
|
||
10 years ago
|
|
||
10 years ago
|
</div>
|
||
|
</div>
|
||
10 years ago
|
|
||
10 years ago
|
<div class="hr-line-dashed"></div>
|
||
|
<div class="form-group">
|
||
|
<label for="j_idc" class="col-lg-2 control-label"> 所属IDC </label>
|
||
|
<div class="col-sm-8">
|
||
|
<select id="j_idc" name="j_idc" class="form-control m-b">
|
||
|
{% for i in eidc %}
|
||
|
<option> {{ i }} </option>
|
||
|
{% endfor %}
|
||
|
</select>
|
||
|
</div>
|
||
10 years ago
|
</div>
|
||
|
|
||
10 years ago
|
<div class="hr-line-dashed"></div>
|
||
|
<div class="form-group">
|
||
|
<label for="j_group" class="col-sm-2 control-label"> 所属业务组 </label>
|
||
|
<div class="col-sm-8">
|
||
|
{% for g in egroup %}
|
||
|
<label class="checkbox-inline"><input type="checkbox" id="j_group" value="{{ g }}" name="j_group"> {{ g }} </label>
|
||
|
{% endfor %}
|
||
|
</div>
|
||
|
</div>
|
||
10 years ago
|
|
||
10 years ago
|
<div class="hr-line-dashed"></div>
|
||
|
<div class="form-group"><label class="col-sm-2 control-label"> 是否激活 </label>
|
||
|
<div class="col-sm-8">
|
||
10 years ago
|
<div class="radio i-checks"><label> <input type="radio" checked="" value="1" name="j_active"> <i> 激活 </i></label></div>
|
||
|
<div class="radio i-checks"><label> <input type="radio" value="0" name="j_active"> <i> 禁用 </i></label></div>
|
||
10 years ago
|
</div>
|
||
|
</div>
|
||
10 years ago
|
|
||
10 years ago
|
<div class="hr-line-dashed"></div>
|
||
|
<div class="form-group"><label class="col-sm-2 control-label"> 备注 </label>
|
||
10 years ago
|
<div class="col-sm-8"><input type="text" placeholder="hadoop01" name="j_comment" class="form-control"></div>
|
||
10 years ago
|
</div>
|
||
10 years ago
|
|
||
10 years ago
|
<div class="hr-line-dashed"></div>
|
||
|
<div class="form-group">
|
||
|
<div class="col-sm-4 col-sm-offset-5">
|
||
10 years ago
|
<!--<button class="btn btn-white" type="submit"> 重置 </button>-->
|
||
10 years ago
|
<button class="btn btn-primary" type="submit"> 提交 </button>
|
||
|
</div>
|
||
10 years ago
|
</div>
|
||
10 years ago
|
</form>
|
||
|
</div>
|
||
10 years ago
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<script>
|
||
10 years ago
|
var showFlag={};
|
||
10 years ago
|
function show(o){
|
||
|
showFlag[o.name]=o.value;
|
||
10 years ago
|
if(showFlag.j_type=="M"){
|
||
10 years ago
|
document.getElementById("a1").style.display="";
|
||
|
}
|
||
|
else{
|
||
|
document.getElementById("a1").style.display="none";
|
||
|
}};
|
||
10 years ago
|
$('#assetForm').validator({
|
||
10 years ago
|
timely: 2,
|
||
|
theme: "yellow_right_effect",
|
||
|
rules: {
|
||
10 years ago
|
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}$/, '端口号不正确'],
|
||
|
type_m: function(element){
|
||
|
return $("#M").is(":checked");
|
||
|
}
|
||
10 years ago
|
},
|
||
|
fields: {
|
||
|
"j_ip": {
|
||
|
rule: "required;check_ip",
|
||
10 years ago
|
tip: "输入IP",
|
||
|
ok: "",
|
||
10 years ago
|
msg: {required: "必须填写!"}
|
||
|
},
|
||
|
"j_port": {
|
||
|
rule: "required;check_port",
|
||
10 years ago
|
tip: "输入端口号",
|
||
|
ok: "",
|
||
10 years ago
|
msg: {required: "必须填写!"}
|
||
|
},
|
||
10 years ago
|
"j_group": {
|
||
|
rule: "required",
|
||
|
tip: "选择业务组",
|
||
10 years ago
|
ok: "",
|
||
10 years ago
|
msg: {required: "至少选择一个组"}
|
||
|
},
|
||
|
"j_user": {
|
||
|
rule: "required(type_m)",
|
||
|
tip: "普通用户名",
|
||
|
ok: "",
|
||
|
msg: {required: "请填写用户名"}
|
||
|
},
|
||
|
"j_password": {
|
||
|
rule: "required(type_m);length[6~16]",
|
||
|
tip: "密码6-16位",
|
||
|
ok: "",
|
||
|
msg: {required: "6-16位"}
|
||
|
},
|
||
|
"j_root": {
|
||
|
rule: "required(type_m)",
|
||
|
tip: "超管用户名",
|
||
|
ok: "",
|
||
|
msg: {required: "请填写用户名"}
|
||
10 years ago
|
},
|
||
10 years ago
|
"j_passwd": {
|
||
|
rule: "required(type_m);length[6~16]",
|
||
|
tip: "密码6-16位",
|
||
|
ok: "",
|
||
|
msg: {required: "6-16位"}
|
||
10 years ago
|
}
|
||
|
},
|
||
|
valid: function(form) {
|
||
10 years ago
|
form.submit();
|
||
10 years ago
|
}
|
||
|
});
|
||
|
|
||
10 years ago
|
</script>
|
||
|
|
||
|
{% endblock %}
|