mirror of https://github.com/ouqiang/gocron
编辑任务-主机名默认选中
parent
5ab787dff5
commit
f57561118d
|
@ -45,11 +45,10 @@ func Edit(ctx *macaron.Context) {
|
|||
}
|
||||
taskModel := new(models.Task)
|
||||
task, err := taskModel.Detail(id)
|
||||
if err != nil {
|
||||
if err != nil || taskModel.Id != id {
|
||||
logger.Errorf("编辑任务#获取任务详情失败#任务ID-%d#%s", id, err.Error())
|
||||
ctx.Redirect("/task")
|
||||
}
|
||||
ctx.Data["TaskId"] = id
|
||||
ctx.Data["Task"] = task
|
||||
ctx.Data["Title"] = "编辑"
|
||||
ctx.Data["Hosts"] = hosts
|
||||
|
|
|
@ -36,7 +36,9 @@
|
|||
<td>{{{.Port}}}</td>
|
||||
<td>{{{.Remark}}}</td>
|
||||
<td>
|
||||
<button class="ui pink button" >编辑</button>
|
||||
<button class="ui positive button" onclick="util.removeConfirm('/host/remove/{{{.Id}}}')">删除</button>
|
||||
<button class="ui pink button" >连接测试</button>
|
||||
<button class="ui pink button" >查看任务</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
<div class="ui radio checkbox">
|
||||
{{{if $.Task}}}
|
||||
<input type="radio" name="host_id" tabindex="0" class="hidden" value="{{{.Id}}}"
|
||||
{{{if and .Task (eq $.TaskId .Id)}}} checked {{{end}}}
|
||||
{{{if eq $.Task.HostId .Id}}} checked {{{end}}}
|
||||
>
|
||||
{{{else}}}
|
||||
<input type="radio" name="host_id" tabindex="0" class="hidden">
|
||||
|
|
Loading…
Reference in New Issue