修复#2号bug-激活状态无法编辑任务,需要先暂停任务
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
PPGo_Job
|
||||
@@ -149,6 +149,10 @@ func (this *TaskController) Edit() {
|
||||
this.showMsg(err.Error())
|
||||
}
|
||||
|
||||
if task.Status != 0 {
|
||||
this.ajaxMsg("激活状态无法编辑任务,请先暂停任务", MSG_ERR)
|
||||
}
|
||||
|
||||
if this.isPost() {
|
||||
task.TaskName = strings.TrimSpace(this.GetString("task_name"))
|
||||
task.Description = strings.TrimSpace(this.GetString("description"))
|
||||
|
||||
@@ -91,14 +91,21 @@
|
||||
<a class="btn btn-danger btn-xs" href="{{urlfor "TaskController.Start"}}?id={{$v.id}}">
|
||||
<span class="glyphicon glyphicon-expand" aria-hidden="true"></span> 激活
|
||||
</a>
|
||||
{{else}}
|
||||
{{else}}
|
||||
<a class="btn btn-success btn-xs" href="{{urlfor "TaskController.Pause"}}?id={{$v.id}}">
|
||||
<span class="glyphicon glyphicon-pause" aria-hidden="true"></span> 暂停
|
||||
</a>
|
||||
{{end}}
|
||||
<a class="btn btn-info btn-xs" href="{{urlfor "TaskController.Edit"}}?id={{$v.id}}">
|
||||
{{end}}
|
||||
{{if eq $v.status 0}}
|
||||
<a class="btn btn-info btn-xs" href="{{urlfor "TaskController.Edit"}}?id={{$v.id}}">
|
||||
<span class="glyphicon glyphicon-edit" aria-hidden="true"></span> 编辑
|
||||
</a>
|
||||
{{else}}
|
||||
<a class="btn btn-default btn-xs" href="javascript:return alert('激活状态无法编辑任务,请先暂停任务');">
|
||||
<span class="glyphicon glyphicon-edit" aria-hidden="true"></span> 编辑
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
<a class="btn btn-info btn-run btn-xs" href="{{urlfor "TaskController.Run"}}?id={{$v.id}}">
|
||||
<span class="glyphicon glyphicon-flash" aria-hidden="true"></span> 执行
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user