Merge pull request #427 from clipperL/master

运行模式中,新增 GLUE模式(php)
This commit is contained in:
许雪里 2018-08-16 21:13:19 +08:00 committed by GitHub
commit 862e281d8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 248 additions and 1 deletions

View File

@ -127,6 +127,9 @@
<#elseif jobInfo.glueType == "GLUE_PYTHON" >
<#assign glueTypeModeSrc = "${request.contextPath}/static/plugins/codemirror/mode/python/python.js" />
<#assign glueTypeIdeMode = "text/x-python" />
<#elseif jobInfo.glueType == "GLUE_PHP" >
<#assign glueTypeModeSrc = "${request.contextPath}/static/plugins/codemirror/mode/php/php.js" />
<#assign glueTypeIdeMode = "text/x-php" />
<#elseif jobInfo.glueType == "GLUE_NODEJS" >
<#assign glueTypeModeSrc = "${request.contextPath}/static/plugins/codemirror/mode/javascript/javascript.js" />
<#assign glueTypeIdeMode = "text/javascript" />

View File

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

View File

@ -355,7 +355,9 @@ $(function() {
$("#addModal .form textarea[name='glueSource']").val( $("#addModal .form .glueSource_shell").val() );
} else if ('GLUE_PYTHON'==glueType){
$("#addModal .form textarea[name='glueSource']").val( $("#addModal .form .glueSource_python").val() );
} else if ('GLUE_NODEJS'==glueType){
} else if ('GLUE_PHP'==glueType){
$("#addModal .form textarea[name='glueSource']").val( $("#addModal .form .glueSource_php").val() );
} else if ('GLUE_NODEJS'==glueType){
$("#addModal .form textarea[name='glueSource']").val( $("#addModal .form .glueSource_nodejs").val() );
}
});

File diff suppressed because one or more lines are too long

View File

@ -9,6 +9,7 @@ public enum GlueTypeEnum {
GLUE_GROOVY("GLUE(Java)", false, null, null),
GLUE_SHELL("GLUE(Shell)", true, "bash", ".sh"),
GLUE_PYTHON("GLUE(Python)", true, "python", ".py"),
GLUE_PHP("GLUE模式(Php)", true, "php", ".php"),
GLUE_NODEJS("GLUE(Nodejs)", true, "node", ".js");
private String desc;