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
145a9006
authored
Sep 05, 2017
by
许雪里
Committed by
GitHub
Sep 05, 2017
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge pull request #157 from icyblazek/master
新特性,添加GLUE_NODEJS支持。
parents
88d78091
f5ebe8f7
Expand all
Hide 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 @
145a9006
...
@@ -113,6 +113,7 @@
...
@@ -113,6 +113,7 @@
<script
src=
"${request.contextPath}/static/plugins/codemirror/mode/clike/clike.js"
></script>
<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/shell/shell.js"
></script>
<script
src=
"${request.contextPath}/static/plugins/codemirror/mode/python/python.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/show-hint.js"
></script>
<script
src=
"${request.contextPath}/static/plugins/codemirror/addon/hint/anyword-hint.js"
></script>
<script
src=
"${request.contextPath}/static/plugins/codemirror/addon/hint/anyword-hint.js"
></script>
<script>
<script>
...
...
xxl-job-admin/src/main/webapp/WEB-INF/template/jobinfo/jobinfo.index.ftl
View file @
145a9006
...
@@ -233,7 +233,17 @@ logging.basicConfig(level=logging.DEBUG)
...
@@ -233,7 +233,17 @@ logging.basicConfig(level=logging.DEBUG)
logging
.
info
("脚本文件:"
+
sys
.
argv
[
0
])
logging
.
info
("脚本文件:"
+
sys
.
argv
[
0
])
--
>
--
>
</textarea>
</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>
</form>
</div>
</div>
</div>
</div>
...
...
xxl-job-admin/src/main/webapp/static/js/jobcode.index.1.js
View file @
145a9006
...
@@ -16,6 +16,8 @@ $(function() {
...
@@ -16,6 +16,8 @@ $(function() {
ideMode
=
"text/x-sh"
;
ideMode
=
"text/x-sh"
;
}
else
if
(
'GLUE_PYTHON'
==
glueType
){
}
else
if
(
'GLUE_PYTHON'
==
glueType
){
ideMode
=
"text/x-python"
;
ideMode
=
"text/x-python"
;
}
else
if
(
'GLUE_NODEJS'
==
glueType
){
ideMode
=
"text/javascript"
}
}
codeEditor
=
CodeMirror
(
document
.
getElementById
(
"ideWindow"
),
{
codeEditor
=
CodeMirror
(
document
.
getElementById
(
"ideWindow"
),
{
...
...
xxl-job-admin/src/main/webapp/static/js/jobinfo.index.1.js
View file @
145a9006
...
@@ -55,6 +55,8 @@ $(function() {
...
@@ -55,6 +55,8 @@ $(function() {
return
"GLUE模式(Shell)"
;
return
"GLUE模式(Shell)"
;
}
else
if
(
'GLUE_PYTHON'
==
row
.
glueType
)
{
}
else
if
(
'GLUE_PYTHON'
==
row
.
glueType
)
{
return
"GLUE模式(Python)"
;
return
"GLUE模式(Python)"
;
}
else
if
(
'GLUE_NODEJS'
==
row
.
glueType
){
return
"GLUE模式(Nodejs)"
;
}
else
if
(
'BEAN'
==
row
.
glueType
)
{
}
else
if
(
'BEAN'
==
row
.
glueType
)
{
return
"BEAN模式:"
+
row
.
executorHandler
;
return
"BEAN模式:"
+
row
.
executorHandler
;
}
}
...
@@ -341,6 +343,8 @@ $(function() {
...
@@ -341,6 +343,8 @@ $(function() {
$
(
"#addModal .form textarea[name='glueSource']"
).
val
(
$
(
"#addModal .form .glueSource_shell"
).
val
()
);
$
(
"#addModal .form textarea[name='glueSource']"
).
val
(
$
(
"#addModal .form .glueSource_shell"
).
val
()
);
}
else
if
(
'GLUE_PYTHON'
==
glueType
){
}
else
if
(
'GLUE_PYTHON'
==
glueType
){
$
(
"#addModal .form textarea[name='glueSource']"
).
val
(
$
(
"#addModal .form .glueSource_python"
).
val
()
);
$
(
"#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 @
145a9006
...
@@ -105,6 +105,8 @@ $(function() {
...
@@ -105,6 +105,8 @@ $(function() {
glueTypeTitle
=
"GLUE模式(Shell)"
;
glueTypeTitle
=
"GLUE模式(Shell)"
;
}
else
if
(
'GLUE_PYTHON'
==
row
.
glueType
)
{
}
else
if
(
'GLUE_PYTHON'
==
row
.
glueType
)
{
glueTypeTitle
=
"GLUE模式(Python)"
;
glueTypeTitle
=
"GLUE模式(Python)"
;
}
else
if
(
'GLUE_NODEJS'
==
row
.
glueType
)
{
glueTypeTitle
=
"GLUE模式(Nodejs)"
;
}
else
if
(
'BEAN'
==
row
.
glueType
)
{
}
else
if
(
'BEAN'
==
row
.
glueType
)
{
glueTypeTitle
=
"BEAN模式:"
+
row
.
executorHandler
;
glueTypeTitle
=
"BEAN模式:"
+
row
.
executorHandler
;
}
}
...
...
xxl-job-admin/src/main/webapp/static/plugins/codemirror/mode/javascript/javascript.js
0 → 100644
View file @
145a9006
This diff is collapsed.
Click to expand it.
xxl-job-core/src/main/java/com/xxl/job/core/biz/impl/ExecutorBizImpl.java
View file @
145a9006
...
@@ -120,7 +120,8 @@ public class ExecutorBizImpl implements ExecutorBiz {
...
@@ -120,7 +120,8 @@ public class ExecutorBizImpl implements ExecutorBiz {
}
}
}
}
}
else
if
(
GlueTypeEnum
.
GLUE_SHELL
==
GlueTypeEnum
.
match
(
triggerParam
.
getGlueType
())
}
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
// valid old jobThread
if
(
jobThread
!=
null
&&
if
(
jobThread
!=
null
&&
...
...
xxl-job-core/src/main/java/com/xxl/job/core/glue/GlueTypeEnum.java
View file @
145a9006
...
@@ -8,7 +8,8 @@ public enum GlueTypeEnum {
...
@@ -8,7 +8,8 @@ public enum GlueTypeEnum {
BEAN
(
"BEAN模式"
),
BEAN
(
"BEAN模式"
),
GLUE_GROOVY
(
"GLUE模式(Java)"
),
GLUE_GROOVY
(
"GLUE模式(Java)"
),
GLUE_SHELL
(
"GLUE模式(Shell)"
),
GLUE_SHELL
(
"GLUE模式(Shell)"
),
GLUE_PYTHON
(
"GLUE模式(Python)"
);
GLUE_PYTHON
(
"GLUE模式(Python)"
),
GLUE_NODEJS
(
"GLUE模式(Nodejs)"
);
private
String
desc
;
private
String
desc
;
private
GlueTypeEnum
(
String
desc
)
{
private
GlueTypeEnum
(
String
desc
)
{
...
...
xxl-job-core/src/main/java/com/xxl/job/core/handler/impl/ScriptJobHandler.java
View file @
145a9006
...
@@ -40,6 +40,9 @@ public class ScriptJobHandler extends IJobHandler {
...
@@ -40,6 +40,9 @@ public class ScriptJobHandler extends IJobHandler {
}
else
if
(
GlueTypeEnum
.
GLUE_PYTHON
==
glueType
)
{
}
else
if
(
GlueTypeEnum
.
GLUE_PYTHON
==
glueType
)
{
cmd
=
"python"
;
cmd
=
"python"
;
scriptFileName
=
XxlJobFileAppender
.
logPath
.
concat
(
"gluesource/"
).
concat
(
String
.
valueOf
(
jobId
)).
concat
(
"_"
).
concat
(
String
.
valueOf
(
glueUpdatetime
)).
concat
(
".py"
);
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
// 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