Przeglądaj źródła

GLUE示例代码初始化

xueli.xue 8 lat temu
rodzic
commit
617ed69727

+ 4 - 3
xxl-job-admin/src/main/webapp/WEB-INF/template/jobinfo/jobinfo.index.ftl Wyświetl plik

@@ -169,7 +169,8 @@
169 169
 					</div>
170 170
 
171 171
 <input type="hidden" name="glueRemark" value="GLUE代码初始化" >
172
-<textarea name="glueSource" style="display:none;" >
172
+<textarea name="glueSource" style="display:none;" ></textarea>
173
+<textarea class="glueSource_java" style="display:none;" >
173 174
 package com.xxl.job.service.handler;
174 175
 
175 176
 import org.slf4j.Logger;
@@ -189,7 +190,7 @@ public class DemoGlueJobHandler extends IJobHandler {
189 190
 
190 191
 }
191 192
 </textarea>
192
-<textarea name="glueSource_shell" style="display:none;" >
193
+<textarea class="glueSource_shell" style="display:none;" >
193 194
 #!/bin/bash
194 195
 
195 196
 echo hello shell
@@ -204,7 +205,7 @@ echo1 111
204 205
 printf 666
205 206
 echo2 222
206 207
 </textarea>
207
-<textarea name="glueSource_python" style="display:none;" >
208
+<textarea class="glueSource_python" style="display:none;" >
208 209
 #!/usr/bin/python
209 210
 # -*- coding: UTF-8 -*-
210 211
 

+ 13 - 1
xxl-job-admin/src/main/webapp/static/js/jobinfo.index.1.js Wyświetl plik

@@ -297,9 +297,9 @@ $(function() {
297 297
 
298 298
     // GLUE模式开启
299 299
     $(".glueType").change(function(){
300
+		// executorHandler
300 301
         var $executorHandler = $(this).parents("form").find("input[name='executorHandler']");
301 302
         var glueType = $(this).val();
302
-        console.log(glueType);
303 303
         if ('BEAN' != glueType) {
304 304
             $executorHandler.val("");
305 305
             $executorHandler.attr("readonly","readonly");
@@ -308,6 +308,18 @@ $(function() {
308 308
         }
309 309
     });
310 310
 
311
+	$("#addModal .glueType").change(function(){
312
+		// glueSource
313
+		var glueType = $(this).val();
314
+		if ('GLUE_GROOVY'==glueType){
315
+			$("#addModal .form textarea[name='glueSource']").val( $("#addModal .form .glueSource_java").val() );
316
+		} else if ('GLUE_SHELL'==glueType){
317
+			$("#addModal .form textarea[name='glueSource']").val( $("#addModal .form .glueSource_shell").val() );
318
+		} else if ('GLUE_PYTHON'==glueType){
319
+			$("#addModal .form textarea[name='glueSource']").val( $("#addModal .form .glueSource_python").val() );
320
+		}
321
+	});
322
+
311 323
 	// 更新
312 324
 	$("#job_list").on('click', '.update',function() {
313 325