2017-04-08 09:15:30 +00:00
|
|
|
{{{ 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-23 06:11:53 +00:00
|
|
|
<a href="/host/create">
|
|
|
|
<i class="large add icon"></i>
|
|
|
|
<div class="content">
|
|
|
|
添加主机
|
|
|
|
</div>
|
|
|
|
</a>
|
2017-04-08 09:15:30 +00:00
|
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-04-22 15:39:33 +00:00
|
|
|
<form class="ui form">
|
|
|
|
<div class="three fields">
|
|
|
|
<div class="field">
|
|
|
|
<input type="text" placeholder="ID" name="id" value="{{{if gt .Params.Id 0}}}{{{.Params.Id}}}{{{end}}}">
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<input type="text" placeholder="主机名" name="name" value="{{{.Params.Name}}}">
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<button class="ui linkedin submit button">搜索</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
2017-04-14 10:05:34 +00:00
|
|
|
<table class="ui striped table">
|
2017-04-08 09:15:30 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
2017-04-22 15:39:33 +00:00
|
|
|
<th>ID</th>
|
2017-04-08 09:15:30 +00:00
|
|
|
<th>主机名</th>
|
|
|
|
<th>别名</th>
|
|
|
|
<th>用户名</th>
|
|
|
|
<th>端口</th>
|
|
|
|
<th>备注</th>
|
2017-04-13 09:35:59 +00:00
|
|
|
<th>操作</th>
|
2017-04-08 09:15:30 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{{{range $i, $v := .Hosts}}}
|
|
|
|
<tr>
|
2017-04-22 15:39:33 +00:00
|
|
|
<td>{{{.Id}}}</td>
|
2017-04-08 09:15:30 +00:00
|
|
|
<td>{{{.Name}}}</td>
|
|
|
|
<td>{{{.Alias}}}</td>
|
|
|
|
<td>{{{.Username}}}</td>
|
|
|
|
<td>{{{.Port}}}</td>
|
|
|
|
<td>{{{.Remark}}}</td>
|
2017-04-21 02:17:03 +00:00
|
|
|
<td class="operation">
|
2017-04-20 01:36:42 +00:00
|
|
|
<a class="ui purple button" href="/host/edit/{{{.Id}}}">编辑</a>
|
2017-04-21 09:41:59 +00:00
|
|
|
<button class="ui positive button" onclick="util.removeConfirm('/host/remove/{{{.Id}}}')">删除</button><br>
|
|
|
|
<div style="margin-top: 5px;">
|
|
|
|
<a class="ui twitter button" href="/task?host_id={{{.Id}}}">查看任务</a>
|
|
|
|
<button class="ui blue button" @click="ping({{{.Id}}})">连接测试</button>
|
|
|
|
</div>
|
2017-04-14 10:05:34 +00:00
|
|
|
</td>
|
2017-04-08 09:15:30 +00:00
|
|
|
</tr>
|
|
|
|
{{{end}}}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2017-04-23 06:11:53 +00:00
|
|
|
{{{ template "common/pagination" .}}}
|
2017-04-08 09:15:30 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2017-04-20 01:36:42 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
var Vue = new Vue({
|
2017-04-21 02:17:03 +00:00
|
|
|
el: '.ui.striped.table',
|
2017-04-20 01:36:42 +00:00
|
|
|
methods: {
|
|
|
|
ping: function(id) {
|
|
|
|
swal({
|
|
|
|
title: '',
|
|
|
|
text: "连接中.......",
|
|
|
|
type: 'info',
|
2017-04-21 02:17:03 +00:00
|
|
|
showConfirmButton: false
|
2017-04-20 01:36:42 +00:00
|
|
|
});
|
|
|
|
util.get("/host/ping/" + id, function(code, message) {
|
|
|
|
swal('操作成功', '连接成功', 'success');
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2017-04-08 09:15:30 +00:00
|
|
|
{{{ template "common/footer" . }}}
|