gocron/templates/host/index.html

69 lines
2.1 KiB
HTML
Raw Normal View History

{{{ template "common/header" . }}}
<div class="ui grid">
{{{ template "host/menu" . }}}
<div class="twelve wide column">
<div class="pageHeader">
<div class="segment">
<h3 class="ui dividing header">
2017-04-09 09:55:55 +00:00
<i class="linux icon"></i>
<div class="content">
2017-04-09 09:55:55 +00:00
主机列表
</div>
</h3>
</div>
</div>
2017-04-14 10:05:34 +00:00
<table class="ui striped table">
<thead>
<tr>
<th>主机名</th>
<th>别名</th>
<th>用户名</th>
<th>端口</th>
2017-04-20 01:36:42 +00:00
<th>任务数量</th>
<th>备注</th>
2017-04-13 09:35:59 +00:00
<th>操作</th>
</tr>
</thead>
<tbody>
{{{range $i, $v := .Hosts}}}
<tr>
<td>{{{.Name}}}</td>
<td>{{{.Alias}}}</td>
<td>{{{.Username}}}</td>
<td>{{{.Port}}}</td>
2017-04-20 01:36:42 +00:00
<td></td>
<td>{{{.Remark}}}</td>
<td class="operation">
2017-04-20 01:36:42 +00:00
<a class="ui purple button" href="/host/edit/{{{.Id}}}">编辑</a>
2017-04-14 10:05:34 +00:00
<button class="ui positive button" onclick="util.removeConfirm('/host/remove/{{{.Id}}}')">删除</button>
2017-04-20 01:36:42 +00:00
<button class="ui blue button" @click="ping({{{.Id}}})">连接测试</button>
2017-04-14 10:05:34 +00:00
</td>
</tr>
{{{end}}}
</tbody>
</table>
</div>
</div>
2017-04-20 01:36:42 +00:00
<script type="text/javascript">
var Vue = new Vue({
el: '.ui.striped.table',
2017-04-20 01:36:42 +00:00
methods: {
ping: function(id) {
swal({
title: '',
text: "连接中.......",
type: 'info',
showConfirmButton: false
2017-04-20 01:36:42 +00:00
});
util.get("/host/ping/" + id, function(code, message) {
swal('操作成功', '连接成功', 'success');
})
}
}
});
</script>
{{{ template "common/footer" . }}}