From f986ecf5519f94e35028b0fb5e0c1bbe0d8c8f86 Mon Sep 17 00:00:00 2001 From: george Date: Mon, 6 Aug 2018 10:08:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BC=82=E5=B8=B8log?= =?UTF-8?q?=E7=9A=84=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/task_log.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/controllers/task_log.go b/controllers/task_log.go index 033008e..c8cf3b7 100644 --- a/controllers/task_log.go +++ b/controllers/task_log.go @@ -58,6 +58,7 @@ func (self *TaskLogController) Table() { TextStatus := []string{ " 错误", " 正常", + " 未知", } Status, err := self.GetInt("status") @@ -79,6 +80,9 @@ func (self *TaskLogController) Table() { row["process_time"] = float64(v.ProcessTime) / 1000 row["ouput_size"] = libs.SizeFormat(float64(len(v.Output))) index := v.Status + 1 + if index > 1 { + index = 2 + } row["status"] = TextStatus[index] list[k] = row @@ -99,6 +103,7 @@ func (self *TaskLogController) Detail() { LogTextStatus := []string{ " 错误", " 正常", + " 未知", } row := make(map[string]interface{}) row["id"] = tasklog.Id @@ -110,6 +115,9 @@ func (self *TaskLogController) Detail() { row["error"] = tasklog.Error index := tasklog.Status + 1 + if index > 1 { + index = 2 + } row["status"] = LogTextStatus[index] self.Data["taskLog"] = row