Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
X
XXL-JOB
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
靳帅
XXL-JOB
Commits
4b2b6d82
提交
4b2b6d82
authored
5月 18, 2016
作者:
xueli.xue
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
GLUE远程任务init
上级
cfae320f
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
81 行增加
和
28 行删除
+81
-28
JobCodeController.java
...c/main/java/com/xxl/job/controller/JobCodeController.java
+11
-0
index.ftl
...-admin/src/main/webapp/WEB-INF/template/jobcode/index.ftl
+21
-18
jobcode.index.1.js
xxl-job-admin/src/main/webapp/static/js/jobcode.index.1.js
+48
-9
jobinfo.index.1.js
xxl-job-admin/src/main/webapp/static/js/jobinfo.index.1.js
+1
-1
没有找到文件。
xxl-job-admin/src/main/java/com/xxl/job/controller/JobCodeController.java
浏览文件 @
4b2b6d82
...
...
@@ -5,6 +5,10 @@ import javax.servlet.http.HttpServletRequest;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
com.xxl.job.core.model.ReturnT
;
import
com.xxl.job.core.model.XxlJobInfo
;
/**
* job code controller
...
...
@@ -19,4 +23,11 @@ public class JobCodeController {
return
"jobcode/index"
;
}
@RequestMapping
(
"/save"
)
@ResponseBody
public
ReturnT
<
String
>
save
(
Model
model
,
XxlJobInfo
jobInfo
,
HttpServletRequest
request
)
{
return
ReturnT
.
SUCCESS
;
}
}
xxl-job-admin/src/main/webapp/WEB-INF/template/jobcode/index.ftl
浏览文件 @
4b2b6d82
...
...
@@ -15,7 +15,7 @@
}
</style>
</head>
<body>
<body
class=
" layout-top-nav"
>
<div
class=
"wrapper"
>
...
...
@@ -27,12 +27,11 @@
<!-- Main content -->
<section
class=
"content"
>
<div
class=
"row"
>
<div
class=
"col-xs-4"
>
<div
class=
"input-group margin"
>
<div
class=
"input-group-btn"
>
<button
type=
"button"
class=
"btn btn-
default
"
>
版本回溯
</button>
<button
type=
"button"
class=
"btn btn-
info
"
>
版本回溯
</button>
</div>
<select
class=
"form-control"
id=
"jobGroup"
>
<option
value=
"999"
>
逻辑调整版本C
</option>
...
...
@@ -45,15 +44,15 @@
<div
class=
"col-xs-4"
>
<div
class=
"input-group margin"
>
<div
class=
"input-group-btn"
>
<button
type=
"button"
class=
"btn btn-
default"
>
Action
</button>
<button
type=
"button"
class=
"btn btn-
info"
>
备注
</button>
</div>
<input
type=
"text"
class=
"form-control"
id=
"
jobName
"
value=
"${jobName}"
autocomplete=
"on"
>
<input
type=
"text"
class=
"form-control"
id=
"
codeRemark
"
value=
"${jobName}"
autocomplete=
"on"
>
</div>
</div>
<div
class=
"col-xs-2"
>
<div
class=
"input-group margin"
>
<div
class=
"input-group-btn"
>
<button
type=
"button"
class=
"btn btn-
info"
>
保存
</button>
<button
type=
"button"
class=
"btn btn-
primary"
id=
"save"
>
保存
</button>
</div>
</div>
</div>
...
...
@@ -61,8 +60,18 @@
<div
class=
"row"
>
<div
class=
"col-xs-12"
>
<div
class=
"box"
>
<textarea
id=
"editor"
>
<div
class=
"box callout callout-info"
>
<textarea
id=
"codeSource"
></textarea>
</div>
</div>
</div>
</section>
</div>
<!-- footer -->
<
@
netCommon
.
commonFooter
/>
</div>
<textarea
id=
"demoCode"
>
package com.xxl.job.service.handler;
import org.slf4j.Logger;
...
...
@@ -83,16 +92,7 @@ public class DemoJobHandler extends IJobHandler {
return
JobHandleStatus
.
SUCCESS
;
}
}
</
textarea
>
</div>
</div>
</div>
</section>
</div>
<!-- footer -->
<
@
netCommon
.
commonFooter
/>
</div>
</
textarea
>
<
@
netCommon
.
comAlert
/>
<
@
netCommon
.
commonScript
/>
...
...
@@ -100,6 +100,9 @@ public class DemoJobHandler extends IJobHandler {
<script
src=
"${request.contextPath}/static/plugins/codemirror/mode/clike/clike.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>
var
id
=
$
{
id
!-
1
};
</script>
<script
src=
"${request.contextPath}/static/js/jobcode.index.1.js"
></script>
</body>
</html>
xxl-job-admin/src/main/webapp/static/js/jobcode.index.1.js
浏览文件 @
4b2b6d82
$
(
function
()
{
var
javaEditor
=
CodeMirror
.
fromTextArea
(
document
.
getElementById
(
"editor"
),
{
// init code editor
var
codeEditor
=
CodeMirror
.
fromTextArea
(
document
.
getElementById
(
"codeSource"
),
{
mode
:
"text/x-java"
,
lineNumbers
:
true
,
matchBrackets
:
true
,
extraKeys
:
{
"F11"
:
function
(
cm
)
{
cm
.
setOption
(
"fullScreen"
,
!
cm
.
getOption
(
"fullScreen"
));
},
"Esc"
:
function
(
cm
)
{
if
(
cm
.
getOption
(
"fullScreen"
))
cm
.
setOption
(
"fullScreen"
,
false
);
}
matchBrackets
:
true
});
codeEditor
.
setValue
(
$
(
"#demoCode"
).
val
()
);
$
(
"#save"
).
click
(
function
()
{
var
codeSource
=
codeEditor
.
getValue
();
var
codeRemark
=
$
(
"#codeRemark"
).
val
();
if
(
!
codeRemark
)
{
ComAlert
.
show
(
1
,
"请输入备注"
);
return
;
}
if
(
codeRemark
.
length
<
6
||
codeRemark
.
length
>
100
)
{
ComAlert
.
show
(
1
,
"备注长度应该在6至100之间"
);
return
;
}
ComConfirm
.
show
(
"是否执行保存操作?"
,
function
(){
$
.
ajax
({
type
:
'POST'
,
url
:
base_url
+
'/jobcode/save'
,
data
:
{
'jobInfo.id'
:
id
,
'jobInfo.codeSource'
:
codeSource
,
'jobInfo.codeRemark'
:
codeRemark
},
dataType
:
"json"
,
success
:
function
(
data
){
if
(
data
.
code
==
200
)
{
ComAlert
.
show
(
1
,
'提交成功'
,
function
(){
//$(window).unbind('beforeunload');
window
.
location
.
reload
();
});
}
else
{
ComAlert
.
alert
(
data
.
msg
);
}
}
});
});
});
// before upload
/*$(window).bind('beforeunload',function(){
return 'Glue尚未保存,确定离开Glue编辑器?';
});*/
});
xxl-job-admin/src/main/webapp/static/js/jobinfo.index.1.js
浏览文件 @
4b2b6d82
...
...
@@ -111,7 +111,7 @@ $(function() {
pause_resume
+
'<button class="btn btn-primary btn-xs" type="job_del" type="button" onclick="javascript:window.open(
\'
'
+
logUrl
+
'
\'
)" >日志</button><br> '
+
'<button class="btn btn-warning btn-xs update" type="button">编辑</button> '
+
'<button class="btn btn-warning btn-xs" type="button" onclick="javascript:window.open(
\'
'
+
codeUrl
+
'
\'
)" >
COD
E</button> '
+
'<button class="btn btn-warning btn-xs" type="button" onclick="javascript:window.open(
\'
'
+
codeUrl
+
'
\'
)" >
GLU
E</button> '
+
'<button class="btn btn-danger btn-xs job_operate" type="job_del" type="button">删除</button> '
+
'</p>'
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论