|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
package com.xxl.job.admin.controller;
|
|
|
|
|
|
|
|
|
|
import com.xxl.job.admin.core.exception.XxlJobException;
|
|
|
|
|
import com.xxl.job.admin.core.complete.XxlJobCompleter;
|
|
|
|
|
import com.xxl.job.admin.core.exception.XxlJobException;
|
|
|
|
|
import com.xxl.job.admin.core.model.XxlJobGroup;
|
|
|
|
|
import com.xxl.job.admin.core.model.XxlJobInfo;
|
|
|
|
|
import com.xxl.job.admin.core.model.XxlJobLog;
|
|
|
|
@ -129,22 +129,26 @@ public class JobLogController {
|
|
|
|
|
|
|
|
|
|
model.addAttribute("triggerCode", jobLog.getTriggerCode());
|
|
|
|
|
model.addAttribute("handleCode", jobLog.getHandleCode());
|
|
|
|
|
model.addAttribute("executorAddress", jobLog.getExecutorAddress());
|
|
|
|
|
model.addAttribute("triggerTime", jobLog.getTriggerTime().getTime());
|
|
|
|
|
model.addAttribute("logId", jobLog.getId());
|
|
|
|
|
return "joblog/joblog.detail";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/logDetailCat")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ReturnT<LogResult> logDetailCat(String executorAddress, long triggerTime, long logId, int fromLineNum){
|
|
|
|
|
public ReturnT<LogResult> logDetailCat(long logId, int fromLineNum){
|
|
|
|
|
try {
|
|
|
|
|
ExecutorBiz executorBiz = XxlJobScheduler.getExecutorBiz(executorAddress);
|
|
|
|
|
ReturnT<LogResult> logResult = executorBiz.log(new LogParam(triggerTime, logId, fromLineNum));
|
|
|
|
|
// valid
|
|
|
|
|
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
|
|
|
|
|
if (logResult.getContent()!=null && logResult.getContent().getFromLineNum() > logResult.getContent().getToLineNum()) {
|
|
|
|
|
XxlJobLog jobLog = xxlJobLogDao.load(logId);
|
|
|
|
|
if (jobLog.getHandleCode() > 0) {
|
|
|
|
|
logResult.getContent().setEnd(true);
|
|
|
|
|
}
|
|
|
|
|