Pre Merge pull request !36 from venus-suite/master

pull/36/MERGE
venus-suite 4 years ago committed by Gitee
commit 8ab81b91e3

@ -14,7 +14,8 @@ CREATE TABLE `xxl_job_info` (
`add_time` datetime DEFAULT NULL, `add_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL, `update_time` datetime DEFAULT NULL,
`author` varchar(64) DEFAULT NULL COMMENT '作者', `author` varchar(64) DEFAULT NULL COMMENT '作者',
`alarm_email` varchar(255) DEFAULT NULL COMMENT '报警邮件', `alarm_url` varchar(255) DEFAULT NULL COMMENT '报警地址',
`alarm_Type` int(2) NOT NULL DEFAULT '1' COMMENT '报警类型 1邮件 2webhook',
`schedule_type` varchar(50) NOT NULL DEFAULT 'NONE' COMMENT '调度类型', `schedule_type` varchar(50) NOT NULL DEFAULT 'NONE' COMMENT '调度类型',
`schedule_conf` varchar(128) DEFAULT NULL COMMENT '调度配置,值含义取决于调度类型', `schedule_conf` varchar(128) DEFAULT NULL COMMENT '调度配置,值含义取决于调度类型',
`misfire_strategy` varchar(50) NOT NULL DEFAULT 'DO_NOTHING' COMMENT '调度过期策略', `misfire_strategy` varchar(50) NOT NULL DEFAULT 'DO_NOTHING' COMMENT '调度过期策略',
@ -114,7 +115,7 @@ CREATE TABLE `xxl_job_lock` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `xxl_job_group`(`id`, `app_name`, `title`, `address_type`, `address_list`, `update_time`) VALUES (1, 'xxl-job-executor-sample', '示例执行器', 0, NULL, '2018-11-03 22:21:31' ); INSERT INTO `xxl_job_group`(`id`, `app_name`, `title`, `address_type`, `address_list`, `update_time`) VALUES (1, 'xxl-job-executor-sample', '示例执行器', 0, NULL, '2018-11-03 22:21:31' );
INSERT INTO `xxl_job_info`(`id`, `job_group`, `job_desc`, `add_time`, `update_time`, `author`, `alarm_email`, `schedule_type`, `schedule_conf`, `misfire_strategy`, `executor_route_strategy`, `executor_handler`, `executor_param`, `executor_block_strategy`, `executor_timeout`, `executor_fail_retry_count`, `glue_type`, `glue_source`, `glue_remark`, `glue_updatetime`, `child_jobid`) VALUES (1, 1, '测试任务1', '2018-11-03 22:21:31', '2018-11-03 22:21:31', 'XXL', '', 'CRON', '0 0 0 * * ? *', 'DO_NOTHING', 'FIRST', 'demoJobHandler', '', 'SERIAL_EXECUTION', 0, 0, 'BEAN', '', 'GLUE代码初始化', '2018-11-03 22:21:31', ''); INSERT INTO `xxl_job_info`(`id`, `job_group`, `job_desc`, `add_time`, `update_time`, `author`, `alarm_url`, `schedule_type`, `schedule_conf`, `misfire_strategy`, `executor_route_strategy`, `executor_handler`, `executor_param`, `executor_block_strategy`, `executor_timeout`, `executor_fail_retry_count`, `glue_type`, `glue_source`, `glue_remark`, `glue_updatetime`, `child_jobid`) VALUES (1, 1, '测试任务1', '2018-11-03 22:21:31', '2018-11-03 22:21:31', 'XXL', '', 'CRON', '0 0 0 * * ? *', 'DO_NOTHING', 'FIRST', 'demoJobHandler', '', 'SERIAL_EXECUTION', 0, 0, 'BEAN', '', 'GLUE代码初始化', '2018-11-03 22:21:31', '');
INSERT INTO `xxl_job_user`(`id`, `username`, `password`, `role`, `permission`) VALUES (1, 'admin', 'e10adc3949ba59abbe56e057f20f883e', 1, NULL); INSERT INTO `xxl_job_user`(`id`, `username`, `password`, `role`, `permission`) VALUES (1, 'admin', 'e10adc3949ba59abbe56e057f20f883e', 1, NULL);
INSERT INTO `xxl_job_lock` ( `lock_name`) VALUES ( 'schedule_lock'); INSERT INTO `xxl_job_lock` ( `lock_name`) VALUES ( 'schedule_lock');

@ -1,5 +1,6 @@
package com.xxl.job.admin.controller; package com.xxl.job.admin.controller;
import com.xxl.job.admin.core.alarm.AlarmTypeEnum;
import com.xxl.job.admin.core.cron.CronExpression; import com.xxl.job.admin.core.cron.CronExpression;
import com.xxl.job.admin.core.exception.XxlJobException; import com.xxl.job.admin.core.exception.XxlJobException;
import com.xxl.job.admin.core.model.XxlJobGroup; import com.xxl.job.admin.core.model.XxlJobGroup;
@ -55,7 +56,7 @@ public class JobInfoController {
model.addAttribute("ExecutorBlockStrategyEnum", ExecutorBlockStrategyEnum.values()); // 阻塞处理策略-字典 model.addAttribute("ExecutorBlockStrategyEnum", ExecutorBlockStrategyEnum.values()); // 阻塞处理策略-字典
model.addAttribute("ScheduleTypeEnum", ScheduleTypeEnum.values()); // 调度类型 model.addAttribute("ScheduleTypeEnum", ScheduleTypeEnum.values()); // 调度类型
model.addAttribute("MisfireStrategyEnum", MisfireStrategyEnum.values()); // 调度过期策略 model.addAttribute("MisfireStrategyEnum", MisfireStrategyEnum.values()); // 调度过期策略
model.addAttribute("AlarmTypeEnum", AlarmTypeEnum.values());
// 执行器列表 // 执行器列表
List<XxlJobGroup> jobGroupList_all = xxlJobGroupDao.findAll(); List<XxlJobGroup> jobGroupList_all = xxlJobGroupDao.findAll();

@ -0,0 +1,47 @@
package com.xxl.job.admin.core.alarm;
import com.xxl.job.admin.core.util.I18nUtil;
/**
* @author tomj2ee 2022-02-20 11:11:23
*/
public enum AlarmTypeEnum {
/**
*
*/
EMAIL(1,I18nUtil.getString("jobinfo_field_email")),
/**
* webhook
*/
WEBHOOK(2,I18nUtil.getString("jobinfo_field_webhook"));
private String title;
private int alarmType;
AlarmTypeEnum(int alarmType,String title) {
this.alarmType=alarmType;
this.title = title;
}
public String getTitle() {
return title;
}
public int getAlarmType() {
return alarmType;
}
public static AlarmTypeEnum match(String name, AlarmTypeEnum defaultItem){
for (AlarmTypeEnum item: AlarmTypeEnum.values()) {
if (item.name().equals(name)) {
return item;
}
}
return defaultItem;
}
}

@ -1,5 +1,6 @@
package com.xxl.job.admin.core.alarm.impl; package com.xxl.job.admin.core.alarm.impl;
import com.xxl.job.admin.core.alarm.AlarmTypeEnum;
import com.xxl.job.admin.core.alarm.JobAlarm; import com.xxl.job.admin.core.alarm.JobAlarm;
import com.xxl.job.admin.core.conf.XxlJobAdminConfig; import com.xxl.job.admin.core.conf.XxlJobAdminConfig;
import com.xxl.job.admin.core.model.XxlJobGroup; import com.xxl.job.admin.core.model.XxlJobGroup;
@ -37,7 +38,7 @@ public class EmailJobAlarm implements JobAlarm {
boolean alarmResult = true; boolean alarmResult = true;
// send monitor email // send monitor email
if (info!=null && info.getAlarmEmail()!=null && info.getAlarmEmail().trim().length()>0) { if (info!=null && info.getAlarmType() == AlarmTypeEnum.EMAIL.getAlarmType() && info.getAlarmUrl()!=null && info.getAlarmUrl().trim().length()>0) {
// alarmContent // alarmContent
String alarmContent = "Alarm Job LogId=" + jobLog.getId(); String alarmContent = "Alarm Job LogId=" + jobLog.getId();
@ -58,7 +59,7 @@ public class EmailJobAlarm implements JobAlarm {
info.getJobDesc(), info.getJobDesc(),
alarmContent); alarmContent);
Set<String> emailSet = new HashSet<String>(Arrays.asList(info.getAlarmEmail().split(","))); Set<String> emailSet = new HashSet<String>(Arrays.asList(info.getAlarmUrl().split(",")));
for (String email: emailSet) { for (String email: emailSet) {
// make mail // make mail

@ -0,0 +1,144 @@
package com.xxl.job.admin.core.alarm.impl;
import com.xxl.job.admin.core.alarm.AlarmTypeEnum;
import com.xxl.job.admin.core.alarm.JobAlarm;
import com.xxl.job.admin.core.alarm.msg.FeiShuTextMsgReq;
import com.xxl.job.admin.core.alarm.msg.TextMsgReq;
import com.xxl.job.admin.core.conf.XxlJobAdminConfig;
import com.xxl.job.admin.core.model.XxlJobGroup;
import com.xxl.job.admin.core.model.XxlJobInfo;
import com.xxl.job.admin.core.model.XxlJobLog;
import com.xxl.job.admin.core.util.I18nUtil;
import com.xxl.job.core.biz.model.ReturnT;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.*;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.client.RestTemplate;
import java.text.MessageFormat;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* job alarm by webhook
*
* @author hcmyfs@163.com 2022-02-20
*/
@Component
public class WebHookJobAlarm implements JobAlarm {
private RestTemplate restTemplate;
private static Logger log = LoggerFactory.getLogger(WebHookJobAlarm.class);
/**
* fail alarm
*
* @param jobLog
*/
@Override
public boolean doAlarm(XxlJobInfo info, XxlJobLog jobLog) {
boolean alarmResult = true;
String br = "\r\n";
restTemplate = new RestTemplate();
// send monitor webhook
if (info != null && info.getAlarmType() == AlarmTypeEnum.WEBHOOK.getAlarmType() &&
info.getAlarmUrl() != null && info.getAlarmUrl().trim().length() > 0) {
// alarmContent
String alarmContent = "Alarm Job LogId=" + jobLog.getId();
if (jobLog.getTriggerCode() != ReturnT.SUCCESS_CODE) {
alarmContent += br + "TriggerMsg=" + br + jobLog.getTriggerMsg();
}
if (jobLog.getHandleCode() > 0 && jobLog.getHandleCode() != ReturnT.SUCCESS_CODE) {
alarmContent += br + "HandleCode=" + jobLog.getHandleMsg();
}
// email info
XxlJobGroup group = XxlJobAdminConfig.getAdminConfig().getXxlJobGroupDao().load(Integer.valueOf(info.getJobGroup()));
//String personal = I18nUtil.getString("admin_name_full");
String title = I18nUtil.getString("jobconf_monitor");
String content = MessageFormat.format(loadEmailJobAlarmTemplate(),
group != null ? group.getTitle() : "null",
info.getId(),
info.getJobDesc(),
alarmContent);
content=content.replace("<br>","\n");
content=content.replace("<span style=\"color:#00c0ef;\" >","");
content=content.replace("</span>","");
Set<String> urlList = new HashSet<String>(Arrays.asList(info.getAlarmUrl().split(",")));
for (String webHookUrl : urlList) {
// make mail
try {
sendRobot(webHookUrl, content, null);
} catch (Exception e) {
log.error(">>>>>>>>>>> xxl-job, job fail alarm webhook send error, JobLogId:{}", jobLog.getId(), e);
alarmResult = false;
}
}
}
return alarmResult;
}
/**
* load webhook job alarm template
*
* @return
*/
private static final String loadEmailJobAlarmTemplate() {
String mailBodyTemplate = I18nUtil.getString("jobconf_monitor_detail") + "\n" +
"" + I18nUtil.getString("jobinfo_field_jobgroup") + ":{0}\n" +
"" + I18nUtil.getString("jobinfo_field_id") + ":{1}\n" +
"" + I18nUtil.getString("jobinfo_field_jobdesc") + ":{2}\n" +
"" + I18nUtil.getString("jobconf_monitor_alarm_title") + ":" + I18nUtil.getString("jobconf_monitor_alarm_type") + "\n" +
"" + I18nUtil.getString("jobconf_monitor_alarm_content") + ":{3}\n";
return mailBodyTemplate;
}
/**
*
*
* @param msg
* @return
*/
public boolean sendRobot(String url, String msg, List<String> usersList) {
if (!StringUtils.hasText(url)) {
log.error("sendRobot url 格式错误!");
throw new RuntimeException("sendRobot url 格式错误!");
}
if (!url.startsWith("http")) {
throw new RuntimeException("sendRobot url 格式错误!");
}
//创建请求头
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
ResponseEntity<String> responseEntity = null;
if (url.contains("open.feishu.cn")) {
FeiShuTextMsgReq textMsgReq = new FeiShuTextMsgReq();
textMsgReq.withContent(msg);
HttpEntity<FeiShuTextMsgReq> entity = new HttpEntity<>(textMsgReq, headers);
responseEntity = restTemplate.postForEntity(url, entity, String.class);
} else {
TextMsgReq textMsgReq = new TextMsgReq();
textMsgReq.withContent(msg);
if (!CollectionUtils.isEmpty(usersList)) {
textMsgReq.withUserList(usersList);
}
HttpEntity<TextMsgReq> entity = new HttpEntity<>(textMsgReq, headers);
responseEntity = restTemplate.postForEntity(url, entity, String.class);
}
String body = responseEntity.getBody();
log.info("sendRobot={}", body);
return responseEntity.getStatusCode() == HttpStatus.OK;
}
}

@ -0,0 +1,62 @@
package com.xxl.job.admin.core.alarm.msg;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
*/
public class FeiShuTextMsgReq {
public FeiShuTextMsgReq() {
List<Map<String, Object>> elements = new ArrayList<>();
Map<String, Boolean> config = new HashMap<>();
config.put("wide_screen_mode", true);
card.put("config", config);
card.put("elements",elements);
text.put("tag", "markdown");
elements.add(text);
}
private Map<String,Object> card=new HashMap<>();
@JsonIgnore
private Map<String,Object> text=new HashMap<>();
@JsonProperty(value = "msg_type")
private String msgType="interactive";
/**
*
*
* @param content
*/
@JsonIgnore
public FeiShuTextMsgReq withContent(String content) {
text.put("content", content);
return this;
}
public String getMsgType() {
return msgType;
}
public void setMsgType(String msgType) {
this.msgType = msgType;
}
public Map<String, Object> getCard() {
return card;
}
public void setCard(Map<String, Object> card) {
this.card = card;
}
}

@ -0,0 +1,63 @@
package com.xxl.job.admin.core.alarm.msg;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
*/
public class TextMsgReq {
// {
// "msgtype": "text",
// "text": {
// "content": ""
// "mentioned_mobile_list":[]
// }
// }
@JsonProperty(value = "msgtype")
private String msgType = "text";
@JsonProperty(value = "text")
private Map<String, Object> text = new HashMap<>();
@JsonIgnore
public List<String> userList;
/**
*
*
* @param content
*/
@JsonIgnore
public TextMsgReq withContent(String content) {
text.put("content", content);
return this;
}
/**
* @
*
* @param userList
*/
@JsonIgnore
public TextMsgReq withUserList(List<String> userList) {
text.put("mentioned_mobile_list", userList);
return this;
}
public String getMsgType() {
return msgType;
}
public void setMsgType(String msgType) {
this.msgType = msgType;
}
}

@ -18,7 +18,8 @@ public class XxlJobInfo {
private Date updateTime; private Date updateTime;
private String author; // 负责人 private String author; // 负责人
private String alarmEmail; // 报警邮件 private String alarmUrl; // 报警邮件
private Integer alarmType;//告警类型 1-邮件 2-webhook
private String scheduleType; // 调度类型 private String scheduleType; // 调度类型
private String scheduleConf; // 调度配置,值含义取决于调度类型 private String scheduleConf; // 调度配置,值含义取决于调度类型
@ -91,12 +92,20 @@ public class XxlJobInfo {
this.author = author; this.author = author;
} }
public String getAlarmEmail() { public String getAlarmUrl() {
return alarmEmail; return alarmUrl;
} }
public void setAlarmEmail(String alarmEmail) { public void setAlarmUrl(String alarmUrl) {
this.alarmEmail = alarmEmail; this.alarmUrl = alarmUrl;
}
public Integer getAlarmType() {
return alarmType;
}
public void setAlarmType(Integer alarmType) {
this.alarmType = alarmType;
} }
public String getScheduleType() { public String getScheduleType() {

@ -267,7 +267,7 @@ public class XxlJobServiceImpl implements XxlJobService {
exists_jobInfo.setJobGroup(jobInfo.getJobGroup()); exists_jobInfo.setJobGroup(jobInfo.getJobGroup());
exists_jobInfo.setJobDesc(jobInfo.getJobDesc()); exists_jobInfo.setJobDesc(jobInfo.getJobDesc());
exists_jobInfo.setAuthor(jobInfo.getAuthor()); exists_jobInfo.setAuthor(jobInfo.getAuthor());
exists_jobInfo.setAlarmEmail(jobInfo.getAlarmEmail()); exists_jobInfo.setAlarmUrl(jobInfo.getAlarmUrl());
exists_jobInfo.setScheduleType(jobInfo.getScheduleType()); exists_jobInfo.setScheduleType(jobInfo.getScheduleType());
exists_jobInfo.setScheduleConf(jobInfo.getScheduleConf()); exists_jobInfo.setScheduleConf(jobInfo.getScheduleConf());
exists_jobInfo.setMisfireStrategy(jobInfo.getMisfireStrategy()); exists_jobInfo.setMisfireStrategy(jobInfo.getMisfireStrategy());

@ -118,8 +118,11 @@ jobinfo_field_timeout=Job timeout period
jobinfo_field_gluetype=GLUE Type jobinfo_field_gluetype=GLUE Type
jobinfo_field_executorparam=Param jobinfo_field_executorparam=Param
jobinfo_field_author=Author jobinfo_field_author=Author
jobinfo_field_alarmemail=Alarm email jobinfo_field_alarmUrl=Alarm Url
jobinfo_field_alarmemail_placeholder=Please enter alarm mail, if there are more than one comma separated jobinfo_field_alarmType=Alarm Type
jobinfo_field_email=email
jobinfo_field_webhook=webhook
jobinfo_field_alarmemail_placeholder=Please enter alarm url, if there are more than one comma separated
jobinfo_field_executorRouteStrategy=Route Strategy jobinfo_field_executorRouteStrategy=Route Strategy
jobinfo_field_childJobId=Child Job ID jobinfo_field_childJobId=Child Job ID
jobinfo_field_childJobId_placeholder=Please enter the Child job ID, if there are more than one comma separated jobinfo_field_childJobId_placeholder=Please enter the Child job ID, if there are more than one comma separated

@ -118,8 +118,11 @@ jobinfo_field_gluetype=运行模式
jobinfo_field_executorparam=任务参数 jobinfo_field_executorparam=任务参数
jobinfo_field_author=负责人 jobinfo_field_author=负责人
jobinfo_field_timeout=任务超时时间 jobinfo_field_timeout=任务超时时间
jobinfo_field_alarmemail=报警邮件 jobinfo_field_alarmUrl=报警地址
jobinfo_field_alarmemail_placeholder=请输入报警邮件,多个邮件地址则逗号分隔 jobinfo_field_alarmType=告警类型
jobinfo_field_email=邮件
jobinfo_field_webhook=webhook
jobinfo_field_alarmemail_placeholder=请输入报警地址,多个邮件地址则逗号分隔
jobinfo_field_executorRouteStrategy=路由策略 jobinfo_field_executorRouteStrategy=路由策略
jobinfo_field_childJobId=子任务ID jobinfo_field_childJobId=子任务ID
jobinfo_field_childJobId_placeholder=请输入子任务的任务ID,如存在多个则逗号分隔 jobinfo_field_childJobId_placeholder=请输入子任务的任务ID,如存在多个则逗号分隔

@ -118,7 +118,10 @@ jobinfo_field_gluetype=運行模式
jobinfo_field_executorparam=任務參數 jobinfo_field_executorparam=任務參數
jobinfo_field_author=負責人 jobinfo_field_author=負責人
jobinfo_field_timeout=任務超時秒數 jobinfo_field_timeout=任務超時秒數
jobinfo_field_alarmemail=告警郵件 jobinfo_field_alarmUrl=告警地址
jobinfo_field_alarmType=告警类型
jobinfo_field_email=郵件
jobinfo_field_webhook=webhook
jobinfo_field_alarmemail_placeholder=輸入多個告警郵件地址,請以逗號分隔 jobinfo_field_alarmemail_placeholder=輸入多個告警郵件地址,請以逗號分隔
jobinfo_field_executorRouteStrategy=路由策略 jobinfo_field_executorRouteStrategy=路由策略
jobinfo_field_childJobId=子任務ID jobinfo_field_childJobId=子任務ID

@ -2,7 +2,7 @@
<configuration debug="false" scan="true" scanPeriod="1 seconds"> <configuration debug="false" scan="true" scanPeriod="1 seconds">
<contextName>logback</contextName> <contextName>logback</contextName>
<property name="log.path" value="/data/applogs/xxl-job/xxl-job-admin.log"/> <property name="log.path" value="./data/applogs/xxl-job/xxl-job-admin.log"/>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender"> <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder> <encoder>

@ -13,7 +13,8 @@
<result column="update_time" property="updateTime" /> <result column="update_time" property="updateTime" />
<result column="author" property="author" /> <result column="author" property="author" />
<result column="alarm_email" property="alarmEmail" /> <result column="alarm_url" property="alarmUrl" />
<result column="alarm_type" property="alarmType" />
<result column="schedule_type" property="scheduleType" /> <result column="schedule_type" property="scheduleType" />
<result column="schedule_conf" property="scheduleConf" /> <result column="schedule_conf" property="scheduleConf" />
@ -45,7 +46,8 @@
t.add_time, t.add_time,
t.update_time, t.update_time,
t.author, t.author,
t.alarm_email, t.alarm_type,
t.alarm_url,
t.schedule_type, t.schedule_type,
t.schedule_conf, t.schedule_conf,
t.misfire_strategy, t.misfire_strategy,
@ -118,7 +120,8 @@
add_time, add_time,
update_time, update_time,
author, author,
alarm_email, alarm_url,
alarm_type,
schedule_type, schedule_type,
schedule_conf, schedule_conf,
misfire_strategy, misfire_strategy,
@ -142,7 +145,8 @@
#{addTime}, #{addTime},
#{updateTime}, #{updateTime},
#{author}, #{author},
#{alarmEmail}, #{alarmUrl},
#{alarmType},
#{scheduleType}, #{scheduleType},
#{scheduleConf}, #{scheduleConf},
#{misfireStrategy}, #{misfireStrategy},
@ -180,7 +184,8 @@
job_desc = #{jobDesc}, job_desc = #{jobDesc},
update_time = #{updateTime}, update_time = #{updateTime},
author = #{author}, author = #{author},
alarm_email = #{alarmEmail}, alarm_url = #{alarmUrl},
alarm_Type = #{alarmType},
schedule_type = #{scheduleType}, schedule_type = #{scheduleType},
schedule_conf = #{scheduleConf}, schedule_conf = #{scheduleConf},
misfire_strategy = #{misfireStrategy}, misfire_strategy = #{misfireStrategy},

@ -89,7 +89,7 @@ $(function() {
} }
}, },
{ "data": 'author', "visible" : true, "width":'10%'}, { "data": 'author', "visible" : true, "width":'10%'},
{ "data": 'alarmEmail', "visible" : false}, { "data": 'alarmUrl', "visible" : false},
{ {
"data": 'triggerStatus', "data": 'triggerStatus',
"width":'10%', "width":'10%',
@ -541,8 +541,8 @@ $(function() {
$('#updateModal .form select[name=jobGroup] option[value='+ row.jobGroup +']').prop('selected', true); $('#updateModal .form select[name=jobGroup] option[value='+ row.jobGroup +']').prop('selected', true);
$("#updateModal .form input[name='jobDesc']").val( row.jobDesc ); $("#updateModal .form input[name='jobDesc']").val( row.jobDesc );
$("#updateModal .form input[name='author']").val( row.author ); $("#updateModal .form input[name='author']").val( row.author );
$("#updateModal .form input[name='alarmEmail']").val( row.alarmEmail ); $("#updateModal .form input[name='alarmUrl']").val( row.alarmUrl );
$('#updateModal .form select[name=alarmType] option[value='+ row.alarmType +']').prop('selected', true);
// fill trigger // fill trigger
$('#updateModal .form select[name=scheduleType] option[value='+ row.scheduleType +']').prop('selected', true); $('#updateModal .form select[name=scheduleType] option[value='+ row.scheduleType +']').prop('selected', true);
$("#updateModal .form input[name='scheduleConf']").val( row.scheduleConf ); $("#updateModal .form input[name='scheduleConf']").val( row.scheduleConf );

@ -86,7 +86,7 @@
<th name="addTime" >addTime</th> <th name="addTime" >addTime</th>
<th name="updateTime" >updateTime</th> <th name="updateTime" >updateTime</th>
<th name="author" >${I18n.jobinfo_field_author}</th> <th name="author" >${I18n.jobinfo_field_author}</th>
<th name="alarmEmail" >${I18n.jobinfo_field_alarmemail}</th> <th name="alarmUrl" >${I18n.jobinfo_field_alarmUrl}</th>
<th name="triggerStatus" >${I18n.system_status}</th> <th name="triggerStatus" >${I18n.system_status}</th>
<th>${I18n.system_opt}</th> <th>${I18n.system_opt}</th>
</tr> </tr>
@ -132,8 +132,20 @@
<div class="form-group"> <div class="form-group">
<label for="lastname" class="col-sm-2 control-label">${I18n.jobinfo_field_author}<font color="red">*</font></label> <label for="lastname" class="col-sm-2 control-label">${I18n.jobinfo_field_author}<font color="red">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="author" placeholder="${I18n.system_please_input}${I18n.jobinfo_field_author}" maxlength="50" ></div> <div class="col-sm-4"><input type="text" class="form-control" name="author" placeholder="${I18n.system_please_input}${I18n.jobinfo_field_author}" maxlength="50" ></div>
<label for="lastname" class="col-sm-2 control-label">${I18n.jobinfo_field_alarmemail}<font color="black">*</font></label> <label for="lastname" class="col-sm-2 control-label">${I18n.jobinfo_field_alarmType}<font color="black">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="alarmEmail" placeholder="${I18n.jobinfo_field_alarmemail_placeholder}" maxlength="100" ></div> <div class="col-sm-4">
<select class="form-control" name="alarmType" >
<#list AlarmTypeEnum as item>
<option value="${item.alarmType}" >${item.title}</option>
</#list>
</select>
</div>
</div>
<div class="form-group">
<label for="lastname" class="col-sm-2 control-label">${I18n.jobinfo_field_alarmUrl}<font color="black">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="alarmUrl" placeholder="${I18n.jobinfo_field_alarmemail_placeholder}" maxlength="100" ></div>
</div> </div>
<br> <br>
@ -377,8 +389,20 @@ exit 0
<div class="form-group"> <div class="form-group">
<label for="lastname" class="col-sm-2 control-label">${I18n.jobinfo_field_author}<font color="red">*</font></label> <label for="lastname" class="col-sm-2 control-label">${I18n.jobinfo_field_author}<font color="red">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="author" placeholder="${I18n.system_please_input}${I18n.jobinfo_field_author}" maxlength="50" ></div> <div class="col-sm-4"><input type="text" class="form-control" name="author" placeholder="${I18n.system_please_input}${I18n.jobinfo_field_author}" maxlength="50" ></div>
<label for="lastname" class="col-sm-2 control-label">${I18n.jobinfo_field_alarmemail}<font color="black">*</font></label> <label for="lastname" class="col-sm-2 control-label">${I18n.jobinfo_field_alarmType}<font color="black">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="alarmEmail" placeholder="${I18n.jobinfo_field_alarmemail_placeholder}" maxlength="100" ></div> <div class="col-sm-4">
<select class="form-control" name="alarmType" >
<#list AlarmTypeEnum as item>
<option value="${item.alarmType}" >${item.title}</option>
</#list>
</select>
</div>
</div>
<div class="form-group">
<label for="lastname" class="col-sm-2 control-label">${I18n.jobinfo_field_alarmUrl}<font color="black">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="alarmUrl" placeholder="${I18n.jobinfo_field_alarmemail_placeholder}" maxlength="100" ></div>
</div> </div>
<br> <br>

@ -33,7 +33,7 @@ public class XxlJobInfoDaoTest {
info.setJobGroup(1); info.setJobGroup(1);
info.setJobDesc("desc"); info.setJobDesc("desc");
info.setAuthor("setAuthor"); info.setAuthor("setAuthor");
info.setAlarmEmail("setAlarmEmail"); info.setAlarmUrl("setAlarmEmail");
info.setScheduleType(ScheduleTypeEnum.FIX_RATE.name()); info.setScheduleType(ScheduleTypeEnum.FIX_RATE.name());
info.setScheduleConf(String.valueOf(33)); info.setScheduleConf(String.valueOf(33));
info.setMisfireStrategy(MisfireStrategyEnum.DO_NOTHING.name()); info.setMisfireStrategy(MisfireStrategyEnum.DO_NOTHING.name());
@ -58,7 +58,7 @@ public class XxlJobInfoDaoTest {
info.setMisfireStrategy(MisfireStrategyEnum.FIRE_ONCE_NOW.name()); info.setMisfireStrategy(MisfireStrategyEnum.FIRE_ONCE_NOW.name());
info2.setJobDesc("desc2"); info2.setJobDesc("desc2");
info2.setAuthor("setAuthor2"); info2.setAuthor("setAuthor2");
info2.setAlarmEmail("setAlarmEmail2"); info2.setAlarmUrl("setAlarmEmail2");
info2.setExecutorRouteStrategy("setExecutorRouteStrategy2"); info2.setExecutorRouteStrategy("setExecutorRouteStrategy2");
info2.setExecutorHandler("setExecutorHandler2"); info2.setExecutorHandler("setExecutorHandler2");
info2.setExecutorParam("setExecutorParam2"); info2.setExecutorParam("setExecutorParam2");

Loading…
Cancel
Save