From 05e5e457527e9de4f31eecc082f201eca4a0c34f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E5=A4=A7=E5=85=A8?= Date: Fri, 1 Dec 2017 10:59:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D#2=E5=8F=B7bug-=E6=BF=80?= =?UTF-8?q?=E6=B4=BB=E7=8A=B6=E6=80=81=E6=97=A0=E6=B3=95=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=EF=BC=8C=E9=9C=80=E8=A6=81=E5=85=88=E6=9A=82?= =?UTF-8?q?=E5=81=9C=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ controllers/task.go | 4 ++++ views/task/list.html | 13 ++++++++++--- 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c013cf6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +PPGo_Job diff --git a/controllers/task.go b/controllers/task.go index efb0a72..1c748b8 100644 --- a/controllers/task.go +++ b/controllers/task.go @@ -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")) diff --git a/views/task/list.html b/views/task/list.html index a6a7b50..a771614 100644 --- a/views/task/list.html +++ b/views/task/list.html @@ -91,14 +91,21 @@ 激活 - {{else}} + {{else}} 暂停 - {{end}} - + {{end}} + {{if eq $v.status 0}} + 编辑 + {{else}} + + 编辑 + + {{end}} + 执行