gocron/templates/host/index.html

102 lines
3.1 KiB
HTML
Raw Normal View History

{{{ template "common/header" . }}}
<div class="ui grid">
<!--the vertical menu-->
{{{ template "host/menu" . }}}
<div class="twelve wide column">
<div class="pageHeader">
<div class="segment">
<h3 class="ui dividing header">
<i class="large add icon"></i>
<div class="content">
添加主机
</div>
</h3>
</div>
</div>
<table class="ui single line table">
<thead>
<tr>
<th>主机名</th>
<th>别名</th>
<th>用户名</th>
<th>密码</th>
<th>端口</th>
<th>认证方式</th>
<th>备注</th>
</tr>
</thead>
<tbody>
{{{range $i, $v := .Hosts}}}
<tr>
<td>{{{.Name}}}</td>
<td>{{{.Alias}}}</td>
<td>{{{.Username}}}</td>
<td>{{{.Password}}}</td>
<td>{{{.Port}}}</td>
<td>{{{.LoginType}}}</td>
<td>{{{.Remark}}}</td>
</tr>
{{{end}}}
</tbody>
</table>
</div>
<!--the newDevice form-->
</div>
<script type="text/javascript">
$('.ui.form').form(
{
onSuccess: function(event, fields) {
var util = new Util();
util.post('/host/store', fields, function(code, message) {
location.reload();
});
return false;
},
fields: {
name: {
identifier : 'name',
rules: [
{
type : 'empty',
prompt : '请输入主机名'
}
]
},
alias: {
identifier : 'alias',
rules: [
{
type : 'empty',
prompt : '请输入主机别名'
}
]
},
username: {
identifier : 'username',
rules: [
{
type : 'empty',
prompt : '请输入SSH用户名'
}
]
},
port: {
identifier : 'port',
rules: [
{
type : 'integer',
prompt : '请输入SSH端口'
}
]
}
},
inline : true
});
</script>
{{{ template "common/footer" . }}}