瀏覽代碼

脚本任务实现

xueli.xue 8 年之前
父節點
當前提交
113e70cab7

+ 1 - 0
README.md 查看文件

@@ -24,6 +24,7 @@ XXL-JOB是一个轻量级分布式任务调度框架,其核心设计目标是
24 24
 - 17、路由策略:执行器集群部署时提供丰富的路由策略,包括:第一个、最后一个、轮询、随机、一致性HASH、最不经常使用、最近最久未使用、故障转移;
25 25
 - 18、Rolling日志:支持以Rolling方式实时查看执行器输出的日志信息,实时监控任务进度;
26 26
 - 19、运行报表:支持实时查看运行数据,如任务数量、调度次数、执行器数量等;以及调度报表,如调度日期分布图,调度成功分布图等;
27
+- 20、脚本任务:支持开发脚本任务,如Shell、Python和Groovy等脚本;
27 28
 
28 29
 #### 1.3 发展
29 30
 于2015年中,我在github上创建XXL-JOB项目仓库并提交第一个commit,随之进行系统结构设计,UI选型,交互设计……

+ 1 - 3
xxl-job-admin/src/main/webapp/WEB-INF/template/jobinfo/jobinfo.index.ftl 查看文件

@@ -76,7 +76,7 @@
76 76
 					                	<th name="jobGroup" >jobGroup</th>
77 77
                                         <th name="childJobKey" >JobKey</th>
78 78
 					                  	<th name="jobDesc" >描述</th>
79
-                                        <th name="executorHandler" >JobHandler</th>
79
+                                        <th name="glueType" >运行模式</th>
80 80
 					                  	<th name="executorParam" >任务参数</th>
81 81
                                         <th name="jobCron" >Cron</th>
82 82
 					                  	<th name="addTime" >新增时间</th>
@@ -192,7 +192,6 @@ public class DemoGlueJobHandler extends IJobHandler {
192 192
 </textarea>
193 193
 <textarea class="glueSource_shell" style="display:none;" >
194 194
 #!/bin/bash
195
-
196 195
 echo "xxl-job: hello shell"
197 196
 
198 197
 for item in 1 2 3
@@ -217,7 +216,6 @@ logging.info('xxl-job: hello python')
217 216
 for num in range(1, 3):
218 217
 	time.sleep(1)
219 218
 	logging.info('python :' + str(num) )
220
-
221 219
 logging.info('Good bye!')
222 220
 </textarea>
223 221
 					

+ 11 - 2
xxl-job-admin/src/main/webapp/static/js/jobinfo.index.1.js 查看文件

@@ -45,11 +45,20 @@ $(function() {
45 45
 					},
46 46
 	                { "data": 'jobDesc', "visible" : true,"width":'20%'},
47 47
 					{
48
-						"data": 'executorHandler',
48
+						"data": 'glueType',
49 49
 						"width":'20%',
50 50
 						"visible" : true,
51 51
 						"render": function ( data, type, row ) {
52
-							return (row.glueSwitch > 0)? "GLUE模式" : data;
52
+							if ('GLUE_GROOVY'==row.glueType) {
53
+								return "GLUE模式(Java)";
54
+							} else if ('GLUE_SHELL'==row.glueType) {
55
+								return "GLUE模式(Shell)";
56
+							} else if ('GLUE_PYTHON'==row.glueType) {
57
+								return "GLUE模式(Python)";
58
+							} else if ('BEAN'==row.glueType) {
59
+								return row.executorHandler;
60
+							}
61
+							return row.executorHandler;
53 62
 						}
54 63
 					},
55 64
 	                { "data": 'executorParam', "visible" : false},