GLUE示例代码初始化

v1.7
xueli.xue 8 years ago
parent 7a781ad371
commit 617ed69727

@ -169,7 +169,8 @@
</div> </div>
<input type="hidden" name="glueRemark" value="GLUE代码初始化" > <input type="hidden" name="glueRemark" value="GLUE代码初始化" >
<textarea name="glueSource" style="display:none;" > <textarea name="glueSource" style="display:none;" ></textarea>
<textarea class="glueSource_java" style="display:none;" >
package com.xxl.job.service.handler; package com.xxl.job.service.handler;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -189,7 +190,7 @@ public class DemoGlueJobHandler extends IJobHandler {
} }
</textarea> </textarea>
<textarea name="glueSource_shell" style="display:none;" > <textarea class="glueSource_shell" style="display:none;" >
#!/bin/bash #!/bin/bash
echo hello shell echo hello shell
@ -204,7 +205,7 @@ echo1 111
printf 666 printf 666
echo2 222 echo2 222
</textarea> </textarea>
<textarea name="glueSource_python" style="display:none;" > <textarea class="glueSource_python" style="display:none;" >
#!/usr/bin/python #!/usr/bin/python
# -*- coding: UTF-8 -*- # -*- coding: UTF-8 -*-

@ -297,9 +297,9 @@ $(function() {
// GLUE模式开启 // GLUE模式开启
$(".glueType").change(function(){ $(".glueType").change(function(){
// executorHandler
var $executorHandler = $(this).parents("form").find("input[name='executorHandler']"); var $executorHandler = $(this).parents("form").find("input[name='executorHandler']");
var glueType = $(this).val(); var glueType = $(this).val();
console.log(glueType);
if ('BEAN' != glueType) { if ('BEAN' != glueType) {
$executorHandler.val(""); $executorHandler.val("");
$executorHandler.attr("readonly","readonly"); $executorHandler.attr("readonly","readonly");
@ -308,6 +308,18 @@ $(function() {
} }
}); });
$("#addModal .glueType").change(function(){
// glueSource
var glueType = $(this).val();
if ('GLUE_GROOVY'==glueType){
$("#addModal .form textarea[name='glueSource']").val( $("#addModal .form .glueSource_java").val() );
} else if ('GLUE_SHELL'==glueType){
$("#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() );
}
});
// 更新 // 更新
$("#job_list").on('click', '.update',function() { $("#job_list").on('click', '.update',function() {

Loading…
Cancel
Save