diff --git a/conf/app.conf b/conf/app.conf index d3cec2e..3848531 100644 --- a/conf/app.conf +++ b/conf/app.conf @@ -3,7 +3,7 @@ HTTPPort = 8080 RunMode = dev SessionOn = true -version= V2.5 +version= V2.6 # 允许同时运行的任务数 jobs.pool = 1000 diff --git a/jobs/job.go b/jobs/job.go index cfacc53..5b8a5ac 100644 --- a/jobs/job.go +++ b/jobs/job.go @@ -451,6 +451,7 @@ func (j *Job) Run() { if title != "" { title = strings.Replace(title, "{{TaskId}}", strconv.Itoa(j.task.Id), -1) + title = strings.Replace(title, "{{ServerId}}", strconv.Itoa(j.serverId), -1) title = strings.Replace(title, "{{TaskName}}", j.task.TaskName, -1) title = strings.Replace(title, "{{ExecuteCommand}}", j.task.Command, -1) title = strings.Replace(title, "{{ExecuteTime}}", beego.Date(time.Unix(log.CreateTime, 0), "Y-m-d H:i:s"), -1) @@ -462,6 +463,7 @@ func (j *Job) Run() { if content != "" { content = strings.Replace(content, "{{TaskId}}", strconv.Itoa(j.task.Id), -1) + content = strings.Replace(content, "{{ServerId}}", strconv.Itoa(j.serverId), -1) content = strings.Replace(content, "{{TaskName}}", j.task.TaskName, -1) content = strings.Replace(content, "{{ExecuteCommand}}", j.task.Command, -1) content = strings.Replace(content, "{{ExecuteTime}}", beego.Date(time.Unix(log.CreateTime, 0), "Y-m-d H:i:s"), -1) diff --git a/notify/dingtalk.go b/notify/dingtalk.go index 7f3e05f..9e841a3 100644 --- a/notify/dingtalk.go +++ b/notify/dingtalk.go @@ -8,13 +8,13 @@ package notify import ( + "bytes" + "encoding/json" + "fmt" "github.com/astaxie/beego" "github.com/george518/PPGo_Job/libs" "log" "time" - "fmt" - "encoding/json" - "bytes" ) type Dingtalk struct { @@ -41,6 +41,7 @@ func init() { } if err := m.SendDingtalk(); err != nil { beego.Error("SendDingtalk:", err.Error()) + } } } diff --git a/views/notifytpl/add.html b/views/notifytpl/add.html index c70ef52..4432b97 100644 --- a/views/notifytpl/add.html +++ b/views/notifytpl/add.html @@ -40,6 +40,7 @@
 
   {{"任务 ID {{TaskId}}"}}
+  {{"资源 ID {{ServerId}}"}}
   {{"任务名称 {{TaskName}}"}}
   {{"执行命令 {{ExecuteCommand}}"}}
   {{"执行时间 {{ExecuteTime}}"}}
diff --git a/views/notifytpl/edit.html b/views/notifytpl/edit.html
index 5978a11..db916e7 100644
--- a/views/notifytpl/edit.html
+++ b/views/notifytpl/edit.html
@@ -41,6 +41,7 @@
                 
 
   {{"任务 ID {{TaskId}}"}}
+  {{"资源 ID {{ServerId}}"}}
   {{"任务名称 {{TaskName}}"}}
   {{"执行命令 {{ExecuteCommand}}"}}
   {{"执行时间 {{ExecuteTime}}"}}
diff --git a/views/public/main.html b/views/public/main.html
index e55badd..c6c6d5e 100644
--- a/views/public/main.html
+++ b/views/public/main.html
@@ -84,7 +84,7 @@
 
     
 
 
diff --git a/views/task/detail.html b/views/task/detail.html
index 7f0ebca..41baa9f 100644
--- a/views/task/detail.html
+++ b/views/task/detail.html
@@ -25,6 +25,7 @@
         
         
         
+        
     
 
     
@@ -150,6 +151,7 @@
+ @@ -64,7 +64,7 @@ ,{field:'next_time', width:170,title: '下次执行时间'} ,{field:'pre_time', title: '上次执行时间'} ,{field:'execute_times', title: '次数'} - ,{fixed: 'right', width:150, align:'center', title:'操作', toolbar: '#bar'} + ,{width:120, align:'center', title:'操作', toolbar: '#bar'} ]] ,id: 'listReload' ,page: true