Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
X
XXL-JOB
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
靳帅
XXL-JOB
Commits
0e805413
提交
0e805413
authored
5月 18, 2016
作者:
xueli.xue
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
交互重构
上级
0f4c412f
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
25 个修改的文件
包含
1102 行增加
和
285 行删除
+1102
-285
tables_xxl_job.sql
doc/db/tables_xxl_job.sql
+0
-0
JobCodeController.java
...c/main/java/com/xxl/job/controller/JobCodeController.java
+22
-0
JobInfoController.java
...c/main/java/com/xxl/job/controller/JobInfoController.java
+32
-41
LocalNomalJobBean.java
.../main/java/com/xxl/job/service/job/LocalNomalJobBean.java
+94
-93
DemoConcurrentJobBean.java
...a/com/xxl/job/service/job/impl/DemoConcurrentJobBean.java
+29
-28
DemoNomalJobBean.java
...n/java/com/xxl/job/service/job/impl/DemoNomalJobBean.java
+31
-30
jdbc.properties
xxl-job-admin/src/main/resources/jdbc.properties
+2
-1
common.exception.ftl
.../main/webapp/WEB-INF/template/common/common.exception.ftl
+1
-1
help.ftl
xxl-job-admin/src/main/webapp/WEB-INF/template/help.ftl
+4
-2
index.ftl
...-admin/src/main/webapp/WEB-INF/template/jobcode/index.ftl
+105
-0
index.ftl
...-admin/src/main/webapp/WEB-INF/template/jobinfo/index.ftl
+29
-45
index.ftl
...b-admin/src/main/webapp/WEB-INF/template/joblog/index.ftl
+4
-2
common.1.js
xxl-job-admin/src/main/webapp/static/js/common.1.js
+1
-1
jobcode.index.1.js
xxl-job-admin/src/main/webapp/static/js/jobcode.index.1.js
+16
-0
jobinfo.index.1.js
xxl-job-admin/src/main/webapp/static/js/jobinfo.index.1.js
+18
-35
anyword-hint.js
...bapp/static/plugins/codemirror/addon/hint/anyword-hint.js
+41
-0
show-hint.css
...webapp/static/plugins/codemirror/addon/hint/show-hint.css
+38
-0
show-hint.js
.../webapp/static/plugins/codemirror/addon/hint/show-hint.js
+0
-0
codemirror.css
.../main/webapp/static/plugins/codemirror/lib/codemirror.css
+338
-0
codemirror.js
...c/main/webapp/static/plugins/codemirror/lib/codemirror.js
+0
-0
clike.js
...main/webapp/static/plugins/codemirror/mode/clike/clike.js
+0
-0
test.js
.../main/webapp/static/plugins/codemirror/mode/clike/test.js
+51
-0
groovy.js
...in/webapp/static/plugins/codemirror/mode/groovy/groovy.js
+230
-0
HandlerThread.java
...c/main/java/com/xxl/job/client/handler/HandlerThread.java
+10
-6
HttpUtil.java
...lient/src/main/java/com/xxl/job/client/util/HttpUtil.java
+6
-0
没有找到文件。
doc/db/tables_xxl_
log
.sql
→
doc/db/tables_xxl_
job
.sql
浏览文件 @
0e805413
File moved
xxl-job-admin/src/main/java/com/xxl/job/controller/JobCodeController.java
0 → 100644
浏览文件 @
0e805413
package
com
.
xxl
.
job
.
controller
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.RequestMapping
;
/**
* job code controller
* @author xuxueli 2015-12-19 16:13:16
*/
@Controller
@RequestMapping
(
"/jobcode"
)
public
class
JobCodeController
{
@RequestMapping
public
String
index
(
Model
model
,
HttpServletRequest
request
)
{
return
"jobcode/index"
;
}
}
xxl-job-admin/src/main/java/com/xxl/job/controller/JobInfoController.java
浏览文件 @
0e805413
package
com
.
xxl
.
job
.
controller
;
package
com
.
xxl
.
job
.
controller
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -9,7 +8,6 @@ import javax.annotation.Resource;
...
@@ -9,7 +8,6 @@ import javax.annotation.Resource;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.quartz.CronExpression
;
import
org.quartz.CronExpression
;
import
org.quartz.Job
;
import
org.quartz.SchedulerException
;
import
org.quartz.SchedulerException
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.ui.Model
;
...
@@ -25,14 +23,11 @@ import com.xxl.job.core.model.XxlJobInfo;
...
@@ -25,14 +23,11 @@ import com.xxl.job.core.model.XxlJobInfo;
import
com.xxl.job.core.util.DynamicSchedulerUtil
;
import
com.xxl.job.core.util.DynamicSchedulerUtil
;
import
com.xxl.job.dao.IXxlJobInfoDao
;
import
com.xxl.job.dao.IXxlJobInfoDao
;
import
com.xxl.job.service.job.RemoteHttpJobBean
;
import
com.xxl.job.service.job.RemoteHttpJobBean
;
import
com.xxl.job.service.job.impl.DemoConcurrentJobBean
;
import
com.xxl.job.service.job.impl.DemoNomalJobBean
;
/**
/**
* index controller
* index controller
* @author xuxueli 2015-12-19 16:13:16
* @author xuxueli 2015-12-19 16:13:16
*/
*/
@SuppressWarnings
(
"unchecked"
)
@Controller
@Controller
@RequestMapping
(
"/jobinfo"
)
@RequestMapping
(
"/jobinfo"
)
public
class
JobInfoController
{
public
class
JobInfoController
{
...
@@ -40,19 +35,8 @@ public class JobInfoController {
...
@@ -40,19 +35,8 @@ public class JobInfoController {
@Resource
@Resource
private
IXxlJobInfoDao
xxlJobInfoDao
;
private
IXxlJobInfoDao
xxlJobInfoDao
;
// remote job bean
public
static
Class
<?
extends
Job
>
remoteJobBean
=
RemoteHttpJobBean
.
class
;
// loacal job bean
public
static
List
<
Class
<?
extends
Job
>>
localJobBeanList
=
new
ArrayList
<
Class
<?
extends
Job
>>();
static
{
localJobBeanList
.
add
((
Class
<?
extends
Job
>)
DemoNomalJobBean
.
class
);
localJobBeanList
.
add
((
Class
<?
extends
Job
>)
DemoConcurrentJobBean
.
class
);
}
@RequestMapping
@RequestMapping
public
String
index
(
Model
model
)
{
public
String
index
(
Model
model
)
{
model
.
addAttribute
(
"localJobBeanList"
,
localJobBeanList
);
// 本地任务-列表
model
.
addAttribute
(
"remoteJobBean"
,
remoteJobBean
);
// 远程任务-jobBean
model
.
addAttribute
(
"JobGroupList"
,
JobGroupEnum
.
values
());
// 任务组列表
model
.
addAttribute
(
"JobGroupList"
,
JobGroupEnum
.
values
());
// 任务组列表
return
"jobinfo/index"
;
return
"jobinfo/index"
;
}
}
...
@@ -84,8 +68,8 @@ public class JobInfoController {
...
@@ -84,8 +68,8 @@ public class JobInfoController {
@RequestMapping
(
"/add"
)
@RequestMapping
(
"/add"
)
@ResponseBody
@ResponseBody
public
ReturnT
<
String
>
add
(
String
jobGroup
,
String
jobName
,
String
jobCron
,
String
jobDesc
,
String
jobClass
,
public
ReturnT
<
String
>
add
(
String
jobGroup
,
String
jobName
,
String
jobCron
,
String
jobDesc
,
String
handler_
params
,
String
handler_address
,
String
handler_name
,
String
handler_
address
,
String
handler_name
,
String
handler_params
,
String
author
,
String
alarmEmail
,
int
alarmThreshold
)
{
String
author
,
String
alarmEmail
,
int
alarmThreshold
)
{
// valid
// valid
...
@@ -101,25 +85,11 @@ public class JobInfoController {
...
@@ -101,25 +85,11 @@ public class JobInfoController {
if
(
StringUtils
.
isBlank
(
jobDesc
))
{
if
(
StringUtils
.
isBlank
(
jobDesc
))
{
return
new
ReturnT
<
String
>(
500
,
"请输入“任务描述”"
);
return
new
ReturnT
<
String
>(
500
,
"请输入“任务描述”"
);
}
}
Class
<?
extends
Job
>
jobClass_
=
null
;
if
(
StringUtils
.
isBlank
(
handler_address
))
{
try
{
return
new
ReturnT
<
String
>(
500
,
"请输入“机器地址”"
);
Class
<?>
clazz
=
Class
.
forName
(
jobClass
);
if
(
clazz
!=
null
)
{
jobClass_
=
(
Class
<?
extends
Job
>)
clazz
;
}
}
catch
(
ClassNotFoundException
e1
)
{
e1
.
printStackTrace
();
}
}
if
(
jobClass_
==
null
)
{
if
(
StringUtils
.
isBlank
(
handler_name
))
{
return
new
ReturnT
<
String
>(
500
,
"请选择“JobBean”"
);
return
new
ReturnT
<
String
>(
500
,
"请输入“执行器”"
);
}
if
(
jobClass_
.
getClass
().
getName
().
equals
(
remoteJobBean
.
getName
()))
{
if
(
StringUtils
.
isBlank
(
handler_address
))
{
return
new
ReturnT
<
String
>(
500
,
"请输入“远程-机器地址”"
);
}
if
(
StringUtils
.
isBlank
(
handler_name
))
{
return
new
ReturnT
<
String
>(
500
,
"请输入“远程-执行器”"
);
}
}
}
if
(
StringUtils
.
isBlank
(
author
))
{
if
(
StringUtils
.
isBlank
(
author
))
{
return
new
ReturnT
<
String
>(
500
,
"请输入“负责人”"
);
return
new
ReturnT
<
String
>(
500
,
"请输入“负责人”"
);
...
@@ -127,6 +97,9 @@ public class JobInfoController {
...
@@ -127,6 +97,9 @@ public class JobInfoController {
if
(
StringUtils
.
isBlank
(
alarmEmail
))
{
if
(
StringUtils
.
isBlank
(
alarmEmail
))
{
return
new
ReturnT
<
String
>(
500
,
"请输入“报警邮件”"
);
return
new
ReturnT
<
String
>(
500
,
"请输入“报警邮件”"
);
}
}
if
(
alarmThreshold
<
0
)
{
alarmThreshold
=
0
;
}
try
{
try
{
if
(
DynamicSchedulerUtil
.
checkExists
(
jobName
,
jobGroup
))
{
if
(
DynamicSchedulerUtil
.
checkExists
(
jobName
,
jobGroup
))
{
...
@@ -139,9 +112,9 @@ public class JobInfoController {
...
@@ -139,9 +112,9 @@ public class JobInfoController {
// parse jobDataMap
// parse jobDataMap
HashMap
<
String
,
String
>
jobDataMap
=
new
HashMap
<
String
,
String
>();
HashMap
<
String
,
String
>
jobDataMap
=
new
HashMap
<
String
,
String
>();
jobDataMap
.
put
(
HandlerRepository
.
HANDLER_PARAMS
,
handler_params
);
jobDataMap
.
put
(
HandlerRepository
.
HANDLER_ADDRESS
,
handler_address
);
jobDataMap
.
put
(
HandlerRepository
.
HANDLER_ADDRESS
,
handler_address
);
jobDataMap
.
put
(
HandlerRepository
.
HANDLER_NAME
,
handler_name
);
jobDataMap
.
put
(
HandlerRepository
.
HANDLER_NAME
,
handler_name
);
jobDataMap
.
put
(
HandlerRepository
.
HANDLER_PARAMS
,
handler_params
);
// Backup to the database
// Backup to the database
XxlJobInfo
jobInfo
=
new
XxlJobInfo
();
XxlJobInfo
jobInfo
=
new
XxlJobInfo
();
...
@@ -149,7 +122,7 @@ public class JobInfoController {
...
@@ -149,7 +122,7 @@ public class JobInfoController {
jobInfo
.
setJobName
(
jobName
);
jobInfo
.
setJobName
(
jobName
);
jobInfo
.
setJobCron
(
jobCron
);
jobInfo
.
setJobCron
(
jobCron
);
jobInfo
.
setJobDesc
(
jobDesc
);
jobInfo
.
setJobDesc
(
jobDesc
);
jobInfo
.
setJobClass
(
jobClass
);
jobInfo
.
setJobClass
(
RemoteHttpJobBean
.
class
.
getName
()
);
jobInfo
.
setJobData
(
JacksonUtil
.
writeValueAsString
(
jobDataMap
));
jobInfo
.
setJobData
(
JacksonUtil
.
writeValueAsString
(
jobDataMap
));
jobInfo
.
setAuthor
(
author
);
jobInfo
.
setAuthor
(
author
);
jobInfo
.
setAlarmEmail
(
alarmEmail
);
jobInfo
.
setAlarmEmail
(
alarmEmail
);
...
@@ -173,8 +146,8 @@ public class JobInfoController {
...
@@ -173,8 +146,8 @@ public class JobInfoController {
@RequestMapping
(
"/reschedule"
)
@RequestMapping
(
"/reschedule"
)
@ResponseBody
@ResponseBody
public
ReturnT
<
String
>
reschedule
(
String
jobGroup
,
String
jobName
,
String
jobCron
,
String
jobDesc
,
String
jobClass
,
public
ReturnT
<
String
>
reschedule
(
String
jobGroup
,
String
jobName
,
String
jobCron
,
String
jobDesc
,
String
handler_
params
,
String
handler_address
,
String
handler_name
,
String
handler_
address
,
String
handler_name
,
String
handler_params
,
String
author
,
String
alarmEmail
,
int
alarmThreshold
)
{
String
author
,
String
alarmEmail
,
int
alarmThreshold
)
{
// valid
// valid
...
@@ -187,12 +160,30 @@ public class JobInfoController {
...
@@ -187,12 +160,30 @@ public class JobInfoController {
if
(!
CronExpression
.
isValidExpression
(
jobCron
))
{
if
(!
CronExpression
.
isValidExpression
(
jobCron
))
{
return
new
ReturnT
<
String
>(
500
,
"“corn”不合法"
);
return
new
ReturnT
<
String
>(
500
,
"“corn”不合法"
);
}
}
if
(
StringUtils
.
isBlank
(
jobDesc
))
{
return
new
ReturnT
<
String
>(
500
,
"请输入“任务描述”"
);
}
if
(
StringUtils
.
isBlank
(
handler_address
))
{
return
new
ReturnT
<
String
>(
500
,
"请输入“机器地址”"
);
}
if
(
StringUtils
.
isBlank
(
handler_name
))
{
return
new
ReturnT
<
String
>(
500
,
"请输入“执行器”"
);
}
if
(
StringUtils
.
isBlank
(
author
))
{
return
new
ReturnT
<
String
>(
500
,
"请输入“负责人”"
);
}
if
(
StringUtils
.
isBlank
(
alarmEmail
))
{
return
new
ReturnT
<
String
>(
500
,
"请输入“报警邮件”"
);
}
if
(
alarmThreshold
<
0
)
{
alarmThreshold
=
0
;
}
// parse jobDataMap
// parse jobDataMap
HashMap
<
String
,
String
>
jobDataMap
=
new
HashMap
<
String
,
String
>();
HashMap
<
String
,
String
>
jobDataMap
=
new
HashMap
<
String
,
String
>();
jobDataMap
.
put
(
HandlerRepository
.
HANDLER_PARAMS
,
handler_params
);
jobDataMap
.
put
(
HandlerRepository
.
HANDLER_ADDRESS
,
handler_address
);
jobDataMap
.
put
(
HandlerRepository
.
HANDLER_ADDRESS
,
handler_address
);
jobDataMap
.
put
(
HandlerRepository
.
HANDLER_NAME
,
handler_name
);
jobDataMap
.
put
(
HandlerRepository
.
HANDLER_NAME
,
handler_name
);
jobDataMap
.
put
(
HandlerRepository
.
HANDLER_PARAMS
,
handler_params
);
XxlJobInfo
jobInfo
=
xxlJobInfoDao
.
load
(
jobGroup
,
jobName
);
XxlJobInfo
jobInfo
=
xxlJobInfoDao
.
load
(
jobGroup
,
jobName
);
jobInfo
.
setJobCron
(
jobCron
);
jobInfo
.
setJobCron
(
jobCron
);
...
...
xxl-job-admin/src/main/java/com/xxl/job/service/job/LocalNomalJobBean.java
浏览文件 @
0e805413
package
com
.
xxl
.
job
.
service
.
job
;
//package com.xxl.job.service.job;
//
import
java.io.PrintWriter
;
//import java.io.PrintWriter;
import
java.io.StringWriter
;
//import java.io.StringWriter;
import
java.util.Date
;
//import java.util.Date;
import
java.util.HashMap
;
//import java.util.HashMap;
import
java.util.Map
;
//import java.util.Map;
//
import
org.apache.commons.lang.StringUtils
;
//import org.apache.commons.lang.StringUtils;
import
org.quartz.JobExecutionContext
;
//import org.quartz.JobExecutionContext;
import
org.quartz.JobExecutionException
;
//import org.quartz.JobExecutionException;
import
org.quartz.JobKey
;
//import org.quartz.JobKey;
import
org.slf4j.Logger
;
//import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
//import org.slf4j.LoggerFactory;
import
org.springframework.scheduling.quartz.QuartzJobBean
;
//import org.springframework.scheduling.quartz.QuartzJobBean;
//
import
com.xxl.job.client.handler.HandlerRepository
;
//import com.xxl.job.client.handler.HandlerRepository;
import
com.xxl.job.client.util.HttpUtil.RemoteCallBack
;
//import com.xxl.job.client.util.HttpUtil.RemoteCallBack;
import
com.xxl.job.client.util.JacksonUtil
;
//import com.xxl.job.client.util.JacksonUtil;
import
com.xxl.job.core.model.XxlJobInfo
;
//import com.xxl.job.core.model.XxlJobInfo;
import
com.xxl.job.core.model.XxlJobLog
;
//import com.xxl.job.core.model.XxlJobLog;
import
com.xxl.job.core.thread.JobMonitorHelper
;
//import com.xxl.job.core.thread.JobMonitorHelper;
import
com.xxl.job.core.util.DynamicSchedulerUtil
;
//import com.xxl.job.core.util.DynamicSchedulerUtil;
//
/**
///**
* http job bean
// * http job bean
* @author xuxueli 2015-12-17 18:20:34
// * @author xuxueli 2015-12-17 18:20:34
*/
// */
public
abstract
class
LocalNomalJobBean
extends
QuartzJobBean
{
//@Deprecated
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
LocalNomalJobBean
.
class
);
//public abstract class LocalNomalJobBean extends QuartzJobBean {
// private static Logger logger = LoggerFactory.getLogger(LocalNomalJobBean.class);
@Override
//
protected
void
executeInternal
(
JobExecutionContext
context
)
// @Override
throws
JobExecutionException
{
// protected void executeInternal(JobExecutionContext context)
JobKey
jobKey
=
context
.
getTrigger
().
getJobKey
();
// throws JobExecutionException {
// JobKey jobKey = context.getTrigger().getJobKey();
XxlJobInfo
jobInfo
=
DynamicSchedulerUtil
.
xxlJobInfoDao
.
load
(
jobKey
.
getGroup
(),
jobKey
.
getName
());
//
@SuppressWarnings
(
"unchecked"
)
// XxlJobInfo jobInfo = DynamicSchedulerUtil.xxlJobInfoDao.load(jobKey.getGroup(), jobKey.getName());
HashMap
<
String
,
String
>
jobDataMap
=
(
HashMap
<
String
,
String
>)
JacksonUtil
.
readValueRefer
(
jobInfo
.
getJobData
(),
Map
.
class
);
// @SuppressWarnings("unchecked")
// HashMap<String, String> jobDataMap = (HashMap<String, String>) JacksonUtil.readValueRefer(jobInfo.getJobData(), Map.class);
// save log
//
XxlJobLog
jobLog
=
new
XxlJobLog
();
// // save log
jobLog
.
setJobGroup
(
jobInfo
.
getJobGroup
());
// XxlJobLog jobLog = new XxlJobLog();
jobLog
.
setJobName
(
jobInfo
.
getJobName
());
// jobLog.setJobGroup(jobInfo.getJobGroup());
jobLog
.
setJobCron
(
jobInfo
.
getJobCron
());
// jobLog.setJobName(jobInfo.getJobName());
jobLog
.
setJobDesc
(
jobInfo
.
getJobDesc
());
// jobLog.setJobCron(jobInfo.getJobCron());
jobLog
.
setJobClass
(
jobInfo
.
getJobClass
());
// jobLog.setJobDesc(jobInfo.getJobDesc());
jobLog
.
setJobData
(
jobInfo
.
getJobData
());
// jobLog.setJobClass(jobInfo.getJobClass());
// jobLog.setJobData(jobInfo.getJobData());
jobLog
.
setJobClass
(
RemoteHttpJobBean
.
class
.
getName
());
//
jobLog
.
setJobData
(
jobInfo
.
getJobData
());
// jobLog.setJobClass(RemoteHttpJobBean.class.getName());
DynamicSchedulerUtil
.
xxlJobLogDao
.
save
(
jobLog
);
// jobLog.setJobData(jobInfo.getJobData());
logger
.
info
(
">>>>>>>>>>> xxl-job trigger start, jobLog:{}"
,
jobLog
);
// DynamicSchedulerUtil.xxlJobLogDao.save(jobLog);
// logger.info(">>>>>>>>>>> xxl-job trigger start, jobLog:{}", jobLog);
// trigger request
//
String
handler_params
=
jobDataMap
.
get
(
HandlerRepository
.
HANDLER_PARAMS
);
// // trigger request
String
[]
handlerParams
=
null
;
// String handler_params = jobDataMap.get(HandlerRepository.HANDLER_PARAMS);
if
(
StringUtils
.
isNotBlank
(
handler_params
))
{
// String[] handlerParams = null;
handlerParams
=
handler_params
.
split
(
","
);
// if (StringUtils.isNotBlank(handler_params)) {
}
// handlerParams = handler_params.split(",");
// }
jobLog
.
setTriggerTime
(
new
Date
());
//
jobLog
.
setTriggerStatus
(
RemoteCallBack
.
SUCCESS
);
// jobLog.setTriggerTime(new Date());
jobLog
.
setTriggerMsg
(
null
);
// jobLog.setTriggerStatus(RemoteCallBack.SUCCESS);
// jobLog.setTriggerMsg(null);
try
{
//
Object
responseMsg
=
this
.
handle
(
handlerParams
);
// try {
// Object responseMsg = this.handle(handlerParams);
jobLog
.
setHandleTime
(
new
Date
());
//
jobLog
.
setHandleStatus
(
RemoteCallBack
.
SUCCESS
);
// jobLog.setHandleTime(new Date());
jobLog
.
setHandleMsg
(
JacksonUtil
.
writeValueAsString
(
responseMsg
));
// jobLog.setHandleStatus(RemoteCallBack.SUCCESS);
}
catch
(
Exception
e
)
{
// jobLog.setHandleMsg(JacksonUtil.writeValueAsString(responseMsg));
logger
.
info
(
"HandlerThread Exception:"
,
e
);
// } catch (Exception e) {
StringWriter
out
=
new
StringWriter
();
// logger.info("HandlerThread Exception:", e);
e
.
printStackTrace
(
new
PrintWriter
(
out
));
// StringWriter out = new StringWriter();
// e.printStackTrace(new PrintWriter(out));
jobLog
.
setHandleTime
(
new
Date
());
//
jobLog
.
setHandleStatus
(
RemoteCallBack
.
FAIL
);
// jobLog.setHandleTime(new Date());
jobLog
.
setHandleMsg
(
out
.
toString
());
// jobLog.setHandleStatus(RemoteCallBack.FAIL);
}
// jobLog.setHandleMsg(out.toString());
// }
// update trigger info
//
DynamicSchedulerUtil
.
xxlJobLogDao
.
updateTriggerInfo
(
jobLog
);
// // update trigger info
DynamicSchedulerUtil
.
xxlJobLogDao
.
updateHandleInfo
(
jobLog
);
// DynamicSchedulerUtil.xxlJobLogDao.updateTriggerInfo(jobLog);
JobMonitorHelper
.
monitor
(
jobLog
.
getId
());
// DynamicSchedulerUtil.xxlJobLogDao.updateHandleInfo(jobLog);
logger
.
info
(
">>>>>>>>>>> xxl-job trigger end, jobLog.id:{}, jobLog:{}"
,
jobLog
.
getId
(),
jobLog
);
// JobMonitorHelper.monitor(jobLog.getId());
// logger.info(">>>>>>>>>>> xxl-job trigger end, jobLog.id:{}, jobLog:{}", jobLog.getId(), jobLog);
}
//
// }
public
abstract
Object
handle
(
String
...
param
);
//
// public abstract Object handle(String... param);
}
//
\ No newline at end of file
//}
\ No newline at end of file
xxl-job-admin/src/main/java/com/xxl/job/service/job/impl/DemoConcurrentJobBean.java
浏览文件 @
0e805413
package
com
.
xxl
.
job
.
service
.
job
.
impl
;
//package com.xxl.job.service.job.impl;
//
import
java.util.concurrent.TimeUnit
;
//import java.util.concurrent.TimeUnit;
//
import
org.quartz.DisallowConcurrentExecution
;
//import org.quartz.DisallowConcurrentExecution;
//
import
com.xxl.job.service.job.LocalNomalJobBean
;
//import com.xxl.job.service.job.LocalNomalJobBean;
//
/**
///**
* demo job bean for no-concurrent
// * demo job bean for no-concurrent
* @author xuxueli 2016-3-12 14:25:14
// * @author xuxueli 2016-3-12 14:25:14
*/
// */
@DisallowConcurrentExecution
// 串行;线程数要多配置几个,否则不生效;
//@Deprecated
public
class
DemoConcurrentJobBean
extends
LocalNomalJobBean
{
//@DisallowConcurrentExecution // 串行;线程数要多配置几个,否则不生效;
//public class DemoConcurrentJobBean extends LocalNomalJobBean {
@Override
//
public
Object
handle
(
String
...
param
)
{
// @Override
// public Object handle(String... param) {
try
{
//
TimeUnit
.
SECONDS
.
sleep
(
10
);
// try {
}
catch
(
InterruptedException
e
)
{
// TimeUnit.SECONDS.sleep(10);
e
.
printStackTrace
();
// } catch (InterruptedException e) {
}
// e.printStackTrace();
// }
return
false
;
//
}
// return false;
// }
}
//
//}
xxl-job-admin/src/main/java/com/xxl/job/service/job/impl/DemoNomalJobBean.java
浏览文件 @
0e805413
package
com
.
xxl
.
job
.
service
.
job
.
impl
;
//package com.xxl.job.service.job.impl;
//
import
java.util.concurrent.TimeUnit
;
//import java.util.concurrent.TimeUnit;
//
import
org.slf4j.Logger
;
//import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
//import org.slf4j.LoggerFactory;
//
import
com.xxl.job.service.job.LocalNomalJobBean
;
//import com.xxl.job.service.job.LocalNomalJobBean;
//
/**
///**
* demo job bean for concurrent
// * demo job bean for concurrent
* @author xuxueli 2016-3-12 14:25:57
// * @author xuxueli 2016-3-12 14:25:57
*/
// */
public
class
DemoNomalJobBean
extends
LocalNomalJobBean
{
//@Deprecated
private
static
Logger
Logger
=
LoggerFactory
.
getLogger
(
DemoNomalJobBean
.
class
);
//public class DemoNomalJobBean extends LocalNomalJobBean {
// private static Logger Logger = LoggerFactory.getLogger(DemoNomalJobBean.class);
@Override
//
public
Object
handle
(
String
...
param
)
{
// @Override
Logger
.
info
(
"DemoNomalJobBean run :"
+
param
);
// public Object handle(String... param) {
// Logger.info("DemoNomalJobBean run :" + param);
try
{
//
TimeUnit
.
SECONDS
.
sleep
(
10
);
// try {
}
catch
(
InterruptedException
e
)
{
// TimeUnit.SECONDS.sleep(10);
e
.
printStackTrace
();
// } catch (InterruptedException e) {
}
// e.printStackTrace();
// }
return
false
;
//
}
// return false;
// }
}
//
//}
xxl-job-admin/src/main/resources/jdbc.properties
浏览文件 @
0e805413
c3p0.driverClass
=
com.mysql.jdbc.Driver
c3p0.driverClass
=
com.mysql.jdbc.Driver
c3p0.url
=
jdbc:mysql://localhost:3306/
test
?Unicode=true&characterEncoding=UTF-8
c3p0.url
=
jdbc:mysql://localhost:3306/
xxl-job
?Unicode=true&characterEncoding=UTF-8
c3p0.user
=
root
c3p0.user
=
root
c3p0.password
=
root_pwd
c3p0.password
=
root_pwd
\ No newline at end of file
xxl-job-admin/src/main/webapp/WEB-INF/template/common/common.exception.ftl
浏览文件 @
0e805413
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
<h1>
应用程序异常
</h1>
<h1>
应用程序异常
</h1>
<p>
抱歉!您访问的页面出现异常,请稍后重试或联系管理员。
</p>
<p>
抱歉!您访问的页面出现异常,请稍后重试或联系管理员。
</p>
<p><a
href=
"javascript:showErr();"
>
详 情
</a>
<p><a
href=
"javascript:showErr();"
>
详 情
</a>
<a
href=
"javascript:window.location.href='${request.contextPath}'"
>
返 回
</a>
<a
href=
"javascript:window.location.href='${request.contextPath}
/
'"
>
返 回
</a>
</p>
</p>
<div
style=
"display:none;text-align: left;"
id=
"err"
>
${exceptionMsg}
</div>
<div
style=
"display:none;text-align: left;"
id=
"err"
>
${exceptionMsg}
</div>
</div>
</div>
...
...
xxl-job-admin/src/main/webapp/WEB-INF/template/help.ftl
浏览文件 @
0e805413
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<html>
<head>
<head>
<title>
调度中心
</title>
<title>
任务
调度中心
</title>
<
#
import
"/
common
/
common
.
macro
.
ftl
"
as
netCommon
>
<
#
import
"/
common
/
common
.
macro
.
ftl
"
as
netCommon
>
<
@
netCommon
.
commonStyle
/>
<
@
netCommon
.
commonStyle
/>
</head>
</head>
...
@@ -16,11 +16,13 @@
...
@@ -16,11 +16,13 @@
<div
class=
"content-wrapper"
>
<div
class=
"content-wrapper"
>
<!-- Content Header (Page header) -->
<!-- Content Header (Page header) -->
<section
class=
"content-header"
>
<section
class=
"content-header"
>
<h1>
使用教程
<small>
调度管理平台
</small></h1>
<h1>
任务调度中心
<small>
使用教程
</small></h1>
<!--
<ol class="breadcrumb">
<ol class="breadcrumb">
<li><a><i class="fa fa-dashboard"></i>调度中心</a></li>
<li><a><i class="fa fa-dashboard"></i>调度中心</a></li>
<li class="active">使用教程</li>
<li class="active">使用教程</li>
</ol>
</ol>
-->
</section>
</section>
<!-- Main content -->
<!-- Main content -->
...
...
xxl-job-admin/src/main/webapp/WEB-INF/template/jobcode/index.ftl
0 → 100644
浏览文件 @
0e805413
<!DOCTYPE html>
<html>
<head>
<title>
任务调度中心
</title>
<
#
import
"/
common
/
common
.
macro
.
ftl
"
as
netCommon
>
<
@
netCommon
.
commonStyle
/>
<link
rel=
"stylesheet"
href=
"${request.contextPath}/static/plugins/codemirror/lib/codemirror.css"
>
<link
rel=
"stylesheet"
href=
"${request.contextPath}/static/plugins/codemirror/addon/hint/show-hint.css"
>
<style
type=
"text/css"
>
.CodeMirror
{
border
:
0px
solid
black
;
font-size
:
16px
;
height
:
95%
;
row
:
200
;
}
</style>
</head>
<body>
<div
class=
"wrapper"
>
<div
class=
"content-wrapper"
>
<!-- Content Header (Page header) -->
<section
class=
"content-header"
>
<h1>
任务调度中心
<small>
任务CODE管理
</small></h1>
</section>
<!-- Main content -->
<section
class=
"content"
>
<div
class=
"row"
>
<div
class=
"col-xs-4"
>
<div
class=
"input-group margin"
>
<div
class=
"input-group-btn"
>
<button
type=
"button"
class=
"btn btn-default"
>
版本回溯
</button>
</div>
<select
class=
"form-control"
id=
"jobGroup"
>
<option
value=
"999"
>
逻辑调整版本C
</option>
<option
value=
"999"
>
逻辑调整版本B
</option>
<option
value=
"999"
>
逻辑调整版本A
</option>
<option
value=
"999"
>
代码初始化
</option>
</select>
</div>
</div>
<div
class=
"col-xs-4"
>
<div
class=
"input-group margin"
>
<div
class=
"input-group-btn"
>
<button
type=
"button"
class=
"btn btn-default"
>
Action
</button>
</div>
<input
type=
"text"
class=
"form-control"
id=
"jobName"
value=
"${jobName}"
autocomplete=
"on"
>
</div>
</div>
<div
class=
"col-xs-2"
>
<div
class=
"input-group margin"
>
<div
class=
"input-group-btn"
>
<button
type=
"button"
class=
"btn btn-info"
>
保存
</button>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-xs-12"
>
<div
class=
"box"
>
<textarea
id=
"editor"
>
package com.xxl.job.service.handler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.xxl.job.client.handler.IJobHandler;
public class DemoJobHandler extends IJobHandler {
private static transient Logger logger = LoggerFactory.getLogger(DemoJobHandler.class);
@Override
public JobHandleStatus handle(String... params) throws Exception {
logger.info(" ... params:" + params);
for (int i = 0; i
<
5
;
i
++)
{
TimeUnit
.
SECONDS
.
sleep
(
1
);
logger
.
info
("
handler
run:
{}",
i
);
}
return
JobHandleStatus
.
SUCCESS
;
}
}
</
textarea
>
</div>
</div>
</div>
</section>
</div>
<!-- footer -->
<
@
netCommon
.
commonFooter
/>
</div>
<
@
netCommon
.
comAlert
/>
<
@
netCommon
.
commonScript
/>
<script
src=
"${request.contextPath}/static/plugins/codemirror/lib/codemirror.js"
></script>
<script
src=
"${request.contextPath}/static/plugins/codemirror/mode/clike/clike.js"
></script>
<script
src=
"${request.contextPath}/static/plugins/codemirror/addon/hint/show-hint.js"
></script>
<script
src=
"${request.contextPath}/static/plugins/codemirror/addon/hint/anyword-hint.js"
></script>
<script
src=
"${request.contextPath}/static/js/jobcode.index.1.js"
></script>
</body>
</html>
xxl-job-admin/src/main/webapp/WEB-INF/template/jobinfo/index.ftl
浏览文件 @
0e805413
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<html>
<head>
<head>
<title>
调度中心
</title>
<title>
任务
调度中心
</title>
<
#
import
"/
common
/
common
.
macro
.
ftl
"
as
netCommon
>
<
#
import
"/
common
/
common
.
macro
.
ftl
"
as
netCommon
>
<
@
netCommon
.
commonStyle
/>
<
@
netCommon
.
commonStyle
/>
<!-- DataTables -->
<!-- DataTables -->
...
@@ -19,11 +19,13 @@
...
@@ -19,11 +19,13 @@
<div
class=
"content-wrapper"
>
<div
class=
"content-wrapper"
>
<!-- Content Header (Page header) -->
<!-- Content Header (Page header) -->
<section
class=
"content-header"
>
<section
class=
"content-header"
>
<h1>
调度管理
<small>
调度中心
</small></h1>
<h1>
任务调度中心
<small>
调度管理
</small></h1>
<!--
<ol class="breadcrumb">
<ol class="breadcrumb">
<li><a><i class="fa fa-dashboard"></i>调度管理</a></li>
<li><a><i class="fa fa-dashboard"></i>调度管理</a></li>
<li class="active">调度中心</li>
<li class="active">调度中心</li>
</ol>
</ol>
-->
</section>
</section>
<!-- Main content -->
<!-- Main content -->
...
@@ -104,7 +106,7 @@
...
@@ -104,7 +106,7 @@
<div
class=
"modal-body"
>
<div
class=
"modal-body"
>
<form
class=
"form-horizontal form"
role=
"form"
>
<form
class=
"form-horizontal form"
role=
"form"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"firstname"
class=
"col-sm-2 control-label"
>
任务组
</label>
<label
for=
"firstname"
class=
"col-sm-2 control-label"
>
任务组
<
font
color=
"red"
>
*
</font><
/label>
<div
class=
"col-sm-4"
>
<div
class=
"col-sm-4"
>
<select
class=
"form-control"
name=
"jobGroup"
>
<select
class=
"form-control"
name=
"jobGroup"
>
<
#
list
JobGroupList
as
group
>
<
#
list
JobGroupList
as
group
>
...
@@ -112,46 +114,31 @@
...
@@ -112,46 +114,31 @@
</
#
list>
</
#
list>
</select>
</select>
</div>
</div>
<label
for=
"firstname"
class=
"col-sm-2 control-label"
>
任务名
</label>
<label
for=
"firstname"
class=
"col-sm-2 control-label"
>
任务名
<
font
color=
"red"
>
*
</font><
/label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"jobName"
placeholder=
"请输入“任务名”"
minlength=
"4"
maxlength=
"100"
></div>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"jobName"
placeholder=
"请输入“任务名”"
minlength=
"4"
maxlength=
"100"
></div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
Corn
</label>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
Corn
<
font
color=
"red"
>
*
</font><
/label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"jobCron"
placeholder=
"请输入“Corn”"
maxlength=
"100"
></div>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"jobCron"
placeholder=
"请输入“Corn”"
maxlength=
"100"
></div>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
描述
</label>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
描述
<
font
color=
"red"
>
*
</font><
/label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"jobDesc"
placeholder=
"请输入“描述”"
maxlength=
"200"
></div>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"jobDesc"
placeholder=
"请输入“描述”"
maxlength=
"200"
></div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"firstname"
class=
"col-sm-2 control-label"
>
JobBean
</label>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
机器地址
<font
color=
"red"
>
*
</font></label>
<div
class=
"col-sm-4"
>
<select
class=
"form-control"
name=
"jobClass"
>
<
#
if
remoteJobBean
?
exists
>
<option
value=
"${remoteJobBean.name}"
jobClassType=
"remote"
>
【远程任务】
</option>
</
#
if>
<
#
if
localJobBeanList
?
exists
&&
localJobBeanList
?
size
gt
0
>
<
#
list
localJobBeanList
as
localJobBean
>
<option
value=
"${localJobBean.name}"
jobClassType=
"local"
>
${localJobBean.name}
</option>
</
#
list>
</
#
if>
</select>
</div>
<label
for=
"firstname"
class=
"col-sm-2 control-label"
>
执行参数
</label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"handler_params"
placeholder=
"请输入“执行参数”"
maxlength=
"100"
></div>
</div>
<div
class=
"form-group remote_panel"
>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
远程-机器地址
</label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"handler_address"
placeholder=
"请输入“远程-机器地址”"
maxlength=
"200"
></div>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"handler_address"
placeholder=
"请输入“远程-机器地址”"
maxlength=
"200"
></div>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
远程-执行器
</label>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
执行器
<font
color=
"red"
>
*
</font>
</label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"handler_name"
placeholder=
"请输入“远程-执行器”"
maxlength=
"200"
></div>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"handler_name"
placeholder=
"请输入“远程-执行器”"
maxlength=
"200"
></div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
负责人
</label>
<label
for=
"firstname"
class=
"col-sm-2 control-label"
>
执行参数
<font
color=
"black"
>
*
</font></label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"handler_params"
placeholder=
"请输入“执行参数”"
maxlength=
"100"
></div>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
负责人
<font
color=
"red"
>
*
</font></label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"author"
placeholder=
"请输入“负责人”"
maxlength=
"200"
></div>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"author"
placeholder=
"请输入“负责人”"
maxlength=
"200"
></div>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
报警邮件
</label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"alarmEmail"
placeholder=
"请输入“报警邮件”,多个邮件地址逗号分隔"
maxlength=
"200"
></div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
报警阈值
</label>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
报警邮件
<font
color=
"red"
>
*
</font></label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"alarmEmail"
placeholder=
"请输入“报警邮件”,多个邮件地址逗号分隔"
maxlength=
"200"
></div>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
报警阈值
<font
color=
"red"
>
*
</font></label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"alarmThreshold"
placeholder=
"请输入“报警阈值”"
maxlength=
"200"
></div>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"alarmThreshold"
placeholder=
"请输入“报警阈值”"
maxlength=
"200"
></div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
...
@@ -176,37 +163,34 @@
...
@@ -176,37 +163,34 @@
<div
class=
"modal-body"
>
<div
class=
"modal-body"
>
<form
class=
"form-horizontal form"
role=
"form"
>
<form
class=
"form-horizontal form"
role=
"form"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"firstname"
class=
"col-sm-2 control-label"
>
任务组
</label>
<label
for=
"firstname"
class=
"col-sm-2 control-label"
>
任务组
<
font
color=
"red"
>
*
</font><
/label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"jobGroup"
placeholder=
"请输入“任务组”"
minlength=
"4"
maxlength=
"100"
readonly
></div>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"jobGroup"
placeholder=
"请输入“任务组”"
minlength=
"4"
maxlength=
"100"
readonly
></div>
<label
for=
"firstname"
class=
"col-sm-2 control-label"
>
任务名
</label>
<label
for=
"firstname"
class=
"col-sm-2 control-label"
>
任务名
<
font
color=
"red"
>
*
</font><
/label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"jobName"
placeholder=
"请输入“任务名”"
minlength=
"4"
maxlength=
"100"
readonly
></div>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"jobName"
placeholder=
"请输入“任务名”"
minlength=
"4"
maxlength=
"100"
readonly
></div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
Corn
</label>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
Corn
<
font
color=
"red"
>
*
</font><
/label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"jobCron"
placeholder=
"请输入“Corn”"
maxlength=
"100"
></div>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"jobCron"
placeholder=
"请输入“Corn”"
maxlength=
"100"
></div>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
描述
</label>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
描述
<
font
color=
"red"
>
*
</font><
/label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"jobDesc"
placeholder=
"请输入“描述”"
maxlength=
"200"
></div>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"jobDesc"
placeholder=
"请输入“描述”"
maxlength=
"200"
></div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"firstname"
class=
"col-sm-2 control-label"
>
JobBean
</label>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
机器地址
<font
color=
"red"
>
*
</font></label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"jobClass"
placeholder=
"请输入“执行参数”"
maxlength=
"100"
readonly
></div>
<label
for=
"firstname"
class=
"col-sm-2 control-label"
>
执行参数
</label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"handler_params"
placeholder=
"请输入“执行参数”"
maxlength=
"100"
></div>
</div>
<div
class=
"form-group remote_panel"
>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
远程-机器地址
</label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"handler_address"
placeholder=
"请输入“远程-机器地址”"
maxlength=
"200"
></div>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"handler_address"
placeholder=
"请输入“远程-机器地址”"
maxlength=
"200"
></div>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
远程-执行器
</label>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
执行器
<font
color=
"red"
>
*
</font>
</label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"handler_name"
placeholder=
"请输入“远程-执行器”"
maxlength=
"200"
></div>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"handler_name"
placeholder=
"请输入“远程-执行器”"
maxlength=
"200"
></div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
负责人
</label>
<label
for=
"firstname"
class=
"col-sm-2 control-label"
>
执行参数
<font
color=
"black"
>
*
</font></label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"handler_params"
placeholder=
"请输入“执行参数”"
maxlength=
"100"
></div>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
负责人
<font
color=
"red"
>
*
</font></label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"author"
placeholder=
"请输入“负责人”"
maxlength=
"200"
></div>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"author"
placeholder=
"请输入“负责人”"
maxlength=
"200"
></div>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
报警邮件
</label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"alarmEmail"
placeholder=
"请输入“报警邮件”,多个邮件地址逗号分隔"
maxlength=
"200"
></div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
报警阈值
</label>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
报警邮件
<font
color=
"red"
>
*
</font></label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"alarmEmail"
placeholder=
"请输入“报警邮件”,多个邮件地址逗号分隔"
maxlength=
"200"
></div>
<label
for=
"lastname"
class=
"col-sm-2 control-label"
>
报警阈值
<font
color=
"red"
>
*
</font></label>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"alarmThreshold"
placeholder=
"请输入“报警阈值”"
maxlength=
"200"
></div>
<div
class=
"col-sm-4"
><input
type=
"text"
class=
"form-control"
name=
"alarmThreshold"
placeholder=
"请输入“报警阈值”"
maxlength=
"200"
></div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
...
...
xxl-job-admin/src/main/webapp/WEB-INF/template/joblog/index.ftl
浏览文件 @
0e805413
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<html>
<head>
<head>
<title>
调度日志
</title>
<title>
任务调度中心
</title>
<
#
import
"/
common
/
common
.
macro
.
ftl
"
as
netCommon
>
<
#
import
"/
common
/
common
.
macro
.
ftl
"
as
netCommon
>
<
@
netCommon
.
commonStyle
/>
<
@
netCommon
.
commonStyle
/>
<!-- DataTables -->
<!-- DataTables -->
...
@@ -20,11 +20,13 @@
...
@@ -20,11 +20,13 @@
<div
class=
"content-wrapper"
>
<div
class=
"content-wrapper"
>
<!-- Content Header (Page header) -->
<!-- Content Header (Page header) -->
<section
class=
"content-header"
>
<section
class=
"content-header"
>
<h1>
调度日志
<small>
调度中心
</small></h1>
<h1>
任务调度中心
<small>
调度日志
</small></h1>
<!--
<ol class="breadcrumb">
<ol class="breadcrumb">
<li><a><i class="fa fa-dashboard"></i>调度日志</a></li>
<li><a><i class="fa fa-dashboard"></i>调度日志</a></li>
<li class="active">调度管理</li>
<li class="active">调度管理</li>
</ol>
</ol>
-->
</section>
</section>
<!-- Main content -->
<!-- Main content -->
...
...
xxl-job-admin/src/main/webapp/static/js/common.1.js
浏览文件 @
0e805413
...
@@ -21,7 +21,7 @@ $(function(){
...
@@ -21,7 +21,7 @@ $(function(){
$
.
post
(
base_url
+
"/logout"
,
function
(
data
,
status
)
{
$
.
post
(
base_url
+
"/logout"
,
function
(
data
,
status
)
{
if
(
data
.
code
==
"200"
)
{
if
(
data
.
code
==
"200"
)
{
ComAlert
.
show
(
1
,
"注销成功"
,
function
(){
ComAlert
.
show
(
1
,
"注销成功"
,
function
(){
window
.
location
.
href
=
base_url
;
window
.
location
.
href
=
base_url
+
"/"
;
});
});
}
else
{
}
else
{
ComAlert
.
show
(
1
,
data
.
msg
);
ComAlert
.
show
(
1
,
data
.
msg
);
...
...
xxl-job-admin/src/main/webapp/static/js/jobcode.index.1.js
0 → 100644
浏览文件 @
0e805413
$
(
function
()
{
var
javaEditor
=
CodeMirror
.
fromTextArea
(
document
.
getElementById
(
"editor"
),
{
mode
:
"text/x-java"
,
lineNumbers
:
true
,
matchBrackets
:
true
,
extraKeys
:
{
"F11"
:
function
(
cm
)
{
cm
.
setOption
(
"fullScreen"
,
!
cm
.
getOption
(
"fullScreen"
));
},
"Esc"
:
function
(
cm
)
{
if
(
cm
.
getOption
(
"fullScreen"
))
cm
.
setOption
(
"fullScreen"
,
false
);
}
}
});
});
xxl-job-admin/src/main/webapp/static/js/jobinfo.index.1.js
浏览文件 @
0e805413
...
@@ -81,12 +81,14 @@ $(function() {
...
@@ -81,12 +81,14 @@ $(function() {
// status
// status
var
pause_resume
=
""
;
var
pause_resume
=
""
;
if
(
'NORMAL'
==
row
.
jobStatus
)
{
if
(
'NORMAL'
==
row
.
jobStatus
)
{
pause_resume
=
'<button class="btn btn-
info
btn-xs job_operate" type="job_pause" type="button">暂停</button> '
;
pause_resume
=
'<button class="btn btn-
primary
btn-xs job_operate" type="job_pause" type="button">暂停</button> '
;
}
else
if
(
'PAUSED'
==
row
.
jobStatus
){
}
else
if
(
'PAUSED'
==
row
.
jobStatus
){
pause_resume
=
'<button class="btn btn-
info
btn-xs job_operate" type="job_resume" type="button">恢复</button> '
;
pause_resume
=
'<button class="btn btn-
primary
btn-xs job_operate" type="job_resume" type="button">恢复</button> '
;
}
}
// log url
// log url
var
logUrl
=
base_url
+
'/joblog?jobGroup='
+
row
.
jobGroup
+
'&jobName='
+
row
.
jobName
;
var
logUrl
=
base_url
+
'/joblog?jobGroup='
+
row
.
jobGroup
+
'&jobName='
+
row
.
jobName
;
// log url
var
codeUrl
=
base_url
+
'/jobcode?id='
+
row
.
id
;
// job data
// job data
var
jobDataMap
=
eval
(
'('
+
row
.
jobData
+
')'
);
var
jobDataMap
=
eval
(
'('
+
row
.
jobData
+
')'
);
...
@@ -105,11 +107,11 @@ $(function() {
...
@@ -105,11 +107,11 @@ $(function() {
' handler_address="'
+
jobDataMap
.
handler_address
+
'" '
+
' handler_address="'
+
jobDataMap
.
handler_address
+
'" '
+
' handler_name="'
+
jobDataMap
.
handler_name
+
'" '
+
' handler_name="'
+
jobDataMap
.
handler_name
+
'" '
+
'>'
+
'>'
+
pause_resume
+
'<button class="btn btn-primary btn-xs job_operate" type="job_trigger" type="button">执行</button> '
+
'<button class="btn btn-info btn-xs job_operate" type="job_trigger" type="button">执行</button>'
+
pause_resume
+
'<button class="btn btn-
warning btn-xs update" type="button">编辑</button><br>
'
+
'<button class="btn btn-
primary btn-xs" type="job_del" type="button" onclick="javascript:window.open(
\'
'
+
logUrl
+
'
\'
)" >日志</button><br>
'
+
'<button class="btn btn-warning btn-xs" type="job_del" type="button"
'
+
'<button class="btn btn-warning btn-xs update" type="button">编辑</button>
'
+
'onclick="javascript:window.open(
\'
'
+
logUrl
+
'
\'
)" >查看日志</button>
'
+
'<button class="btn btn-warning btn-xs" type="button" onclick="javascript:window.open(
\'
'
+
codeUrl
+
'
\'
)" >CODE</button>
'
+
'<button class="btn btn-danger btn-xs job_operate" type="job_del" type="button">删除</button> '
+
'<button class="btn btn-danger btn-xs job_operate" type="job_del" type="button">删除</button> '
+
'</p>'
;
'</p>'
;
...
@@ -263,12 +265,12 @@ $(function() {
...
@@ -263,12 +265,12 @@ $(function() {
maxlength
:
"“任务描述”长度不应超过200位"
maxlength
:
"“任务描述”长度不应超过200位"
},
},
handler_address
:
{
handler_address
:
{
required
:
"请输入“
远程-
机器地址”."
,
required
:
"请输入“机器地址”."
,
maxlength
:
"“
远程-
机器地址”长度不应超过200位"
maxlength
:
"“机器地址”长度不应超过200位"
},
},
handler_name
:
{
handler_name
:
{
required
:
"请输入“
远程-
执行器”."
,
required
:
"请输入“执行器”."
,
maxlength
:
"“
远程-
执行器”长度不应超过200位"
maxlength
:
"“执行器”长度不应超过200位"
},
},
author
:
{
author
:
{
required
:
"请输入“负责人”."
,
required
:
"请输入“负责人”."
,
...
@@ -316,38 +318,19 @@ $(function() {
...
@@ -316,38 +318,19 @@ $(function() {
$
(
".remote_panel"
).
show
();
// remote
$
(
".remote_panel"
).
show
();
// remote
});
});
// 远程任务/本地任务,切换
$
(
"#addModal select[name='jobClass']"
).
change
(
function
()
{
//console.log( $(this).val().indexOf('RemoteHttpJobBean') );
if
(
$
(
this
).
val
().
indexOf
(
'RemoteHttpJobBean'
)
>
-
1
){
$
(
".remote_panel"
).
show
();
// remote
}
else
if
(
$
(
this
).
val
().
indexOf
(
'RemoteHttpJobBean'
)
==
-
1
){
$
(
".remote_panel"
).
hide
();
// local
}
});
// 更新
// 更新
$
(
"#job_list"
).
on
(
'click'
,
'.update'
,
function
()
{
$
(
"#job_list"
).
on
(
'click'
,
'.update'
,
function
()
{
$
(
"#updateModal .form input[name='jobGroup']"
).
val
(
$
(
this
).
parent
(
'p'
).
attr
(
"jobGroup"
));
$
(
"#updateModal .form input[name='jobGroup']"
).
val
(
$
(
this
).
parent
(
'p'
).
attr
(
"jobGroup"
));
$
(
"#updateModal .form input[name='jobName']"
).
val
(
$
(
this
).
parent
(
'p'
).
attr
(
"jobName"
));
$
(
"#updateModal .form input[name='jobName']"
).
val
(
$
(
this
).
parent
(
'p'
).
attr
(
"jobName"
));
$
(
"#updateModal .form input[name='jobCron']"
).
val
(
$
(
this
).
parent
(
'p'
).
attr
(
"jobCron"
));
$
(
"#updateModal .form input[name='jobCron']"
).
val
(
$
(
this
).
parent
(
'p'
).
attr
(
"jobCron"
));
$
(
"#updateModal .form input[name='jobDesc']"
).
val
(
$
(
this
).
parent
(
'p'
).
attr
(
"jobDesc"
));
$
(
"#updateModal .form input[name='jobDesc']"
).
val
(
$
(
this
).
parent
(
'p'
).
attr
(
"jobDesc"
));
$
(
"#updateModal .form input[name='jobClass']"
).
val
(
$
(
this
).
parent
(
'p'
).
attr
(
"jobClass"
));
$
(
"#updateModal .form input[name='handler_params']"
).
val
(
$
(
this
).
parent
(
'p'
).
attr
(
"handler_params"
));
$
(
"#updateModal .form input[name='handler_address']"
).
val
(
$
(
this
).
parent
(
'p'
).
attr
(
"handler_address"
));
$
(
"#updateModal .form input[name='handler_address']"
).
val
(
$
(
this
).
parent
(
'p'
).
attr
(
"handler_address"
));
$
(
"#updateModal .form input[name='handler_name']"
).
val
(
$
(
this
).
parent
(
'p'
).
attr
(
"handler_name"
));
$
(
"#updateModal .form input[name='handler_name']"
).
val
(
$
(
this
).
parent
(
'p'
).
attr
(
"handler_name"
));
$
(
"#updateModal .form input[name='handler_params']"
).
val
(
$
(
this
).
parent
(
'p'
).
attr
(
"handler_params"
));
$
(
"#updateModal .form input[name='author']"
).
val
(
$
(
this
).
parent
(
'p'
).
attr
(
"author"
));
$
(
"#updateModal .form input[name='author']"
).
val
(
$
(
this
).
parent
(
'p'
).
attr
(
"author"
));
$
(
"#updateModal .form input[name='alarmEmail']"
).
val
(
$
(
this
).
parent
(
'p'
).
attr
(
"alarmEmail"
));
$
(
"#updateModal .form input[name='alarmEmail']"
).
val
(
$
(
this
).
parent
(
'p'
).
attr
(
"alarmEmail"
));
$
(
"#updateModal .form input[name='alarmThreshold']"
).
val
(
$
(
this
).
parent
(
'p'
).
attr
(
"alarmThreshold"
));
$
(
"#updateModal .form input[name='alarmThreshold']"
).
val
(
$
(
this
).
parent
(
'p'
).
attr
(
"alarmThreshold"
));
var
_jobClass
=
$
(
this
).
parent
(
'p'
).
attr
(
"jobClass"
);
if
(
_jobClass
.
indexOf
(
'RemoteHttpJobBean'
)
>
-
1
){
$
(
".remote_panel"
).
show
();
// remote
}
else
if
(
$
(
this
).
val
().
indexOf
(
'RemoteHttpJobBean'
)
==
-
1
){
$
(
".remote_panel"
).
hide
();
// local
}
$
(
'#updateModal'
).
modal
({
backdrop
:
false
,
keyboard
:
false
}).
modal
(
'show'
);
$
(
'#updateModal'
).
modal
({
backdrop
:
false
,
keyboard
:
false
}).
modal
(
'show'
);
});
});
var
updateModalValidate
=
$
(
"#updateModal .form"
).
validate
({
var
updateModalValidate
=
$
(
"#updateModal .form"
).
validate
({
...
@@ -394,12 +377,12 @@ $(function() {
...
@@ -394,12 +377,12 @@ $(function() {
maxlength
:
"“任务描述”长度不应超过200位"
maxlength
:
"“任务描述”长度不应超过200位"
},
},
handler_address
:
{
handler_address
:
{
required
:
"请输入“
远程-
机器地址”."
,
required
:
"请输入“机器地址”."
,
maxlength
:
"“
远程-
机器地址”长度不应超过200位"
maxlength
:
"“机器地址”长度不应超过200位"
},
},
handler_name
:
{
handler_name
:
{
required
:
"请输入“
远程-
执行器”."
,
required
:
"请输入“执行器”."
,
maxlength
:
"“
远程-
执行器”长度不应超过200位"
maxlength
:
"“执行器”长度不应超过200位"
},
},
author
:
{
author
:
{
required
:
"请输入“负责人”."
,
required
:
"请输入“负责人”."
,
...
...
xxl-job-admin/src/main/webapp/static/plugins/codemirror/addon/hint/anyword-hint.js
0 → 100644
浏览文件 @
0e805413
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(
function
(
mod
)
{
if
(
typeof
exports
==
"object"
&&
typeof
module
==
"object"
)
// CommonJS
mod
(
require
(
"../../lib/codemirror"
));
else
if
(
typeof
define
==
"function"
&&
define
.
amd
)
// AMD
define
([
"../../lib/codemirror"
],
mod
);
else
// Plain browser env
mod
(
CodeMirror
);
})(
function
(
CodeMirror
)
{
"use strict"
;
var
WORD
=
/
[\w
$
]
+/
,
RANGE
=
500
;
CodeMirror
.
registerHelper
(
"hint"
,
"anyword"
,
function
(
editor
,
options
)
{
var
word
=
options
&&
options
.
word
||
WORD
;
var
range
=
options
&&
options
.
range
||
RANGE
;
var
cur
=
editor
.
getCursor
(),
curLine
=
editor
.
getLine
(
cur
.
line
);
var
end
=
cur
.
ch
,
start
=
end
;
while
(
start
&&
word
.
test
(
curLine
.
charAt
(
start
-
1
)))
--
start
;
var
curWord
=
start
!=
end
&&
curLine
.
slice
(
start
,
end
);
var
list
=
options
&&
options
.
list
||
[],
seen
=
{};
var
re
=
new
RegExp
(
word
.
source
,
"g"
);
for
(
var
dir
=
-
1
;
dir
<=
1
;
dir
+=
2
)
{
var
line
=
cur
.
line
,
endLine
=
Math
.
min
(
Math
.
max
(
line
+
dir
*
range
,
editor
.
firstLine
()),
editor
.
lastLine
())
+
dir
;
for
(;
line
!=
endLine
;
line
+=
dir
)
{
var
text
=
editor
.
getLine
(
line
),
m
;
while
(
m
=
re
.
exec
(
text
))
{
if
(
line
==
cur
.
line
&&
m
[
0
]
===
curWord
)
continue
;
if
((
!
curWord
||
m
[
0
].
lastIndexOf
(
curWord
,
0
)
==
0
)
&&
!
Object
.
prototype
.
hasOwnProperty
.
call
(
seen
,
m
[
0
]))
{
seen
[
m
[
0
]]
=
true
;
list
.
push
(
m
[
0
]);
}
}
}
}
return
{
list
:
list
,
from
:
CodeMirror
.
Pos
(
cur
.
line
,
start
),
to
:
CodeMirror
.
Pos
(
cur
.
line
,
end
)};
});
});
xxl-job-admin/src/main/webapp/static/plugins/codemirror/addon/hint/show-hint.css
0 → 100644
浏览文件 @
0e805413
.CodeMirror-hints
{
position
:
absolute
;
z-index
:
10
;
overflow
:
hidden
;
list-style
:
none
;
margin
:
0
;
padding
:
2px
;
-webkit-box-shadow
:
2px
3px
5px
rgba
(
0
,
0
,
0
,
.2
);
-moz-box-shadow
:
2px
3px
5px
rgba
(
0
,
0
,
0
,
.2
);
box-shadow
:
2px
3px
5px
rgba
(
0
,
0
,
0
,
.2
);
border-radius
:
3px
;
border
:
1px
solid
silver
;
background
:
white
;
font-size
:
90%
;
font-family
:
monospace
;
max-height
:
20em
;
overflow-y
:
auto
;
}
.CodeMirror-hint
{
margin
:
0
;
padding
:
0
4px
;
border-radius
:
2px
;
max-width
:
19em
;
overflow
:
hidden
;
white-space
:
pre
;
color
:
black
;
cursor
:
pointer
;
}
li
.CodeMirror-hint-active
{
background
:
#08f
;
color
:
white
;
}
xxl-job-admin/src/main/webapp/static/plugins/codemirror/addon/hint/show-hint.js
0 → 100644
浏览文件 @
0e805413
差异被折叠。
点击展开。
xxl-job-admin/src/main/webapp/static/plugins/codemirror/lib/codemirror.css
0 → 100644
浏览文件 @
0e805413
/* BASICS */
.CodeMirror
{
/* Set height, width, borders, and global font properties here */
font-family
:
monospace
;
height
:
300px
;
color
:
black
;
}
/* PADDING */
.CodeMirror-lines
{
padding
:
4px
0
;
/* Vertical padding around content */
}
.CodeMirror
pre
{
padding
:
0
4px
;
/* Horizontal padding of content */
}
.CodeMirror-scrollbar-filler
,
.CodeMirror-gutter-filler
{
background-color
:
white
;
/* The little square between H and V scrollbars */
}
/* GUTTER */
.CodeMirror-gutters
{
border-right
:
1px
solid
#ddd
;
background-color
:
#f7f7f7
;
white-space
:
nowrap
;
}
.CodeMirror-linenumbers
{}
.CodeMirror-linenumber
{
padding
:
0
3px
0
5px
;
min-width
:
20px
;
text-align
:
right
;
color
:
#999
;
white-space
:
nowrap
;
}
.CodeMirror-guttermarker
{
color
:
black
;
}
.CodeMirror-guttermarker-subtle
{
color
:
#999
;
}
/* CURSOR */
.CodeMirror-cursor
{
border-left
:
1px
solid
black
;
border-right
:
none
;
width
:
0
;
}
/* Shown when moving in bi-directional text */
.CodeMirror
div
.CodeMirror-secondarycursor
{
border-left
:
1px
solid
silver
;
}
.cm-fat-cursor
.CodeMirror-cursor
{
width
:
auto
;
border
:
0
;
background
:
#7e7
;
}
.cm-fat-cursor
div
.CodeMirror-cursors
{
z-index
:
1
;
}
.cm-animate-fat-cursor
{
width
:
auto
;
border
:
0
;
-webkit-animation
:
blink
1.06s
steps
(
1
)
infinite
;
-moz-animation
:
blink
1.06s
steps
(
1
)
infinite
;
animation
:
blink
1.06s
steps
(
1
)
infinite
;
background-color
:
#7e7
;
}
@-moz-keyframes
blink
{
0
%
{}
50
%
{
background-color
:
transparent
;
}
100
%
{}
}
@-webkit-keyframes
blink
{
0
%
{}
50
%
{
background-color
:
transparent
;
}
100
%
{}
}
@keyframes
blink
{
0
%
{}
50
%
{
background-color
:
transparent
;
}
100
%
{}
}
/* Can style cursor different in overwrite (non-insert) mode */
.CodeMirror-overwrite
.CodeMirror-cursor
{}
.cm-tab
{
display
:
inline-block
;
text-decoration
:
inherit
;
}
.CodeMirror-ruler
{
border-left
:
1px
solid
#ccc
;
position
:
absolute
;
}
/* DEFAULT THEME */
.cm-s-default
.cm-header
{
color
:
blue
;}
.cm-s-default
.cm-quote
{
color
:
#090
;}
.cm-negative
{
color
:
#d44
;}
.cm-positive
{
color
:
#292
;}
.cm-header
,
.cm-strong
{
font-weight
:
bold
;}
.cm-em
{
font-style
:
italic
;}
.cm-link
{
text-decoration
:
underline
;}
.cm-strikethrough
{
text-decoration
:
line-through
;}
.cm-s-default
.cm-keyword
{
color
:
#708
;}
.cm-s-default
.cm-atom
{
color
:
#219
;}
.cm-s-default
.cm-number
{
color
:
#164
;}
.cm-s-default
.cm-def
{
color
:
#00f
;}
.cm-s-default
.cm-variable
,
.cm-s-default
.cm-punctuation
,
.cm-s-default
.cm-property
,
.cm-s-default
.cm-operator
{}
.cm-s-default
.cm-variable-2
{
color
:
#05a
;}
.cm-s-default
.cm-variable-3
{
color
:
#085
;}
.cm-s-default
.cm-comment
{
color
:
#a50
;}
.cm-s-default
.cm-string
{
color
:
#a11
;}
.cm-s-default
.cm-string-2
{
color
:
#f50
;}
.cm-s-default
.cm-meta
{
color
:
#555
;}
.cm-s-default
.cm-qualifier
{
color
:
#555
;}
.cm-s-default
.cm-builtin
{
color
:
#30a
;}
.cm-s-default
.cm-bracket
{
color
:
#997
;}
.cm-s-default
.cm-tag
{
color
:
#170
;}
.cm-s-default
.cm-attribute
{
color
:
#00c
;}
.cm-s-default
.cm-hr
{
color
:
#999
;}
.cm-s-default
.cm-link
{
color
:
#00c
;}
.cm-s-default
.cm-error
{
color
:
#f00
;}
.cm-invalidchar
{
color
:
#f00
;}
.CodeMirror-composing
{
border-bottom
:
2px
solid
;
}
/* Default styles for common addons */
div
.CodeMirror
span
.CodeMirror-matchingbracket
{
color
:
#0f0
;}
div
.CodeMirror
span
.CodeMirror-nonmatchingbracket
{
color
:
#f22
;}
.CodeMirror-matchingtag
{
background
:
rgba
(
255
,
150
,
0
,
.3
);
}
.CodeMirror-activeline-background
{
background
:
#e8f2ff
;}
/* STOP */
/* The rest of this file contains styles related to the mechanics of
the editor. You probably shouldn't touch them. */
.CodeMirror
{
position
:
relative
;
overflow
:
hidden
;
background
:
white
;
}
.CodeMirror-scroll
{
overflow
:
scroll
!important
;
/* Things will break if this is overridden */
/* 30px is the magic margin used to hide the element's real scrollbars */
/* See overflow: hidden in .CodeMirror */
margin-bottom
:
-30px
;
margin-right
:
-30px
;
padding-bottom
:
30px
;
height
:
100%
;
outline
:
none
;
/* Prevent dragging from highlighting the element */
position
:
relative
;
}
.CodeMirror-sizer
{
position
:
relative
;
border-right
:
30px
solid
transparent
;
}
/* The fake, visible scrollbars. Used to force redraw during scrolling
before actual scrolling happens, thus preventing shaking and
flickering artifacts. */
.CodeMirror-vscrollbar
,
.CodeMirror-hscrollbar
,
.CodeMirror-scrollbar-filler
,
.CodeMirror-gutter-filler
{
position
:
absolute
;
z-index
:
6
;
display
:
none
;
}
.CodeMirror-vscrollbar
{
right
:
0
;
top
:
0
;
overflow-x
:
hidden
;
overflow-y
:
scroll
;
}
.CodeMirror-hscrollbar
{
bottom
:
0
;
left
:
0
;
overflow-y
:
hidden
;
overflow-x
:
scroll
;
}
.CodeMirror-scrollbar-filler
{
right
:
0
;
bottom
:
0
;
}
.CodeMirror-gutter-filler
{
left
:
0
;
bottom
:
0
;
}
.CodeMirror-gutters
{
position
:
absolute
;
left
:
0
;
top
:
0
;
min-height
:
100%
;
z-index
:
3
;
}
.CodeMirror-gutter
{
white-space
:
normal
;
height
:
100%
;
display
:
inline-block
;
vertical-align
:
top
;
margin-bottom
:
-30px
;
/* Hack to make IE7 behave */
*
zoom
:
1
;
*
display
:
inline
;
}
.CodeMirror-gutter-wrapper
{
position
:
absolute
;
z-index
:
4
;
background
:
none
!important
;
border
:
none
!important
;
}
.CodeMirror-gutter-background
{
position
:
absolute
;
top
:
0
;
bottom
:
0
;
z-index
:
4
;
}
.CodeMirror-gutter-elt
{
position
:
absolute
;
cursor
:
default
;
z-index
:
4
;
}
.CodeMirror-gutter-wrapper
{
-webkit-user-select
:
none
;
-moz-user-select
:
none
;
user-select
:
none
;
}
.CodeMirror-lines
{
cursor
:
text
;
min-height
:
1px
;
/* prevents collapsing before first draw */
}
.CodeMirror
pre
{
/* Reset some styles that the rest of the page might have set */
-moz-border-radius
:
0
;
-webkit-border-radius
:
0
;
border-radius
:
0
;
border-width
:
0
;
background
:
transparent
;
font-family
:
inherit
;
font-size
:
inherit
;
margin
:
0
;
white-space
:
pre
;
word-wrap
:
normal
;
line-height
:
inherit
;
color
:
inherit
;
z-index
:
2
;
position
:
relative
;
overflow
:
visible
;
-webkit-tap-highlight-color
:
transparent
;
-webkit-font-variant-ligatures
:
none
;
font-variant-ligatures
:
none
;
}
.CodeMirror-wrap
pre
{
word-wrap
:
break-word
;
white-space
:
pre-wrap
;
word-break
:
normal
;
}
.CodeMirror-linebackground
{
position
:
absolute
;
left
:
0
;
right
:
0
;
top
:
0
;
bottom
:
0
;
z-index
:
0
;
}
.CodeMirror-linewidget
{
position
:
relative
;
z-index
:
2
;
overflow
:
auto
;
}
.CodeMirror-widget
{}
.CodeMirror-code
{
outline
:
none
;
}
/* Force content-box sizing for the elements where we expect it */
.CodeMirror-scroll
,
.CodeMirror-sizer
,
.CodeMirror-gutter
,
.CodeMirror-gutters
,
.CodeMirror-linenumber
{
-moz-box-sizing
:
content-box
;
box-sizing
:
content-box
;
}
.CodeMirror-measure
{
position
:
absolute
;
width
:
100%
;
height
:
0
;
overflow
:
hidden
;
visibility
:
hidden
;
}
.CodeMirror-cursor
{
position
:
absolute
;
}
.CodeMirror-measure
pre
{
position
:
static
;
}
div
.CodeMirror-cursors
{
visibility
:
hidden
;
position
:
relative
;
z-index
:
3
;
}
div
.CodeMirror-dragcursors
{
visibility
:
visible
;
}
.CodeMirror-focused
div
.CodeMirror-cursors
{
visibility
:
visible
;
}
.CodeMirror-selected
{
background
:
#d9d9d9
;
}
.CodeMirror-focused
.CodeMirror-selected
{
background
:
#d7d4f0
;
}
.CodeMirror-crosshair
{
cursor
:
crosshair
;
}
.CodeMirror-line
::selection
,
.CodeMirror-line
>
span
::selection
,
.CodeMirror-line
>
span
>
span
::selection
{
background
:
#d7d4f0
;
}
.CodeMirror-line
::-moz-selection
,
.CodeMirror-line
>
span
::-moz-selection
,
.CodeMirror-line
>
span
>
span
::-moz-selection
{
background
:
#d7d4f0
;
}
.cm-searching
{
background
:
#ffa
;
background
:
rgba
(
255
,
255
,
0
,
.4
);
}
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
.CodeMirror
span
{
*
vertical-align
:
text-bottom
;
}
/* Used to force a border model for a node */
.cm-force-border
{
padding-right
:
.1px
;
}
@media
print
{
/* Hide the cursor when printing */
.CodeMirror
div
.CodeMirror-cursors
{
visibility
:
hidden
;
}
}
/* See issue #2901 */
.cm-tab-wrap-hack
:after
{
content
:
''
;
}
/* Help users use markselection to safely style text background */
span
.CodeMirror-selectedtext
{
background
:
none
;
}
xxl-job-admin/src/main/webapp/static/plugins/codemirror/lib/codemirror.js
0 → 100644
浏览文件 @
0e805413
差异被折叠。
点击展开。
xxl-job-admin/src/main/webapp/static/plugins/codemirror/mode/clike/clike.js
0 → 100644
浏览文件 @
0e805413
差异被折叠。
点击展开。
xxl-job-admin/src/main/webapp/static/plugins/codemirror/mode/clike/test.js
0 → 100644
浏览文件 @
0e805413
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(
function
()
{
var
mode
=
CodeMirror
.
getMode
({
indentUnit
:
2
},
"text/x-c"
);
function
MT
(
name
)
{
test
.
mode
(
name
,
mode
,
Array
.
prototype
.
slice
.
call
(
arguments
,
1
));
}
MT
(
"indent"
,
"[variable-3 void] [def foo]([variable-3 void*] [variable a], [variable-3 int] [variable b]) {"
,
" [variable-3 int] [variable c] [operator =] [variable b] [operator +]"
,
" [number 1];"
,
" [keyword return] [operator *][variable a];"
,
"}"
);
MT
(
"indent_switch"
,
"[keyword switch] ([variable x]) {"
,
" [keyword case] [number 10]:"
,
" [keyword return] [number 20];"
,
" [keyword default]:"
,
" [variable printf]([string
\"
foo %c
\"
], [variable x]);"
,
"}"
);
MT
(
"def"
,
"[variable-3 void] [def foo]() {}"
,
"[keyword struct] [def bar]{}"
,
"[variable-3 int] [variable-3 *][def baz]() {}"
);
MT
(
"double_block"
,
"[keyword for] (;;)"
,
" [keyword for] (;;)"
,
" [variable x][operator ++];"
,
"[keyword return];"
);
MT
(
"preprocessor"
,
"[meta #define FOO 3]"
,
"[variable-3 int] [variable foo];"
,
"[meta #define BAR
\\
]"
,
"[meta 4]"
,
"[variable-3 unsigned] [variable-3 int] [variable bar] [operator =] [number 8];"
,
"[meta #include <baz> ][comment // comment]"
)
var
mode_cpp
=
CodeMirror
.
getMode
({
indentUnit
:
2
},
"text/x-c++src"
);
function
MTCPP
(
name
)
{
test
.
mode
(
name
,
mode_cpp
,
Array
.
prototype
.
slice
.
call
(
arguments
,
1
));
}
MTCPP
(
"cpp14_literal"
,
"[number 10'000];"
,
"[number 0b10'000];"
,
"[number 0x10'000];"
,
"[string '100000'];"
);
})();
xxl-job-admin/src/main/webapp/static/plugins/codemirror/mode/groovy/groovy.js
0 → 100644
浏览文件 @
0e805413
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(
function
(
mod
)
{
if
(
typeof
exports
==
"object"
&&
typeof
module
==
"object"
)
// CommonJS
mod
(
require
(
"../../lib/codemirror"
));
else
if
(
typeof
define
==
"function"
&&
define
.
amd
)
// AMD
define
([
"../../lib/codemirror"
],
mod
);
else
// Plain browser env
mod
(
CodeMirror
);
})(
function
(
CodeMirror
)
{
"use strict"
;
CodeMirror
.
defineMode
(
"groovy"
,
function
(
config
)
{
function
words
(
str
)
{
var
obj
=
{},
words
=
str
.
split
(
" "
);
for
(
var
i
=
0
;
i
<
words
.
length
;
++
i
)
obj
[
words
[
i
]]
=
true
;
return
obj
;
}
var
keywords
=
words
(
"abstract as assert boolean break byte case catch char class const continue def default "
+
"do double else enum extends final finally float for goto if implements import in "
+
"instanceof int interface long native new package private protected public return "
+
"short static strictfp super switch synchronized threadsafe throw throws transient "
+
"try void volatile while"
);
var
blockKeywords
=
words
(
"catch class do else finally for if switch try while enum interface def"
);
var
standaloneKeywords
=
words
(
"return break continue"
);
var
atoms
=
words
(
"null true false this"
);
var
curPunc
;
function
tokenBase
(
stream
,
state
)
{
var
ch
=
stream
.
next
();
if
(
ch
==
'"'
||
ch
==
"'"
)
{
return
startString
(
ch
,
stream
,
state
);
}
if
(
/
[\[\]
{}
\(\)
,;
\:\.]
/
.
test
(
ch
))
{
curPunc
=
ch
;
return
null
;
}
if
(
/
\d
/
.
test
(
ch
))
{
stream
.
eatWhile
(
/
[\w\.]
/
);
if
(
stream
.
eat
(
/eE/
))
{
stream
.
eat
(
/
\+\-
/
);
stream
.
eatWhile
(
/
\d
/
);
}
return
"number"
;
}
if
(
ch
==
"/"
)
{
if
(
stream
.
eat
(
"*"
))
{
state
.
tokenize
.
push
(
tokenComment
);
return
tokenComment
(
stream
,
state
);
}
if
(
stream
.
eat
(
"/"
))
{
stream
.
skipToEnd
();
return
"comment"
;
}
if
(
expectExpression
(
state
.
lastToken
,
false
))
{
return
startString
(
ch
,
stream
,
state
);
}
}
if
(
ch
==
"-"
&&
stream
.
eat
(
">"
))
{
curPunc
=
"->"
;
return
null
;
}
if
(
/
[
+
\-
*&%=<>!?|
\/
~
]
/
.
test
(
ch
))
{
stream
.
eatWhile
(
/
[
+
\-
*&%=<>|~
]
/
);
return
"operator"
;
}
stream
.
eatWhile
(
/
[\w\$
_
]
/
);
if
(
ch
==
"@"
)
{
stream
.
eatWhile
(
/
[\w\$
_
\.]
/
);
return
"meta"
;
}
if
(
state
.
lastToken
==
"."
)
return
"property"
;
if
(
stream
.
eat
(
":"
))
{
curPunc
=
"proplabel"
;
return
"property"
;
}
var
cur
=
stream
.
current
();
if
(
atoms
.
propertyIsEnumerable
(
cur
))
{
return
"atom"
;
}
if
(
keywords
.
propertyIsEnumerable
(
cur
))
{
if
(
blockKeywords
.
propertyIsEnumerable
(
cur
))
curPunc
=
"newstatement"
;
else
if
(
standaloneKeywords
.
propertyIsEnumerable
(
cur
))
curPunc
=
"standalone"
;
return
"keyword"
;
}
return
"variable"
;
}
tokenBase
.
isBase
=
true
;
function
startString
(
quote
,
stream
,
state
)
{
var
tripleQuoted
=
false
;
if
(
quote
!=
"/"
&&
stream
.
eat
(
quote
))
{
if
(
stream
.
eat
(
quote
))
tripleQuoted
=
true
;
else
return
"string"
;
}
function
t
(
stream
,
state
)
{
var
escaped
=
false
,
next
,
end
=
!
tripleQuoted
;
while
((
next
=
stream
.
next
())
!=
null
)
{
if
(
next
==
quote
&&
!
escaped
)
{
if
(
!
tripleQuoted
)
{
break
;
}
if
(
stream
.
match
(
quote
+
quote
))
{
end
=
true
;
break
;
}
}
if
(
quote
==
'"'
&&
next
==
"$"
&&
!
escaped
&&
stream
.
eat
(
"{"
))
{
state
.
tokenize
.
push
(
tokenBaseUntilBrace
());
return
"string"
;
}
escaped
=
!
escaped
&&
next
==
"
\
\"
;
}
if (end) state.tokenize.pop();
return "
string
";
}
state.tokenize.push(t);
return t(stream, state);
}
function tokenBaseUntilBrace() {
var depth = 1;
function t(stream, state) {
if (stream.peek() == "
}
") {
depth--;
if (depth == 0) {
state.tokenize.pop();
return state.tokenize[state.tokenize.length-1](stream, state);
}
} else if (stream.peek() == "
{
") {
depth++;
}
return tokenBase(stream, state);
}
t.isBase = true;
return t;
}
function tokenComment(stream, state) {
var maybeEnd = false, ch;
while (ch = stream.next()) {
if (ch == "
/
" && maybeEnd) {
state.tokenize.pop();
break;
}
maybeEnd = (ch == "
*
");
}
return "
comment
";
}
function expectExpression(last, newline) {
return !last || last == "
operator
" || last == "
->
" || /[
\
.
\
[
\
{
\
(,;:]/.test(last) ||
last == "
newstatement
" || last == "
keyword
" || last == "
proplabel
" ||
(last == "
standalone
" && !newline);
}
function Context(indented, column, type, align, prev) {
this.indented = indented;
this.column = column;
this.type = type;
this.align = align;
this.prev = prev;
}
function pushContext(state, col, type) {
return state.context = new Context(state.indented, col, type, null, state.context);
}
function popContext(state) {
var t = state.context.type;
if (t == "
)
" || t == "
]
" || t == "
}
")
state.indented = state.context.indented;
return state.context = state.context.prev;
}
// Interface
return {
startState: function(basecolumn) {
return {
tokenize: [tokenBase],
context: new Context((basecolumn || 0) - config.indentUnit, 0, "
top
", false),
indented: 0,
startOfLine: true,
lastToken: null
};
},
token: function(stream, state) {
var ctx = state.context;
if (stream.sol()) {
if (ctx.align == null) ctx.align = false;
state.indented = stream.indentation();
state.startOfLine = true;
// Automatic semicolon insertion
if (ctx.type == "
statement
" && !expectExpression(state.lastToken, true)) {
popContext(state); ctx = state.context;
}
}
if (stream.eatSpace()) return null;
curPunc = null;
var style = state.tokenize[state.tokenize.length-1](stream, state);
if (style == "
comment
") return style;
if (ctx.align == null) ctx.align = true;
if ((curPunc == "
;
" || curPunc == "
:
") && ctx.type == "
statement
") popContext(state);
// Handle indentation for {x ->
\n
... }
else if (curPunc == "
->
" && ctx.type == "
statement
" && ctx.prev.type == "
}
") {
popContext(state);
state.context.align = false;
}
else if (curPunc == "
{
") pushContext(state, stream.column(), "
}
");
else if (curPunc == "
[
") pushContext(state, stream.column(), "
]
");
else if (curPunc == "
(
") pushContext(state, stream.column(), "
)
");
else if (curPunc == "
}
") {
while (ctx.type == "
statement
") ctx = popContext(state);
if (ctx.type == "
}
") ctx = popContext(state);
while (ctx.type == "
statement
") ctx = popContext(state);
}
else if (curPunc == ctx.type) popContext(state);
else if (ctx.type == "
}
" || ctx.type == "
top
" || (ctx.type == "
statement
" && curPunc == "
newstatement
"))
pushContext(state, stream.column(), "
statement
");
state.startOfLine = false;
state.lastToken = curPunc || style;
return style;
},
indent: function(state, textAfter) {
if (!state.tokenize[state.tokenize.length-1].isBase) return 0;
var firstChar = textAfter && textAfter.charAt(0), ctx = state.context;
if (ctx.type == "
statement
" && !expectExpression(state.lastToken, true)) ctx = ctx.prev;
var closing = firstChar == ctx.type;
if (ctx.type == "
statement
") return ctx.indented + (firstChar == "
{
" ? 0 : config.indentUnit);
else if (ctx.align) return ctx.column + (closing ? 0 : 1);
else return ctx.indented + (closing ? 0 : config.indentUnit);
},
electricChars: "
{}
",
closeBrackets: {triples: "
'
\
""},
fold: "brace"
};
});
CodeMirror.defineMIME("text/x-groovy", "groovy");
});
xxl-job-client/src/main/java/com/xxl/job/client/handler/HandlerThread.java
浏览文件 @
0e805413
...
@@ -78,6 +78,7 @@ public class HandlerThread extends Thread{
...
@@ -78,6 +78,7 @@ public class HandlerThread extends Thread{
String
_msg
=
null
;
String
_msg
=
null
;
try
{
try
{
XxlJobFileAppender
.
contextHolder
.
set
(
trigger_log_id
);
XxlJobFileAppender
.
contextHolder
.
set
(
trigger_log_id
);
logger
.
info
(
">>>>>>>>>>> xxl-job handle start."
);
_status
=
handler
.
handle
(
handlerParams
);
_status
=
handler
.
handle
(
handlerParams
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
info
(
"HandlerThread Exception:"
,
e
);
logger
.
info
(
"HandlerThread Exception:"
,
e
);
...
@@ -85,20 +86,23 @@ public class HandlerThread extends Thread{
...
@@ -85,20 +86,23 @@ public class HandlerThread extends Thread{
e
.
printStackTrace
(
new
PrintWriter
(
out
));
e
.
printStackTrace
(
new
PrintWriter
(
out
));
_msg
=
out
.
toString
();
_msg
=
out
.
toString
();
}
}
logger
.
info
(
">>>>>>>>>>> xxl-job handle end, handlerParams:{}, _status:{}, _msg:{}"
,
new
Object
[]{
handlerParams
,
_status
,
_msg
});
// callback handler info
// callback handler info
HashMap
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
params
.
put
(
"trigger_log_id"
,
trigger_log_id
);
params
.
put
(
"status"
,
_status
.
name
());
params
.
put
(
"msg"
,
_msg
);
RemoteCallBack
callback
=
null
;
RemoteCallBack
callback
=
null
;
logger
.
info
(
">>>>>>>>>>> xxl-job callback start."
);
try
{
try
{
HashMap
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
params
.
put
(
"trigger_log_id"
,
trigger_log_id
);
params
.
put
(
"status"
,
_status
.
name
());
params
.
put
(
"msg"
,
_msg
);
callback
=
HttpUtil
.
post
(
trigger_log_url
,
params
);
callback
=
HttpUtil
.
post
(
trigger_log_url
,
params
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
info
(
"HandlerThread Exception:"
,
e
);
logger
.
info
(
"HandlerThread Exception:"
,
e
);
}
}
logger
.
info
(
">>>>>>>>>>> xxl-job
thread handle, handlerData:{}, callback_status:{}, callback_msg:{}, callback:{}, thread:{}"
,
logger
.
info
(
">>>>>>>>>>> xxl-job
callback end, params:{}, result:{}"
,
new
Object
[]{
params
,
callback
.
toString
()});
new
Object
[]{
handlerData
,
_status
,
_msg
,
callback
,
this
});
}
else
{
}
else
{
i
++;
i
++;
logIdSet
.
clear
();
logIdSet
.
clear
();
...
...
xxl-job-client/src/main/java/com/xxl/job/client/util/HttpUtil.java
浏览文件 @
0e805413
...
@@ -46,6 +46,12 @@ public class HttpUtil {
...
@@ -46,6 +46,12 @@ public class HttpUtil {
public
String
getMsg
()
{
public
String
getMsg
()
{
return
msg
;
return
msg
;
}
}
@Override
public
String
toString
()
{
return
"RemoteCallBack [status="
+
status
+
", msg="
+
msg
+
"]"
;
}
}
}
/**
/**
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论