showdetailjob.jsp
11.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
<%@page language="java" contentType="text/html;charset=utf-8" %>
<%@page import="com.ui.contants.ProjectConstant"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=basePath %>css/bootstrap.min.css"/>
<link rel="stylesheet" href="<%=basePath %>css/unicorn.main.css"/>
<link rel="stylesheet" href="<%=basePath %>css/unicorn.grey.css"/>
<link rel="stylesheet" href="<%=basePath %>css/jquery-ui.css"/>
<link rel="stylesheet" href="<%=basePath %>css/bootstrap-responsive.min.css"/>
<link rel="stylesheet" href="<%=basePath %>css/uniform.css"/>
<link rel="stylesheet" href="<%=basePath %>css/select2.css"/>
<script src="<%=basePath %>js/excanvas.min.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/jquery-1.12.0.min.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/jquery-plugin/jquery.extend.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/jquery-ui.custom.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>/js/bootstrap.min.js"></script>
<script src="<%=basePath %>/js/unicorn.js"></script>
<script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/moment-with-locales.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/bootstrap-datetimepicker.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/global.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.pagination.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/jsquartz/bootstrap.table.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.dialog.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.form.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.panel.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.alerts.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.accordion.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.breadcrumb.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.validate.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.form.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/layer/layer.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.select.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/jstree/jstree.min.js"></script>
<script src="<%=basePath %>js/jquery.toaster.js"></script>
<script src="<%=basePath %>js/laydate/laydate.js" charset="UTF-8" type="text/javascript"></script>
<script>
var contextPath = '<%=basePath %>';
</script>
</head>
<body>
<!-- 头部 -->
<div id="head">
</div>
<!-- 右侧具体内容 -->
<div id="content">
<div class="container-fluid">
<div class="widget-box">
<div class="widget-content nopadding">
<div id="showDetailDiv">
<div id="showDetailTable"></div>
</div>
</div>
</div>
</div>
</div>
<script src="<%=basePath %>script/common/genarate_left_panel.js?v=<%=ProjectConstant.MENU_VERSION %>"></script>
<script>
$("#li_other").addClass("active open");
$("#li_crm_job").addClass("active");
</script>
</body>
</html>
<script>
$(function () {
var currentPage=1;
/*var args = new Object();
args = GetUrlParms();*/
var jobname1 ="${jobname}";
var jobgroup1 = "${jobgroup}";
var module1 = "${module}";
var queryData = {}
$("#showDetailDiv #showDetailTable").table(
{
url: contextPath+"/job/getJobProcessDetail.do",
queryParams: {
"jobName": jobname1,
"jobGroup": jobgroup1,
"module": module1
},
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
currentPage: currentPage,
title: "任务执行情况",
panelClass: "panel-primary",
striped: true,
pagination: true,
pageSize: 10,
loadFilter: function (data) {
return data.data;
},
columns: [
{
title: "任务Id",
field: "jobId"
},
{
title: "任务名称",
field: "jobName"
},
{
title: "任务所属组",
field: "jobGroup"
},
{
title: "任务所属模块",
field: "module"
},
{
title: "调度器名称",
field: "schedulerName"
},
{
title: "调度器实例",
field: "schedulerInstanceId"
},
{
title: "执行结果",
field: "result"
},
{
title: "本次执行开始时间",
field: "startTime"
},
{
title: "本次执行结束时间",
field: "endTime"
},
{
title: "任务执行器",
field: "processor"
},
{
title: "任务执行上下文",
field: "context"
},
{
title: "附加信息",
field: "message",
formatter: function (value, rowData, rowIndex) {
var messageinfo = "";
if (typeof (rowData.message) == "string") {
if ((rowData.message).length > 200) {
messageinfo = rowData.message
.substring(0, 200)
+ "...";
} else {
messageinfo = rowData.message;
}
return messageinfo;
}
}
},
{
title: "操作",
formatter: function (value, rowData, rowIndex) {
var div = $("<div>");
// if (rowData.status == 0) {//已暂停,可以开启
var openBtn = $("<button>").addClass(
"btn btn-xs btn-success").html(
"重新执行").appendTo(div);
div.append(" ");
openBtn.click(function () {//开启变为待执行状态
retrySchedule(rowData, this,
"确定重新执行吗", "确定重新执行任务么");
});
// }
div.append(" ");
div.append(" ");
return div;
}
}]
});
});
function retrySchedule(job, obj, title, meg) {
var dialog = $("<div>").appendTo($("body"));
var jobInfo ={
"id" : job.jobId,
"jobGroup" : job.jobGroup,
"module" : job.module
};
dialog.dialog({
title: title,
backdrop: "static",
content: meg,
buttons: [{
text: "否",
className: "btn-danger",
onclick: function () {
$(dialog).dialog("hide");
}
}, {
text: "是",
className: "btn-success",
onclick: function () {
$(dialog).dialog("hide");
$.ajax({
url: contextPath+"/job/rescheduleJob.do",
type: 'post',
contentType: "application/json; charset=utf-8",
data: JSON.stringify(jobInfo),
dataType: "json",
success: function (data) {
if (!data || data.code != 200) {
var dialog = $("<div>").appendTo($("body"));
dialog.dialog({
title: "重试失败",
backdrop: "static",
content: "重试失败",
buttons: [{
text: "确定",
className: "btn-danger",
onclick: function () {
$(dialog).dialog("hide");
}
}]
});
}
$("#showDetailTable").table("load");
}
});
}
}]
});
}
/* function GetUrlParms() {
var args = new Object();
var url = location.search.substring(1);//获取查询串
var query = decodeURI(url);
var pairs = query.split("&");//在处断开
for (var i = 0; i < pairs.length; i++) {
var pos = pairs[i].indexOf('=');//查找name=value
if (pos == -1)
continue;//如果没有找到就跳过
var argname = pairs[i].substring(0, pos);//提取name
var value = pairs[i].substring(pos + 1);//提取value
args[argname] = unescape(value);//存为属性
}
return args;
}*/
</script>