update xxljob 2.3.1 => 2.4.0

2.X
疯狂的狮子li 2 years ago
parent 9e0a2cb581
commit bba5c77ae1

@ -33,7 +33,7 @@
<hutool.version>5.8.15</hutool.version> <hutool.version>5.8.15</hutool.version>
<redisson.version>3.20.0</redisson.version> <redisson.version>3.20.0</redisson.version>
<lock4j.version>2.2.3</lock4j.version> <lock4j.version>2.2.3</lock4j.version>
<xxl-job.version>2.3.1</xxl-job.version> <xxl-job.version>2.4.0</xxl-job.version>
<satoken.version>1.34.0</satoken.version> <satoken.version>1.34.0</satoken.version>
<lombok.version>1.18.24</lombok.version> <lombok.version>1.18.24</lombok.version>
<logstash.version>7.2</logstash.version> <logstash.version>7.2</logstash.version>

@ -1,5 +1,6 @@
package com.xxl.job.admin.controller; package com.xxl.job.admin.controller;
import com.xxl.job.admin.controller.annotation.PermissionLimit;
import com.xxl.job.admin.core.model.XxlJobGroup; import com.xxl.job.admin.core.model.XxlJobGroup;
import com.xxl.job.admin.core.model.XxlJobRegistry; import com.xxl.job.admin.core.model.XxlJobRegistry;
import com.xxl.job.admin.core.util.I18nUtil; import com.xxl.job.admin.core.util.I18nUtil;
@ -35,12 +36,14 @@ public class JobGroupController {
private XxlJobRegistryDao xxlJobRegistryDao; private XxlJobRegistryDao xxlJobRegistryDao;
@RequestMapping @RequestMapping
@PermissionLimit(adminuser = true)
public String index(Model model) { public String index(Model model) {
return "jobgroup/jobgroup.index"; return "jobgroup/jobgroup.index";
} }
@RequestMapping("/pageList") @RequestMapping("/pageList")
@ResponseBody @ResponseBody
@PermissionLimit(adminuser = true)
public Map<String, Object> pageList(HttpServletRequest request, public Map<String, Object> pageList(HttpServletRequest request,
@RequestParam(required = false, defaultValue = "0") int start, @RequestParam(required = false, defaultValue = "0") int start,
@RequestParam(required = false, defaultValue = "10") int length, @RequestParam(required = false, defaultValue = "10") int length,
@ -60,6 +63,7 @@ public class JobGroupController {
@RequestMapping("/save") @RequestMapping("/save")
@ResponseBody @ResponseBody
@PermissionLimit(adminuser = true)
public ReturnT<String> save(XxlJobGroup xxlJobGroup) { public ReturnT<String> save(XxlJobGroup xxlJobGroup) {
// valid // valid
@ -103,6 +107,7 @@ public class JobGroupController {
@RequestMapping("/update") @RequestMapping("/update")
@ResponseBody @ResponseBody
@PermissionLimit(adminuser = true)
public ReturnT<String> update(XxlJobGroup xxlJobGroup) { public ReturnT<String> update(XxlJobGroup xxlJobGroup) {
// valid // valid
if (xxlJobGroup.getAppname() == null || xxlJobGroup.getAppname().trim().length() == 0) { if (xxlJobGroup.getAppname() == null || xxlJobGroup.getAppname().trim().length() == 0) {
@ -171,6 +176,7 @@ public class JobGroupController {
@RequestMapping("/remove") @RequestMapping("/remove")
@ResponseBody @ResponseBody
@PermissionLimit(adminuser = true)
public ReturnT<String> remove(int id) { public ReturnT<String> remove(int id) {
// valid // valid
@ -190,6 +196,7 @@ public class JobGroupController {
@RequestMapping("/loadById") @RequestMapping("/loadById")
@ResponseBody @ResponseBody
@PermissionLimit(adminuser = true)
public ReturnT<XxlJobGroup> loadById(int id) { public ReturnT<XxlJobGroup> loadById(int id) {
XxlJobGroup jobGroup = xxlJobGroupDao.load(id); XxlJobGroup jobGroup = xxlJobGroupDao.load(id);
return jobGroup != null ? new ReturnT<XxlJobGroup>(jobGroup) : new ReturnT<XxlJobGroup>(ReturnT.FAIL_CODE, null); return jobGroup != null ? new ReturnT<XxlJobGroup>(jobGroup) : new ReturnT<XxlJobGroup>(ReturnT.FAIL_CODE, null);

@ -130,22 +130,26 @@ public class JobLogController {
model.addAttribute("triggerCode", jobLog.getTriggerCode()); model.addAttribute("triggerCode", jobLog.getTriggerCode());
model.addAttribute("handleCode", jobLog.getHandleCode()); model.addAttribute("handleCode", jobLog.getHandleCode());
model.addAttribute("executorAddress", jobLog.getExecutorAddress());
model.addAttribute("triggerTime", jobLog.getTriggerTime().getTime());
model.addAttribute("logId", jobLog.getId()); model.addAttribute("logId", jobLog.getId());
return "joblog/joblog.detail"; return "joblog/joblog.detail";
} }
@RequestMapping("/logDetailCat") @RequestMapping("/logDetailCat")
@ResponseBody @ResponseBody
public ReturnT<LogResult> logDetailCat(String executorAddress, long triggerTime, long logId, int fromLineNum) { public ReturnT<LogResult> logDetailCat(long logId, int fromLineNum) {
try { try {
ExecutorBiz executorBiz = XxlJobScheduler.getExecutorBiz(executorAddress); // valid
ReturnT<LogResult> logResult = executorBiz.log(new LogParam(triggerTime, logId, fromLineNum)); XxlJobLog jobLog = xxlJobLogDao.load(logId); // todo, need to improve performance
if (jobLog == null) {
return new ReturnT<LogResult>(ReturnT.FAIL_CODE, I18nUtil.getString("joblog_logid_unvalid"));
}
// log cat
ExecutorBiz executorBiz = XxlJobScheduler.getExecutorBiz(jobLog.getExecutorAddress());
ReturnT<LogResult> logResult = executorBiz.log(new LogParam(jobLog.getTriggerTime().getTime(), logId, fromLineNum));
// is end // is end
if (logResult.getContent() != null && logResult.getContent().getFromLineNum() > logResult.getContent().getToLineNum()) { if (logResult.getContent() != null && logResult.getContent().getFromLineNum() > logResult.getContent().getToLineNum()) {
XxlJobLog jobLog = xxlJobLogDao.load(logId);
if (jobLog.getHandleCode() > 0) { if (jobLog.getHandleCode() > 0) {
logResult.getContent().setEnd(true); logResult.getContent().setEnd(true);
} }

@ -1,6 +1,6 @@
admin_name=Scheduling Center admin_name=Scheduling Center
admin_name_full=Distributed Task Scheduling Platform XXL-JOB admin_name_full=Distributed Task Scheduling Platform XXL-JOB
admin_version=2.3.1 admin_version=2.4.0
admin_i18n=en admin_i18n=en
## system ## system

@ -1,6 +1,6 @@
admin_name=任务调度中心 admin_name=任务调度中心
admin_name_full=分布式任务调度平台XXL-JOB admin_name_full=分布式任务调度平台XXL-JOB
admin_version=2.3.1 admin_version=2.4.0
admin_i18n= admin_i18n=
## system ## system

@ -1,6 +1,6 @@
admin_name=任務調度中心 admin_name=任務調度中心
admin_name_full=分布式任務調度平臺XXL-JOB admin_name_full=分布式任務調度平臺XXL-JOB
admin_version=2.3.1 admin_version=2.4.0
admin_i18n= admin_i18n=
## system ## system

@ -25,8 +25,6 @@ $(function() {
async: false, // sync, make log ordered async: false, // sync, make log ordered
url : base_url + '/joblog/logDetailCat', url : base_url + '/joblog/logDetailCat',
data : { data : {
"executorAddress":executorAddress,
"triggerTime":triggerTime,
"logId":logId, "logId":logId,
"fromLineNum":fromLineNum "fromLineNum":fromLineNum
}, },

@ -62,8 +62,6 @@
// 参数 // 参数
var triggerCode = '${triggerCode}'; var triggerCode = '${triggerCode}';
var handleCode = '${handleCode}'; var handleCode = '${handleCode}';
var executorAddress = '${executorAddress!}';
var triggerTime = '${triggerTime?c}';
var logId = '${logId}'; var logId = '${logId}';
</script> </script>
<script src="${request.contextPath}/static/js/joblog.detail.1.js"></script> <script src="${request.contextPath}/static/js/joblog.detail.1.js"></script>

Loading…
Cancel
Save