GLUE示例代码初始化

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

@ -169,7 +169,8 @@
</div>
<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;
import org.slf4j.Logger;
@ -189,7 +190,7 @@ public class DemoGlueJobHandler extends IJobHandler {
}
</textarea>
<textarea name="glueSource_shell" style="display:none;" >
<textarea class="glueSource_shell" style="display:none;" >
#!/bin/bash
echo hello shell
@ -204,7 +205,7 @@ echo1 111
printf 666
echo2 222
</textarea>
<textarea name="glueSource_python" style="display:none;" >
<textarea class="glueSource_python" style="display:none;" >
#!/usr/bin/python
# -*- coding: UTF-8 -*-

@ -297,9 +297,9 @@ $(function() {
// GLUE模式开启
$(".glueType").change(function(){
// executorHandler
var $executorHandler = $(this).parents("form").find("input[name='executorHandler']");
var glueType = $(this).val();
console.log(glueType);
if ('BEAN' != glueType) {
$executorHandler.val("");
$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() {

Loading…
Cancel
Save