Skip to content

Commit

Permalink
GLUE示例代码初始化
Browse files Browse the repository at this point in the history
  • Loading branch information
xueli.xue committed Apr 26, 2017
1 parent 7a781ad commit 617ed69
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand All @@ -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 -*-

Expand Down
14 changes: 13 additions & 1 deletion xxl-job-admin/src/main/webapp/static/js/jobinfo.index.1.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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() {

Expand Down

0 comments on commit 617ed69

Please sign in to comment.