2017-04-08 09:15:30 +00:00
|
|
|
{{{ template "common/header" . }}}
|
|
|
|
|
|
|
|
<div class="ui grid">
|
|
|
|
{{{template "task/menu" .}}}
|
|
|
|
<div class="twelve wide column">
|
|
|
|
<div class="pageHeader">
|
|
|
|
<div class="segment">
|
|
|
|
<h3 class="ui dividing header">
|
|
|
|
<i class="tasks icon"></i>
|
|
|
|
<div class="content">
|
|
|
|
任务列表
|
|
|
|
</div>
|
|
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-04-13 09:35:59 +00:00
|
|
|
<table class="ui violet table">
|
2017-04-08 09:15:30 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>任务名称</th>
|
|
|
|
<th>cron表达式</th>
|
|
|
|
<th>协议</th>
|
2017-04-13 09:35:59 +00:00
|
|
|
<th width="5%">命令</th>
|
2017-04-08 09:15:30 +00:00
|
|
|
<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 := .Tasks}}}
|
|
|
|
<tr>
|
2017-04-13 09:35:59 +00:00
|
|
|
<td>{{{.Task.Name}}}</td>
|
2017-04-08 09:15:30 +00:00
|
|
|
<td>{{{.Spec}}}</td>
|
2017-04-13 09:35:59 +00:00
|
|
|
<td>{{{if eq .Protocol 1}}} HTTP {{{else}}} SSH {{{end}}}</td>
|
2017-04-08 09:15:30 +00:00
|
|
|
<td>{{{.Command}}}</td>
|
|
|
|
<td>{{{.Timeout}}}</td>
|
2017-04-13 09:35:59 +00:00
|
|
|
<td>{{{.Alias}}}</td>
|
2017-04-08 09:15:30 +00:00
|
|
|
<td>{{{.Remark}}}</td>
|
2017-04-13 09:35:59 +00:00
|
|
|
<td>{{{if eq .Status 1}}}<i class="large checkmark blue icon"></i> {{{else}}} <i class="large red minus icon"></i> {{{end}}}</td>
|
|
|
|
<td>
|
2017-04-17 10:04:30 +00:00
|
|
|
<a class="ui purple button" href="/task/edit/{{{.Id}}}">编辑</a>
|
2017-04-13 09:35:59 +00:00
|
|
|
{{{if eq .Status 1}}}
|
|
|
|
<button class="ui primary button" onclick="changeStatus({{{.Id}}},{{{.Status}}})">暂停</button>
|
|
|
|
{{{else}}}
|
|
|
|
<button class="ui blue button" onclick="changeStatus({{{.Id}}},{{{.Status}}})">激活 </button>
|
|
|
|
{{{end}}}
|
|
|
|
<button class="ui positive button" onclick="util.removeConfirm('/task/remove/{{{.Id}}}')">删除</button>
|
2017-04-20 01:36:42 +00:00
|
|
|
<button class="ui instagram button">查看日志</button>
|
2017-04-13 09:35:59 +00:00
|
|
|
</td>
|
2017-04-08 09:15:30 +00:00
|
|
|
</tr>
|
|
|
|
{{{end}}}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
2017-04-10 09:37:16 +00:00
|
|
|
$('.ui.checkbox').checkbox();
|
2017-04-13 09:35:59 +00:00
|
|
|
|
|
|
|
function changeStatus(id ,status) {
|
|
|
|
var url = '';
|
|
|
|
if (status) {
|
|
|
|
url = '/task/disable';
|
|
|
|
} else {
|
|
|
|
url = '/task/enable';
|
|
|
|
}
|
|
|
|
url += '/' + id;
|
|
|
|
util.post(url,{}, function() {
|
|
|
|
location.reload();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-04-08 09:15:30 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
{{{ template "common/footer" . }}}
|