|
|
@@ -11,7 +11,7 @@ $(function() {
|
|
11
|
11
|
dataType : "json",
|
|
12
|
12
|
success : function(data){
|
|
13
|
13
|
if (data.code == 200) {
|
|
14
|
|
- $("#jobId").html('<option value="0" >全部</option>');
|
|
|
14
|
+ $("#jobId").html( '<option value="0" >'+ I18n.system_all +'</option>' );
|
|
15
|
15
|
$.each(data.content, function (n, value) {
|
|
16
|
16
|
$("#jobId").append('<option value="' + value.id + '" >' + value.jobDesc + '</option>');
|
|
17
|
17
|
});
|
|
|
@@ -20,8 +20,8 @@ $(function() {
|
|
20
|
20
|
}
|
|
21
|
21
|
} else {
|
|
22
|
22
|
layer.open({
|
|
23
|
|
- title: '系统提示',
|
|
24
|
|
- content: (data.msg || "接口异常"),
|
|
|
23
|
+ title: I18n.system_tips ,
|
|
|
24
|
+ content: (data.msg || I18n.system_api_error ),
|
|
25
|
25
|
icon: '2'
|
|
26
|
26
|
});
|
|
27
|
27
|
}
|
|
|
@@ -34,6 +34,15 @@ $(function() {
|
|
34
|
34
|
}
|
|
35
|
35
|
|
|
36
|
36
|
// filter Time
|
|
|
37
|
+ var rangesConf = {};
|
|
|
38
|
+ rangesConf[I18n.daterangepicker_ranges_recent_hour] = [moment().subtract(1, 'hours'), moment()];
|
|
|
39
|
+ rangesConf[I18n.daterangepicker_ranges_today] = [moment().startOf('day'), moment().endOf('day')];
|
|
|
40
|
+ rangesConf[I18n.daterangepicker_ranges_yesterday] = [moment().subtract(1, 'days').startOf('day'), moment().subtract(1, 'days').endOf('day')];
|
|
|
41
|
+ rangesConf[I18n.daterangepicker_ranges_this_month] = [moment().startOf('month'), moment().endOf('month')];
|
|
|
42
|
+ rangesConf[I18n.daterangepicker_ranges_last_month] = [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')];
|
|
|
43
|
+ rangesConf[I18n.daterangepicker_ranges_recent_week] = [moment().subtract(1, 'weeks'), moment()];
|
|
|
44
|
+ rangesConf[I18n.daterangepicker_ranges_recent_month] = [moment().subtract(1, 'months'), moment()];
|
|
|
45
|
+
|
|
37
|
46
|
$('#filterTime').daterangepicker({
|
|
38
|
47
|
autoApply:false,
|
|
39
|
48
|
singleDatePicker:false,
|
|
|
@@ -42,29 +51,21 @@ $(function() {
|
|
42
|
51
|
timePickerIncrement: 10, // 时间的增量,单位为分钟
|
|
43
|
52
|
timePicker24Hour : true,
|
|
44
|
53
|
opens : 'left', //日期选择框的弹出位置
|
|
45
|
|
- ranges: {
|
|
46
|
|
- '最近1小时': [moment().subtract(1, 'hours'), moment()],
|
|
47
|
|
- '今日': [moment().startOf('day'), moment().endOf('day')],
|
|
48
|
|
- '昨日': [moment().subtract(1, 'days').startOf('day'), moment().subtract(1, 'days').endOf('day')],
|
|
49
|
|
- '最近7日': [moment().subtract(6, 'days'), moment()],
|
|
50
|
|
- '最近30日': [moment().subtract(29, 'days'), moment()],
|
|
51
|
|
- '本月': [moment().startOf('month'), moment().endOf('month')],
|
|
52
|
|
- '上个月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
|
53
|
|
- },
|
|
|
54
|
+ ranges: rangesConf,
|
|
54
|
55
|
locale : {
|
|
55
|
56
|
format: 'YYYY-MM-DD HH:mm:ss',
|
|
56
|
57
|
separator : ' - ',
|
|
57
|
|
- customRangeLabel : '自定义',
|
|
58
|
|
- applyLabel : '确定',
|
|
59
|
|
- cancelLabel : '取消',
|
|
60
|
|
- fromLabel : '起始时间',
|
|
61
|
|
- toLabel : '结束时间',
|
|
62
|
|
- daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
|
|
63
|
|
- monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月' ],
|
|
64
|
|
- firstDay : 1,
|
|
65
|
|
- startDate: moment().startOf('day'),
|
|
66
|
|
- endDate: moment().endOf('day')
|
|
67
|
|
- }
|
|
|
58
|
+ customRangeLabel : I18n.daterangepicker_custom_name ,
|
|
|
59
|
+ applyLabel : I18n.system_ok ,
|
|
|
60
|
+ cancelLabel : I18n.system_cancel ,
|
|
|
61
|
+ fromLabel : I18n.daterangepicker_custom_starttime ,
|
|
|
62
|
+ toLabel : I18n.daterangepicker_custom_endtime ,
|
|
|
63
|
+ daysOfWeek : I18n.daterangepicker_custom_daysofweek.split(',') , // '日', '一', '二', '三', '四', '五', '六'
|
|
|
64
|
+ monthNames : I18n.daterangepicker_custom_monthnames.split(',') , // '一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'
|
|
|
65
|
+ firstDay : 1
|
|
|
66
|
+ },
|
|
|
67
|
+ startDate: rangesConf[I18n.daterangepicker_ranges_today][0],
|
|
|
68
|
+ endDate: rangesConf[I18n.daterangepicker_ranges_today][1]
|
|
68
|
69
|
});
|
|
69
|
70
|
|
|
70
|
71
|
// init date tables
|
|
|
@@ -94,23 +95,16 @@ $(function() {
|
|
94
|
95
|
"visible" : true,
|
|
95
|
96
|
"width":'10%',
|
|
96
|
97
|
"render": function ( data, type, row ) {
|
|
97
|
|
- var glueTypeTitle = row.glueType;
|
|
98
|
|
- if ('GLUE_GROOVY'==row.glueType) {
|
|
99
|
|
- glueTypeTitle = "GLUE模式(Java)";
|
|
100
|
|
- } else if ('GLUE_SHELL'==row.glueType) {
|
|
101
|
|
- glueTypeTitle = "GLUE模式(Shell)";
|
|
102
|
|
- } else if ('GLUE_PYTHON'==row.glueType) {
|
|
103
|
|
- glueTypeTitle = "GLUE模式(Python)";
|
|
104
|
|
- }else if ('GLUE_NODEJS'==row.glueType) {
|
|
105
|
|
- glueTypeTitle = "GLUE模式(Nodejs)";
|
|
106
|
|
- } else if ('BEAN'==row.glueType) {
|
|
107
|
|
- glueTypeTitle = "BEAN模式:" + row.executorHandler;
|
|
108
|
|
- }
|
|
|
98
|
+
|
|
|
99
|
+ var glueTypeTitle = GlueTypeEnum[row.glueType];
|
|
|
100
|
+ if (row.executorHandler) {
|
|
|
101
|
+ glueTypeTitle = glueTypeTitle +":" + row.executorHandler;
|
|
|
102
|
+ }
|
|
109
|
103
|
|
|
110
|
104
|
var temp = '';
|
|
111
|
|
- temp += '执行器地址:' + (row.executorAddress?row.executorAddress:'');
|
|
112
|
|
- temp += '<br>运行模式:' + glueTypeTitle;
|
|
113
|
|
- temp += '<br>任务参数:' + row.executorParam;
|
|
|
105
|
+ temp += I18n.joblog_field_executorAddress + ':' + (row.executorAddress?row.executorAddress:'');
|
|
|
106
|
+ temp += '<br>'+ I18n.jobinfo_field_gluetype +':' + glueTypeTitle;
|
|
|
107
|
+ temp += '<br>'+ I18n.jobinfo_field_executorparam +':' + row.executorParam;
|
|
114
|
108
|
|
|
115
|
109
|
return '<a class="logTips" href="javascript:;" >'+ row.jobId +'<span style="display:none;">'+ temp +'</span></a>';
|
|
116
|
110
|
}
|
|
|
@@ -129,9 +123,9 @@ $(function() {
|
|
129
|
123
|
"render": function ( data, type, row ) {
|
|
130
|
124
|
var html = data;
|
|
131
|
125
|
if (data == 200) {
|
|
132
|
|
- html = '<span style="color: green">成功</span>';
|
|
|
126
|
+ html = '<span style="color: green">'+ I18n.system_success +'</span>';
|
|
133
|
127
|
} else if (data == 500) {
|
|
134
|
|
- html = '<span style="color: red">失败</span>';
|
|
|
128
|
+ html = '<span style="color: red">'+ I18n.system_fail +'</span>';
|
|
135
|
129
|
} else if (data == 0) {
|
|
136
|
130
|
html = '';
|
|
137
|
131
|
}
|
|
|
@@ -142,7 +136,7 @@ $(function() {
|
|
142
|
136
|
"data": 'triggerMsg',
|
|
143
|
137
|
"width":'12%',
|
|
144
|
138
|
"render": function ( data, type, row ) {
|
|
145
|
|
- return data?'<a class="logTips" href="javascript:;" >查看<span style="display:none;">'+ data +'</span></a>':"无";
|
|
|
139
|
+ return data?'<a class="logTips" href="javascript:;" >'+ I18n.system_show +'<span style="display:none;">'+ data +'</span></a>':I18n.system_empty;
|
|
146
|
140
|
}
|
|
147
|
141
|
},
|
|
148
|
142
|
{
|
|
|
@@ -158,11 +152,11 @@ $(function() {
|
|
158
|
152
|
"render": function ( data, type, row ) {
|
|
159
|
153
|
var html = data;
|
|
160
|
154
|
if (data == 200) {
|
|
161
|
|
- html = '<span style="color: green">成功</span>';
|
|
|
155
|
+ html = '<span style="color: green">'+ I18n.joblog_handleCode_200 +'</span>';
|
|
162
|
156
|
} else if (data == 500) {
|
|
163
|
|
- html = '<span style="color: red">失败</span>';
|
|
|
157
|
+ html = '<span style="color: red">'+ I18n.joblog_handleCode_500 +'</span>';
|
|
164
|
158
|
} else if (data == 501) {
|
|
165
|
|
- html = '<span style="color: red">失败重试</span>';
|
|
|
159
|
+ html = '<span style="color: red">'+ I18n.joblog_handleCode_501 +'</span>';
|
|
166
|
160
|
} else if (data == 0) {
|
|
167
|
161
|
html = '';
|
|
168
|
162
|
}
|
|
|
@@ -173,7 +167,7 @@ $(function() {
|
|
173
|
167
|
"data": 'handleMsg',
|
|
174
|
168
|
"width":'12%',
|
|
175
|
169
|
"render": function ( data, type, row ) {
|
|
176
|
|
- return data?'<a class="logTips" href="javascript:;" >查看<span style="display:none;">'+ data +'</span></a>':"无";
|
|
|
170
|
+ return data?'<a class="logTips" href="javascript:;" >'+ I18n.system_show +'<span style="display:none;">'+ data +'</span></a>':I18n.system_empty;
|
|
177
|
171
|
}
|
|
178
|
172
|
},
|
|
179
|
173
|
{
|
|
|
@@ -184,9 +178,9 @@ $(function() {
|
|
184
|
178
|
// better support expression or string, not function
|
|
185
|
179
|
return function () {
|
|
186
|
180
|
if (row.triggerCode == 200){
|
|
187
|
|
- var temp = '<a href="javascript:;" class="logDetail" _id="'+ row.id +'">执行日志</a>';
|
|
|
181
|
+ var temp = '<a href="javascript:;" class="logDetail" _id="'+ row.id +'">'+ I18n.joblog_rolling_log +'</a>';
|
|
188
|
182
|
if(row.handleCode == 0){
|
|
189
|
|
- temp += '<br><a href="javascript:;" class="logKill" _id="'+ row.id +'" style="color: red;" >终止任务</a>';
|
|
|
183
|
+ temp += '<br><a href="javascript:;" class="logKill" _id="'+ row.id +'" style="color: red;" >'+ I18n.joblog_kill_log +'</a>';
|
|
190
|
184
|
}
|
|
191
|
185
|
return temp;
|
|
192
|
186
|
}
|
|
|
@@ -195,30 +189,30 @@ $(function() {
|
|
195
|
189
|
}
|
|
196
|
190
|
}
|
|
197
|
191
|
],
|
|
198
|
|
- "language" : {
|
|
199
|
|
- "sProcessing" : "处理中...",
|
|
200
|
|
- "sLengthMenu" : "每页 _MENU_ 条记录",
|
|
201
|
|
- "sZeroRecords" : "没有匹配结果",
|
|
202
|
|
- "sInfo" : "第 _PAGE_ 页 ( 总共 _PAGES_ 页,_TOTAL_ 条记录 )",
|
|
203
|
|
- "sInfoEmpty" : "无记录",
|
|
204
|
|
- "sInfoFiltered" : "(由 _MAX_ 项结果过滤)",
|
|
205
|
|
- "sInfoPostFix" : "",
|
|
206
|
|
- "sSearch" : "搜索:",
|
|
207
|
|
- "sUrl" : "",
|
|
208
|
|
- "sEmptyTable" : "表中数据为空",
|
|
209
|
|
- "sLoadingRecords" : "载入中...",
|
|
210
|
|
- "sInfoThousands" : ",",
|
|
211
|
|
- "oPaginate" : {
|
|
212
|
|
- "sFirst" : "首页",
|
|
213
|
|
- "sPrevious" : "上页",
|
|
214
|
|
- "sNext" : "下页",
|
|
215
|
|
- "sLast" : "末页"
|
|
216
|
|
- },
|
|
217
|
|
- "oAria" : {
|
|
218
|
|
- "sSortAscending" : ": 以升序排列此列",
|
|
219
|
|
- "sSortDescending" : ": 以降序排列此列"
|
|
220
|
|
- }
|
|
221
|
|
- }
|
|
|
192
|
+ "language" : {
|
|
|
193
|
+ "sProcessing" : I18n.dataTable_sProcessing ,
|
|
|
194
|
+ "sLengthMenu" : I18n.dataTable_sLengthMenu ,
|
|
|
195
|
+ "sZeroRecords" : I18n.dataTable_sZeroRecords ,
|
|
|
196
|
+ "sInfo" : I18n.dataTable_sInfo ,
|
|
|
197
|
+ "sInfoEmpty" : I18n.dataTable_sInfoEmpty ,
|
|
|
198
|
+ "sInfoFiltered" : I18n.dataTable_sInfoFiltered ,
|
|
|
199
|
+ "sInfoPostFix" : "",
|
|
|
200
|
+ "sSearch" : I18n.dataTable_sSearch ,
|
|
|
201
|
+ "sUrl" : "",
|
|
|
202
|
+ "sEmptyTable" : I18n.dataTable_sEmptyTable ,
|
|
|
203
|
+ "sLoadingRecords" : I18n.dataTable_sLoadingRecords ,
|
|
|
204
|
+ "sInfoThousands" : ",",
|
|
|
205
|
+ "oPaginate" : {
|
|
|
206
|
+ "sFirst" : I18n.dataTable_sFirst ,
|
|
|
207
|
+ "sPrevious" : I18n.dataTable_sPrevious ,
|
|
|
208
|
+ "sNext" : I18n.dataTable_sNext ,
|
|
|
209
|
+ "sLast" : I18n.dataTable_sLast
|
|
|
210
|
+ },
|
|
|
211
|
+ "oAria" : {
|
|
|
212
|
+ "sSortAscending" : I18n.dataTable_sSortAscending ,
|
|
|
213
|
+ "sSortDescending" : I18n.dataTable_sSortDescending
|
|
|
214
|
+ }
|
|
|
215
|
+ }
|
|
222
|
216
|
});
|
|
223
|
217
|
|
|
224
|
218
|
// logTips alert
|
|
|
@@ -246,7 +240,7 @@ $(function() {
|
|
246
|
240
|
$('#joblog_list').on('click', '.logKill', function(){
|
|
247
|
241
|
var _id = $(this).attr('_id');
|
|
248
|
242
|
|
|
249
|
|
- layer.confirm('确认主动终止任务?', {icon: 3, title:'系统提示'}, function(index){
|
|
|
243
|
+ layer.confirm( (I18n.system_ok + I18n.joblog_kill_log + '?'), {icon: 3, title: I18n.system_tips }, function(index){
|
|
250
|
244
|
layer.close(index);
|
|
251
|
245
|
|
|
252
|
246
|
$.ajax({
|
|
|
@@ -257,8 +251,8 @@ $(function() {
|
|
257
|
251
|
success : function(data){
|
|
258
|
252
|
if (data.code == 200) {
|
|
259
|
253
|
layer.open({
|
|
260
|
|
- title: '系统提示',
|
|
261
|
|
- content: '操作成功',
|
|
|
254
|
+ title: I18n.system_tips,
|
|
|
255
|
+ content: I18n.system_opt_suc ,
|
|
262
|
256
|
icon: '1',
|
|
263
|
257
|
end: function(layero, index){
|
|
264
|
258
|
logTable.fnDraw();
|
|
|
@@ -266,8 +260,8 @@ $(function() {
|
|
266
|
260
|
});
|
|
267
|
261
|
} else {
|
|
268
|
262
|
layer.open({
|
|
269
|
|
- title: '系统提示',
|
|
270
|
|
- content: (data.msg || "操作失败"),
|
|
|
263
|
+ title: I18n.system_tips,
|
|
|
264
|
+ content: (data.msg || I18n.system_opt_fail ),
|
|
271
|
265
|
icon: '2'
|
|
272
|
266
|
});
|
|
273
|
267
|
}
|
|
|
@@ -302,8 +296,8 @@ $(function() {
|
|
302
|
296
|
if (data.code == "200") {
|
|
303
|
297
|
$('#clearLogModal').modal('hide');
|
|
304
|
298
|
layer.open({
|
|
305
|
|
- title: '系统提示',
|
|
306
|
|
- content: '日志清理成功',
|
|
|
299
|
+ title: I18n.system_tips ,
|
|
|
300
|
+ content: (I18n.joblog_clean_log + I18n.system_success) ,
|
|
307
|
301
|
icon: '1',
|
|
308
|
302
|
end: function(layero, index){
|
|
309
|
303
|
logTable.fnDraw();
|
|
|
@@ -311,8 +305,8 @@ $(function() {
|
|
311
|
305
|
});
|
|
312
|
306
|
} else {
|
|
313
|
307
|
layer.open({
|
|
314
|
|
- title: '系统提示',
|
|
315
|
|
- content: (data.msg || "日志清理失败"),
|
|
|
308
|
+ title: I18n.system_tips ,
|
|
|
309
|
+ content: (data.msg || (I18n.joblog_clean_log + I18n.system_fail) ),
|
|
316
|
310
|
icon: '2'
|
|
317
|
311
|
});
|
|
318
|
312
|
}
|
|
|
@@ -335,7 +329,7 @@ var ComAlertTec = {
|
|
335
|
329
|
'<div class="modal-body"><div class="alert" style="color:#fff;"></div></div>' +
|
|
336
|
330
|
'<div class="modal-footer">' +
|
|
337
|
331
|
'<div class="text-center" >' +
|
|
338
|
|
- '<button type="button" class="btn btn-info ok" data-dismiss="modal" >确认</button>' +
|
|
|
332
|
+ '<button type="button" class="btn btn-info ok" data-dismiss="modal" >'+ I18n.system_ok +'</button>' +
|
|
339
|
333
|
'</div>' +
|
|
340
|
334
|
'</div>' +
|
|
341
|
335
|
'</div>' +
|