Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
熊鹏飞
/
xxljob220
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f5ebe8f7
authored
Sep 01, 2017
by
Kevin
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1.添加GLUE_NODEJS支持
parent
2d160021
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
27 additions
and
3 deletions
xxl-job-admin/src/main/webapp/WEB-INF/template/jobcode/jobcode.index.ftl
xxl-job-admin/src/main/webapp/WEB-INF/template/jobinfo/jobinfo.index.ftl
xxl-job-admin/src/main/webapp/static/js/jobcode.index.1.js
xxl-job-admin/src/main/webapp/static/js/jobinfo.index.1.js
xxl-job-admin/src/main/webapp/static/js/joblog.index.1.js
xxl-job-admin/src/main/webapp/static/plugins/codemirror/mode/javascript/javascript.js
xxl-job-core/src/main/java/com/xxl/job/core/biz/impl/ExecutorBizImpl.java
xxl-job-core/src/main/java/com/xxl/job/core/glue/GlueTypeEnum.java
xxl-job-core/src/main/java/com/xxl/job/core/handler/impl/ScriptJobHandler.java
xxl-job-admin/src/main/webapp/WEB-INF/template/jobcode/jobcode.index.ftl
View file @
f5ebe8f7
...
...
@@ -113,6 +113,7 @@
<script
src=
"${request.contextPath}/static/plugins/codemirror/mode/clike/clike.js"
></script>
<script
src=
"${request.contextPath}/static/plugins/codemirror/mode/shell/shell.js"
></script>
<script
src=
"${request.contextPath}/static/plugins/codemirror/mode/python/python.js"
></script>
<script
src=
"${request.contextPath}/static/plugins/codemirror/mode/javascript/javascript.js"
></script>
<script
src=
"${request.contextPath}/static/plugins/codemirror/addon/hint/show-hint.js"
></script>
<script
src=
"${request.contextPath}/static/plugins/codemirror/addon/hint/anyword-hint.js"
></script>
<script>
...
...
xxl-job-admin/src/main/webapp/WEB-INF/template/jobinfo/jobinfo.index.ftl
View file @
f5ebe8f7
...
...
@@ -233,7 +233,17 @@ logging.basicConfig(level=logging.DEBUG)
logging
.
info
("脚本文件:"
+
sys
.
argv
[
0
])
--
>
</textarea>
<textarea
class=
"glueSource_nodejs"
style=
"display:none;"
>
// #!/usr/bin/node
console.log("xxl-job: hello nodejs")
var arguments = process.argv
console.log("脚本文件: " + arguments[1])
for (var i = 2; i
<
arguments
.
length
;
i
++){
console
.
log
("参数
:
%
s
,
%
s
",
i
,
arguments
[
i
]);
}
console
.
log
("
Good
bye
!")
process
.
exit
(
0
)
</
textarea
>
</form>
</div>
</div>
...
...
xxl-job-admin/src/main/webapp/static/js/jobcode.index.1.js
View file @
f5ebe8f7
...
...
@@ -16,6 +16,8 @@ $(function() {
ideMode
=
"text/x-sh"
;
}
else
if
(
'GLUE_PYTHON'
==
glueType
){
ideMode
=
"text/x-python"
;
}
else
if
(
'GLUE_NODEJS'
==
glueType
){
ideMode
=
"text/javascript"
}
codeEditor
=
CodeMirror
(
document
.
getElementById
(
"ideWindow"
),
{
...
...
xxl-job-admin/src/main/webapp/static/js/jobinfo.index.1.js
View file @
f5ebe8f7
...
...
@@ -55,6 +55,8 @@ $(function() {
return
"GLUE模式(Shell)"
;
}
else
if
(
'GLUE_PYTHON'
==
row
.
glueType
)
{
return
"GLUE模式(Python)"
;
}
else
if
(
'GLUE_NODEJS'
==
row
.
glueType
){
return
"GLUE模式(Nodejs)"
;
}
else
if
(
'BEAN'
==
row
.
glueType
)
{
return
"BEAN模式:"
+
row
.
executorHandler
;
}
...
...
@@ -341,6 +343,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_NODEJS'
==
glueType
){
$
(
"#addModal .form textarea[name='glueSource']"
).
val
(
$
(
"#addModal .form .glueSource_nodejs"
).
val
()
);
}
});
...
...
xxl-job-admin/src/main/webapp/static/js/joblog.index.1.js
View file @
f5ebe8f7
...
...
@@ -105,6 +105,8 @@ $(function() {
glueTypeTitle
=
"GLUE模式(Shell)"
;
}
else
if
(
'GLUE_PYTHON'
==
row
.
glueType
)
{
glueTypeTitle
=
"GLUE模式(Python)"
;
}
else
if
(
'GLUE_NODEJS'
==
row
.
glueType
)
{
glueTypeTitle
=
"GLUE模式(Nodejs)"
;
}
else
if
(
'BEAN'
==
row
.
glueType
)
{
glueTypeTitle
=
"BEAN模式:"
+
row
.
executorHandler
;
}
...
...
xxl-job-admin/src/main/webapp/static/plugins/codemirror/mode/javascript/javascript.js
0 → 100644
View file @
f5ebe8f7
This diff is collapsed.
Click to expand it.
xxl-job-core/src/main/java/com/xxl/job/core/biz/impl/ExecutorBizImpl.java
View file @
f5ebe8f7
...
...
@@ -120,7 +120,8 @@ public class ExecutorBizImpl implements ExecutorBiz {
}
}
}
else
if
(
GlueTypeEnum
.
GLUE_SHELL
==
GlueTypeEnum
.
match
(
triggerParam
.
getGlueType
())
||
GlueTypeEnum
.
GLUE_PYTHON
==
GlueTypeEnum
.
match
(
triggerParam
.
getGlueType
())
)
{
||
GlueTypeEnum
.
GLUE_PYTHON
==
GlueTypeEnum
.
match
(
triggerParam
.
getGlueType
())
||
GlueTypeEnum
.
GLUE_NODEJS
==
GlueTypeEnum
.
match
(
triggerParam
.
getGlueType
()))
{
// valid old jobThread
if
(
jobThread
!=
null
&&
...
...
xxl-job-core/src/main/java/com/xxl/job/core/glue/GlueTypeEnum.java
View file @
f5ebe8f7
...
...
@@ -8,7 +8,8 @@ public enum GlueTypeEnum {
BEAN
(
"BEAN模式"
),
GLUE_GROOVY
(
"GLUE模式(Java)"
),
GLUE_SHELL
(
"GLUE模式(Shell)"
),
GLUE_PYTHON
(
"GLUE模式(Python)"
);
GLUE_PYTHON
(
"GLUE模式(Python)"
),
GLUE_NODEJS
(
"GLUE模式(Nodejs)"
);
private
String
desc
;
private
GlueTypeEnum
(
String
desc
)
{
...
...
xxl-job-core/src/main/java/com/xxl/job/core/handler/impl/ScriptJobHandler.java
View file @
f5ebe8f7
...
...
@@ -40,6 +40,9 @@ public class ScriptJobHandler extends IJobHandler {
}
else
if
(
GlueTypeEnum
.
GLUE_PYTHON
==
glueType
)
{
cmd
=
"python"
;
scriptFileName
=
XxlJobFileAppender
.
logPath
.
concat
(
"gluesource/"
).
concat
(
String
.
valueOf
(
jobId
)).
concat
(
"_"
).
concat
(
String
.
valueOf
(
glueUpdatetime
)).
concat
(
".py"
);
}
else
if
(
GlueTypeEnum
.
GLUE_NODEJS
==
glueType
)
{
cmd
=
"node"
;
scriptFileName
=
XxlJobFileAppender
.
logPath
.
concat
(
"gluesource/"
).
concat
(
String
.
valueOf
(
jobId
)).
concat
(
"_"
).
concat
(
String
.
valueOf
(
glueUpdatetime
)).
concat
(
".js"
);
}
// make script file
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment