From ef8edd0c8689d4665f88aa16a3688f841e758b63 Mon Sep 17 00:00:00 2001 From: eszhuyb Date: Thu, 4 May 2023 18:22:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0python3=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E8=B0=83=E5=BA=A6=E7=B1=BB=E5=9E=8B,=20xxl-job-admin=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0python3=E9=BB=98=E8=AE=A4Glue=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/static/js/jobinfo.index.1.js | 2 ++ .../templates/jobcode/jobcode.index.ftl | 2 +- .../templates/jobinfo/jobinfo.index.ftl | 24 +++++++++++++++++++ .../com/xxl/job/core/glue/GlueTypeEnum.java | 1 + 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js b/xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js index b479e972..f70e5a12 100644 --- a/xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js +++ b/xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js @@ -519,6 +519,8 @@ $(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_PYTHON3'==glueType){ + $("#addModal .form textarea[name='glueSource']").val( $("#addModal .form .glueSource_python3").val() ); } else if ('GLUE_PHP'==glueType){ $("#addModal .form textarea[name='glueSource']").val( $("#addModal .form .glueSource_php").val() ); } else if ('GLUE_NODEJS'==glueType){ diff --git a/xxl-job-admin/src/main/resources/templates/jobcode/jobcode.index.ftl b/xxl-job-admin/src/main/resources/templates/jobcode/jobcode.index.ftl index a386b288..7b722430 100644 --- a/xxl-job-admin/src/main/resources/templates/jobcode/jobcode.index.ftl +++ b/xxl-job-admin/src/main/resources/templates/jobcode/jobcode.index.ftl @@ -130,7 +130,7 @@ <#elseif jobInfo.glueType == "GLUE_SHELL" > <#assign glueTypeModeSrc = "${request.contextPath}/static/plugins/codemirror/mode/shell/shell.js" /> <#assign glueTypeIdeMode = "text/x-sh" /> - <#elseif jobInfo.glueType == "GLUE_PYTHON" > + <#elseif jobInfo.glueType == "GLUE_PYTHON" || jobInfo.glueType == "GLUE_PYTHON3"> <#assign glueTypeModeSrc = "${request.contextPath}/static/plugins/codemirror/mode/python/python.js" /> <#assign glueTypeIdeMode = "text/x-python" /> <#elseif jobInfo.glueType == "GLUE_PHP" > diff --git a/xxl-job-admin/src/main/resources/templates/jobinfo/jobinfo.index.ftl b/xxl-job-admin/src/main/resources/templates/jobinfo/jobinfo.index.ftl index 3a5d7d8a..aa39a3e2 100644 --- a/xxl-job-admin/src/main/resources/templates/jobinfo/jobinfo.index.ftl +++ b/xxl-job-admin/src/main/resources/templates/jobinfo/jobinfo.index.ftl @@ -283,6 +283,30 @@ import sys print "xxl-job: hello python" +print "${I18n.jobinfo_script_location}:", sys.argv[0] +print "${I18n.jobinfo_field_executorparam}:", sys.argv[1] +print "${I18n.jobinfo_shard_index}:", sys.argv[2] +print "${I18n.jobinfo_shard_total}:", sys.argv[3] +<#--for i in range(1, len(sys.argv)): + time.sleep(1) + print "参数", i, sys.argv[i]--> + +print "Good bye!" +exit(0) +<#-- +import logging +logging.basicConfig(level=logging.DEBUG) +logging.info("脚本文件:" + sys.argv[0]) +--> + +