瀏覽代碼

新增任务-运行模式中,新增 GLUE模式(php)

clipperl 7 年之前
父節點
當前提交
4f75bf336e

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

127
     <#elseif jobInfo.glueType == "GLUE_PYTHON" >
127
     <#elseif jobInfo.glueType == "GLUE_PYTHON" >
128
         <#assign glueTypeModeSrc = "${request.contextPath}/static/plugins/codemirror/mode/python/python.js" />
128
         <#assign glueTypeModeSrc = "${request.contextPath}/static/plugins/codemirror/mode/python/python.js" />
129
         <#assign glueTypeIdeMode = "text/x-python" />
129
         <#assign glueTypeIdeMode = "text/x-python" />
130
+    <#elseif jobInfo.glueType == "GLUE_PHP" >
131
+        <#assign glueTypeModeSrc = "${request.contextPath}/static/plugins/codemirror/mode/php/php.js" />
132
+        <#assign glueTypeIdeMode = "text/x-php" />
130
     <#elseif jobInfo.glueType == "GLUE_NODEJS" >
133
     <#elseif jobInfo.glueType == "GLUE_NODEJS" >
131
         <#assign glueTypeModeSrc = "${request.contextPath}/static/plugins/codemirror/mode/javascript/javascript.js" />
134
         <#assign glueTypeModeSrc = "${request.contextPath}/static/plugins/codemirror/mode/javascript/javascript.js" />
132
         <#assign glueTypeIdeMode = "text/javascript" />
135
         <#assign glueTypeIdeMode = "text/javascript" />

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

242
 logging.info("脚本文件:" + sys.argv[0])
242
 logging.info("脚本文件:" + sys.argv[0])
243
 -->
243
 -->
244
 </textarea>
244
 </textarea>
245
+<#--这里有问题,新建一个运行模式为 php 的任务后,GLUE 中没有下边的 php 代码-->
246
+<textarea class="glueSource_php" style="display:none;" >
247
+<?php
248
+	echo "hello php";
249
+	echo "\n"
250
+?>
251
+</textarea>
245
 <textarea class="glueSource_nodejs" style="display:none;" >
252
 <textarea class="glueSource_nodejs" style="display:none;" >
246
 #!/usr/bin/env node
253
 #!/usr/bin/env node
247
 console.log("xxl-job: hello nodejs")
254
 console.log("xxl-job: hello nodejs")

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

355
 			$("#addModal .form textarea[name='glueSource']").val( $("#addModal .form .glueSource_shell").val() );
355
 			$("#addModal .form textarea[name='glueSource']").val( $("#addModal .form .glueSource_shell").val() );
356
 		} else if ('GLUE_PYTHON'==glueType){
356
 		} else if ('GLUE_PYTHON'==glueType){
357
 			$("#addModal .form textarea[name='glueSource']").val( $("#addModal .form .glueSource_python").val() );
357
 			$("#addModal .form textarea[name='glueSource']").val( $("#addModal .form .glueSource_python").val() );
358
-		} else if ('GLUE_NODEJS'==glueType){
358
+		} else if ('GLUE_PHP'==glueType){
359
+            $("#addModal .form textarea[name='glueSource']").val( $("#addModal .form .glueSource_php").val() );
360
+        } else if ('GLUE_NODEJS'==glueType){
359
 			$("#addModal .form textarea[name='glueSource']").val( $("#addModal .form .glueSource_nodejs").val() );			
361
 			$("#addModal .form textarea[name='glueSource']").val( $("#addModal .form .glueSource_nodejs").val() );			
360
 		}
362
 		}
361
 	});
363
 	});

文件差異過大導致無法顯示
+ 234 - 0
xxl-job-admin/src/main/webapp/static/plugins/codemirror/mode/php/php.js


+ 1 - 0
xxl-job-core/src/main/java/com/xxl/job/core/glue/GlueTypeEnum.java 查看文件

9
     GLUE_GROOVY("GLUE(Java)", false, null, null),
9
     GLUE_GROOVY("GLUE(Java)", false, null, null),
10
     GLUE_SHELL("GLUE(Shell)", true, "bash", ".sh"),
10
     GLUE_SHELL("GLUE(Shell)", true, "bash", ".sh"),
11
     GLUE_PYTHON("GLUE(Python)", true, "python", ".py"),
11
     GLUE_PYTHON("GLUE(Python)", true, "python", ".py"),
12
+    GLUE_PHP("GLUE模式(Php)", true, "php", ".php"),
12
     GLUE_NODEJS("GLUE(Nodejs)", true, "node", ".js");
13
     GLUE_NODEJS("GLUE(Nodejs)", true, "node", ".js");
13
 
14
 
14
     private String desc;
15
     private String desc;