2017-04-07 01:13:36 +00:00
|
|
|
{{{ template "common/header" . }}}
|
|
|
|
|
|
|
|
<div class="ui grid">
|
|
|
|
{{{ template "host/menu" . }}}
|
|
|
|
|
|
|
|
<div class="twelve wide column">
|
2017-04-07 09:26:46 +00:00
|
|
|
<div class="pageHeader">
|
|
|
|
<div class="segment">
|
|
|
|
<h3 class="ui dividing header">
|
2017-04-23 06:11:53 +00:00
|
|
|
<div class="content">
|
|
|
|
添加主机
|
|
|
|
</div>
|
2017-04-07 09:26:46 +00:00
|
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-04-07 01:13:36 +00:00
|
|
|
<form class="ui form fluid vertical segment">
|
2017-04-20 01:36:42 +00:00
|
|
|
<input type="hidden" name="id" value="{{{.Host.Id}}}">
|
|
|
|
<div class="four fields">
|
2017-04-07 01:13:36 +00:00
|
|
|
<div class="field">
|
2017-05-26 10:09:07 +00:00
|
|
|
<label>主机名</label>
|
2017-04-23 06:11:53 +00:00
|
|
|
<div class="ui small input">
|
2017-09-05 06:11:18 +00:00
|
|
|
<input type="text" name="name" value="{{{.Host.Name}}}" placeholder="127.0.0.1">
|
2017-04-07 01:13:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
2017-05-26 10:09:07 +00:00
|
|
|
<label>端口</label>
|
2017-04-23 06:11:53 +00:00
|
|
|
<div class="ui small input">
|
2017-05-26 10:09:07 +00:00
|
|
|
<input type="text" name="port" value="{{{.Host.Port}}}" placeholder="5921">
|
2017-04-07 01:13:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
2017-08-06 14:49:24 +00:00
|
|
|
<label>节点名称</label>
|
2017-04-23 06:11:53 +00:00
|
|
|
<div class="ui small input">
|
2017-09-05 06:11:18 +00:00
|
|
|
<input type="text" name="alias" value="{{{.Host.Alias}}}"
|
|
|
|
placeholder="节点名称如web">
|
2017-05-01 05:59:52 +00:00
|
|
|
</div>
|
2017-04-07 01:13:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="two fields">
|
|
|
|
<div class="field">
|
|
|
|
<label>备注</label>
|
2017-04-23 06:11:53 +00:00
|
|
|
<div class="ui small input">
|
2017-04-20 01:36:42 +00:00
|
|
|
<textarea rows="7" name="remark" >{{{.Host.Remark}}}</textarea>
|
2017-04-07 01:13:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2017-04-17 10:04:30 +00:00
|
|
|
<div class="ui primary submit button">保存</div>
|
2017-10-01 13:49:46 +00:00
|
|
|
<a class="ui button" onclick="location.href='/host';">取消</a>
|
2017-04-07 01:13:36 +00:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
2017-04-22 15:39:33 +00:00
|
|
|
var $uiForm = $('.ui.form');
|
|
|
|
$($uiForm).form(
|
2017-04-07 09:26:46 +00:00
|
|
|
{
|
|
|
|
onSuccess: function(event, fields) {
|
|
|
|
util.post('/host/store', fields, function(code, message) {
|
2017-04-08 09:15:30 +00:00
|
|
|
location.href = "/host"
|
2017-04-07 09:26:46 +00:00
|
|
|
});
|
2017-04-07 01:13:36 +00:00
|
|
|
|
2017-04-07 09:26:46 +00:00
|
|
|
return false;
|
|
|
|
},
|
|
|
|
fields: {
|
|
|
|
name: {
|
|
|
|
identifier : 'name',
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
type : 'empty',
|
|
|
|
prompt : '请输入主机名'
|
2017-05-05 08:31:24 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
type : 'maxLength[64]',
|
|
|
|
prompt : '长度不能超过64'
|
2017-04-07 09:26:46 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
alias: {
|
|
|
|
identifier : 'alias',
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
type : 'empty',
|
|
|
|
prompt : '请输入主机别名'
|
2017-05-05 08:31:24 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
type : 'maxLength[32]',
|
|
|
|
prompt : '长度不能超过32'
|
2017-04-07 09:26:46 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
port: {
|
|
|
|
identifier : 'port',
|
|
|
|
rules: [
|
|
|
|
{
|
2017-04-22 15:39:33 +00:00
|
|
|
type : 'integer[1..65535]',
|
|
|
|
prompt : '请输入有效的端口号'
|
|
|
|
}
|
|
|
|
]
|
2017-05-05 08:31:24 +00:00
|
|
|
},
|
|
|
|
remark: {
|
|
|
|
identifier : 'remark',
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
type : 'maxLength[100]',
|
|
|
|
prompt : '长度不能超过100'
|
|
|
|
}
|
|
|
|
]
|
2017-04-07 09:26:46 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
inline : true
|
|
|
|
});
|
2017-04-07 01:13:36 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
{{{ template "common/footer" . }}}
|