Browse Source

脚本任务实现

xueli.xue 8 years ago
parent
commit
113e70cab7

+ 1 - 0
README.md View File

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

+ 1 - 3
xxl-job-admin/src/main/webapp/WEB-INF/template/jobinfo/jobinfo.index.ftl View File

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

+ 11 - 2
xxl-job-admin/src/main/webapp/static/js/jobinfo.index.1.js View File

45
 					},
45
 					},
46
 	                { "data": 'jobDesc', "visible" : true,"width":'20%'},
46
 	                { "data": 'jobDesc', "visible" : true,"width":'20%'},
47
 					{
47
 					{
48
-						"data": 'executorHandler',
48
+						"data": 'glueType',
49
 						"width":'20%',
49
 						"width":'20%',
50
 						"visible" : true,
50
 						"visible" : true,
51
 						"render": function ( data, type, row ) {
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
 	                { "data": 'executorParam', "visible" : false},
64
 	                { "data": 'executorParam', "visible" : false},