任务日志界面操作国际化迁移完成

pull/6/head
xuxueli 7 years ago
parent 844f51c549
commit c2f3a827b0

@ -10,6 +10,7 @@ import com.xxl.job.admin.dao.XxlJobLogDao;
import com.xxl.job.core.biz.ExecutorBiz;
import com.xxl.job.core.biz.model.LogResult;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.glue.GlueTypeEnum;
import com.xxl.job.core.rpc.netcom.NetComClientProxy;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
@ -50,6 +51,7 @@ public class JobLogController {
// 执行器列表
List<XxlJobGroup> jobGroupList = xxlJobGroupDao.findAll();
model.addAttribute("JobGroupList", jobGroupList);
model.addAttribute("GlueTypeEnum", GlueTypeEnum.values());
// 任务
if (jobId > 0) {

@ -18,14 +18,21 @@ system_add_suc=新增成功
system_add_fail=新增失败
system_update_suc=更新成功
system_update_fail=更新失败
system_all=全部
system_api_error=接口异常
system_show=查看
system_empty=
system_opt_suc=操作成功
system_opt_fail=操作失败
## daterangepicker
daterangepicker_ranges_recent_hour=最近一小时
daterangepicker_ranges_today=今日
daterangepicker_ranges_yesterday=昨日
daterangepicker_ranges_this_month=本月
daterangepicker_ranges_last_month=上个月
daterangepicker_ranges_recent_week=最近1
daterangepicker_ranges_recent_month=最近1
daterangepicker_ranges_recent_week=最近
daterangepicker_ranges_recent_month=最近
daterangepicker_custom_name=自定义
daterangepicker_custom_starttime=起始时间
daterangepicker_custom_endtime=结束时间
@ -87,13 +94,14 @@ job_dashboard_rate_report_fail_count=失败调度次数
## job info
jobinfo_name=任务管理
jobinfo_job=任务
jobinfo_field_add=新增任务
jobinfo_field_update=更新任务
jobinfo_field_id=任务ID
jobinfo_field_jobgroup=执行器
jobinfo_field_jobdesc=任务描述
jobinfo_field_gluetype=运行模式
jobinfo_field_executorparam=执行参数
jobinfo_field_executorparam=任务参数
jobinfo_field_author=负责人
jobinfo_field_alarmemail=报警邮件
jobinfo_field_alarmemail_placeholder=请输入报警邮件,多个邮件地址则逗号分隔
@ -114,6 +122,35 @@ jobinfo_opt_del=删除
## job log
joblog_name=调度日志
joblog_status=状态
joblog_status_all=全部
joblog_status_suc=成功
joblog_status_fail=失败
joblog_status_running=进行中
joblog_field_triggerTime=调度时间
joblog_field_triggerCode=调度结果
joblog_field_triggerMsg=调度备注
joblog_field_handleTime=执行时间
joblog_field_handleCode=执行结果
joblog_field_handleMsg=执行备注
joblog_field_executorAddress=执行器地址
joblog_clean=清理
joblog_clean_log=日志清理
joblog_clean_type=清理方式
joblog_clean_type_1=清理一个月之前日志数据
joblog_clean_type_2=清理三个月之前日志数据
joblog_clean_type_3=清理六个月之前日志数据
joblog_clean_type_4=清理一年之前日志数据
joblog_clean_type_5=清理一千条以前日志数据
joblog_clean_type_6=清理一万条以前日志数据
joblog_clean_type_7=清理三万条以前日志数据
joblog_clean_type_8=清理十万条以前日志数据
joblog_clean_type_9=清理所有日志数据
joblog_handleCode_200=成功
joblog_handleCode_500=失败
joblog_handleCode_501=失败重试
joblog_rolling_log=执行日志
joblog_kill_log=终止任务
## job group
jobgroup_name=执行器管理

@ -21,12 +21,6 @@
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>${I18n.joblog_name}</h1>
<!--
<ol class="breadcrumb">
<li><a><i class="fa fa-dashboard"></i></a></li>
<li class="active"></li>
</ol>
-->
</section>
<!-- Main content -->
@ -34,9 +28,9 @@
<div class="row">
<div class="col-xs-2">
<div class="input-group">
<span class="input-group-addon"></span>
<span class="input-group-addon">${I18n.jobinfo_field_jobgroup}</span>
<select class="form-control" id="jobGroup" paramVal="<#if jobInfo?exists>${jobInfo.jobGroup}</#if>" >
<option value="0" ></option>
<option value="0" >${I18n.system_all}</option>
<#list JobGroupList as group>
<option value="${group.id}" >${group.title}</option>
</#list>
@ -45,21 +39,21 @@
</div>
<div class="col-xs-2">
<div class="input-group">
<span class="input-group-addon"></span>
<span class="input-group-addon">${I18n.jobinfo_job}</span>
<select class="form-control" id="jobId" paramVal="<#if jobInfo?exists>${jobInfo.id}</#if>" >
<option value="0" ></option>
<option value="0" >${I18n.system_all}</option>
</select>
</div>
</div>
<div class="col-xs-2">
<div class="input-group">
<span class="input-group-addon"></span>
<span class="input-group-addon">${I18n.joblog_status}</span>
<select class="form-control" id="logStatus" >
<option value="-1" ></option>
<option value="1" ></option>
<option value="2" ></option>
<option value="3" ></option>
<option value="-1" >${I18n.joblog_status_all}</option>
<option value="1" >${I18n.joblog_status_suc}</option>
<option value="2" >${I18n.joblog_status_fail}</option>
<option value="3" >${I18n.joblog_status_running}</option>
</select>
</div>
</div>
@ -74,11 +68,11 @@
</div>
<div class="col-xs-1">
<button class="btn btn-block btn-info" id="searchBtn"></button>
<button class="btn btn-block btn-info" id="searchBtn">${I18n.system_search}</button>
</div>
<div class="col-xs-1">
<button class="btn btn-block btn-nomal" id="clearLog"></button>
<button class="btn btn-block btn-nomal" id="clearLog">${I18n.joblog_clean}</button>
</div>
</div>
@ -90,18 +84,18 @@
<table id="joblog_list" class="table table-bordered table-striped display" width="100%" >
<thead>
<tr>
<th name="jobId" >ID</th>
<th name="jobGroup" >ID</th>
<th name="jobId" >${I18n.jobinfo_field_id}</th>
<th name="jobGroup" >jobGroup</th>
<#--<th name="executorAddress" ></th>
<th name="glueType" ></th>
<th name="executorParam" ></th>-->
<th name="triggerTime" ></th>
<th name="triggerCode" ></th>
<th name="triggerMsg" ></th>
<th name="handleTime" ></th>
<th name="handleCode" ></th>
<th name="handleMsg" ></th>
<th name="handleMsg" ></th>
<th name="triggerTime" >${I18n.joblog_field_triggerTime}</th>
<th name="triggerCode" >${I18n.joblog_field_triggerCode}</th>
<th name="triggerMsg" >${I18n.joblog_field_triggerMsg}</th>
<th name="handleTime" >${I18n.joblog_field_handleTime}</th>
<th name="handleCode" >${I18n.joblog_field_handleCode}</th>
<th name="handleMsg" >${I18n.joblog_field_handleMsg}</th>
<th name="handleMsg" >${I18n.system_opt}</th>
</tr>
</thead>
<tbody></tbody>
@ -122,12 +116,12 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" ></h4>
<h4 class="modal-title" >${I18n.joblog_clean_log}</h4>
</div>
<div class="modal-body">
<form class="form-horizontal form" role="form" >
<div class="form-group">
<label class="col-sm-3 control-label""></label>
<label class="col-sm-3 control-label"">${I18n.jobinfo_field_jobgroup}</label>
<div class="col-sm-9">
<input type="text" class="form-control jobGroupText" readonly >
<input type="hidden" name="jobGroup" >
@ -135,7 +129,7 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label""></label>
<label class="col-sm-3 control-label"">${I18n.jobinfo_job}</label>
<div class="col-sm-9">
<input type="text" class="form-control jobIdText" readonly >
<input type="hidden" name="jobId" >
@ -143,18 +137,18 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label""></label>
<label class="col-sm-3 control-label"">${I18n.joblog_clean_type}</label>
<div class="col-sm-9">
<select class="form-control" name="type" >
<option value="1" ></option>
<option value="2" ></option>
<option value="3" ></option>
<option value="4" ></option>
<option value="5" ></option>
<option value="6" ></option>
<option value="7" ></option>
<option value="8" ></option>
<option value="9" ></option>
<option value="1" >${I18n.joblog_clean_type_1}</option>
<option value="2" >${I18n.joblog_clean_type_2}</option>
<option value="3" >${I18n.joblog_clean_type_3}</option>
<option value="4" >${I18n.joblog_clean_type_4}</option>
<option value="5" >${I18n.joblog_clean_type_5}</option>
<option value="6" >${I18n.joblog_clean_type_6}</option>
<option value="7" >${I18n.joblog_clean_type_7}</option>
<option value="8" >${I18n.joblog_clean_type_8}</option>
<option value="9" >${I18n.joblog_clean_type_9}</option>
</select>
</div>
</div>
@ -162,8 +156,8 @@
<hr>
<div class="form-group">
<div class="col-sm-offset-3 col-sm-6">
<button type="button" class="btn btn-primary ok" ></button>
<button type="button" class="btn btn-default" data-dismiss="modal"></button>
<button type="button" class="btn btn-primary ok" >${I18n.system_ok}</button>
<button type="button" class="btn btn-default" data-dismiss="modal">${I18n.system_cancel}</button>
</div>
</div>
</form>
@ -173,6 +167,12 @@
</div>
<@netCommon.commonScript />
<script>
var GlueTypeEnum = {};
<#list GlueTypeEnum as item>
GlueTypeEnum['${item}'] = '${item.desc}';
</#list>
</script>
<!-- DataTables -->
<script src="${request.contextPath}/static/adminlte/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="${request.contextPath}/static/adminlte/plugins/datatables/dataTables.bootstrap.min.js"></script>

@ -4,16 +4,13 @@
$(function () {
// filter Time
var _startDate = moment().subtract(1, 'months'); // defaultrecent_month
var _endDate = moment();
var rangesConf = {};
rangesConf[I18n.daterangepicker_ranges_today] = [moment().startOf('day'), moment().endOf('day')];
rangesConf[I18n.daterangepicker_ranges_yesterday] = [moment().subtract(1, 'days').startOf('day'), moment().subtract(1, 'days').endOf('day')];
rangesConf[I18n.daterangepicker_ranges_this_month] = [moment().startOf('month'), moment().endOf('month')];
rangesConf[I18n.daterangepicker_ranges_last_month] = [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')];
rangesConf[I18n.daterangepicker_ranges_recent_week] = [moment().subtract(1, 'weeks'), moment()];
rangesConf[I18n.daterangepicker_ranges_recent_month] = [_startDate, _endDate];
rangesConf[I18n.daterangepicker_ranges_recent_month] = [moment().subtract(1, 'months'), moment()];
$('#filterTime').daterangepicker({
autoApply:false,
@ -36,12 +33,12 @@ $(function () {
monthNames : I18n.daterangepicker_custom_monthnames.split(',') , // '一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'
firstDay : 1
},
startDate:_startDate,
endDate: _endDate
startDate: rangesConf[I18n.daterangepicker_ranges_recent_month][0] ,
endDate: rangesConf[I18n.daterangepicker_ranges_recent_month][1]
}, function (start, end, label) {
freshChartDate(start, end);
});
freshChartDate(_startDate, _endDate);
freshChartDate(rangesConf[I18n.daterangepicker_ranges_recent_month][0], rangesConf[I18n.daterangepicker_ranges_recent_month][1]);
/**
* fresh Chart Date

@ -11,7 +11,7 @@ $(function() {
dataType : "json",
success : function(data){
if (data.code == 200) {
$("#jobId").html('<option value="0" ></option>');
$("#jobId").html( '<option value="0" >'+ I18n.system_all +'</option>' );
$.each(data.content, function (n, value) {
$("#jobId").append('<option value="' + value.id + '" >' + value.jobDesc + '</option>');
});
@ -20,8 +20,8 @@ $(function() {
}
} else {
layer.open({
title: '',
content: (data.msg || "接口异常"),
title: I18n.system_tips ,
content: (data.msg || I18n.system_api_error ),
icon: '2'
});
}
@ -34,6 +34,15 @@ $(function() {
}
// filter Time
var rangesConf = {};
rangesConf[I18n.daterangepicker_ranges_recent_hour] = [moment().subtract(1, 'hours'), moment()];
rangesConf[I18n.daterangepicker_ranges_today] = [moment().startOf('day'), moment().endOf('day')];
rangesConf[I18n.daterangepicker_ranges_yesterday] = [moment().subtract(1, 'days').startOf('day'), moment().subtract(1, 'days').endOf('day')];
rangesConf[I18n.daterangepicker_ranges_this_month] = [moment().startOf('month'), moment().endOf('month')];
rangesConf[I18n.daterangepicker_ranges_last_month] = [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')];
rangesConf[I18n.daterangepicker_ranges_recent_week] = [moment().subtract(1, 'weeks'), moment()];
rangesConf[I18n.daterangepicker_ranges_recent_month] = [moment().subtract(1, 'months'), moment()];
$('#filterTime').daterangepicker({
autoApply:false,
singleDatePicker:false,
@ -42,29 +51,21 @@ $(function() {
timePickerIncrement: 10, // 时间的增量,单位为分钟
timePicker24Hour : true,
opens : 'left', //日期选择框的弹出位置
ranges: {
'1': [moment().subtract(1, 'hours'), moment()],
'': [moment().startOf('day'), moment().endOf('day')],
'': [moment().subtract(1, 'days').startOf('day'), moment().subtract(1, 'days').endOf('day')],
'7': [moment().subtract(6, 'days'), moment()],
'30': [moment().subtract(29, 'days'), moment()],
'': [moment().startOf('month'), moment().endOf('month')],
'': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
},
ranges: rangesConf,
locale : {
format: 'YYYY-MM-DD HH:mm:ss',
separator : ' - ',
customRangeLabel : '',
applyLabel : '',
cancelLabel : '',
fromLabel : '',
toLabel : '',
daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
monthNames : [ '', '', '', '', '', '', '', '', '', '', '', '' ],
firstDay : 1,
startDate: moment().startOf('day'),
endDate: moment().endOf('day')
}
customRangeLabel : I18n.daterangepicker_custom_name ,
applyLabel : I18n.system_ok ,
cancelLabel : I18n.system_cancel ,
fromLabel : I18n.daterangepicker_custom_starttime ,
toLabel : I18n.daterangepicker_custom_endtime ,
daysOfWeek : I18n.daterangepicker_custom_daysofweek.split(',') , // '日', '一', '二', '三', '四', '五', '六'
monthNames : I18n.daterangepicker_custom_monthnames.split(',') , // '一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'
firstDay : 1
},
startDate: rangesConf[I18n.daterangepicker_ranges_today][0],
endDate: rangesConf[I18n.daterangepicker_ranges_today][1]
});
// init date tables
@ -94,23 +95,16 @@ $(function() {
"visible" : true,
"width":'10%',
"render": function ( data, type, row ) {
var glueTypeTitle = row.glueType;
if ('GLUE_GROOVY'==row.glueType) {
glueTypeTitle = "GLUE模式(Java)";
} else if ('GLUE_SHELL'==row.glueType) {
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;
}
var glueTypeTitle = GlueTypeEnum[row.glueType];
if (row.executorHandler) {
glueTypeTitle = glueTypeTitle +"" + row.executorHandler;
}
var temp = '';
temp += '' + (row.executorAddress?row.executorAddress:'');
temp += '<br>' + glueTypeTitle;
temp += '<br>' + row.executorParam;
temp += I18n.joblog_field_executorAddress + '' + (row.executorAddress?row.executorAddress:'');
temp += '<br>'+ I18n.jobinfo_field_gluetype +'' + glueTypeTitle;
temp += '<br>'+ I18n.jobinfo_field_executorparam +'' + row.executorParam;
return '<a class="logTips" href="javascript:;" >'+ row.jobId +'<span style="display:none;">'+ temp +'</span></a>';
}
@ -129,9 +123,9 @@ $(function() {
"render": function ( data, type, row ) {
var html = data;
if (data == 200) {
html = '<span style="color: green"></span>';
html = '<span style="color: green">'+ I18n.system_success +'</span>';
} else if (data == 500) {
html = '<span style="color: red"></span>';
html = '<span style="color: red">'+ I18n.system_fail +'</span>';
} else if (data == 0) {
html = '';
}
@ -142,7 +136,7 @@ $(function() {
"data": 'triggerMsg',
"width":'12%',
"render": function ( data, type, row ) {
return data?'<a class="logTips" href="javascript:;" ><span style="display:none;">'+ data +'</span></a>':"无";
return data?'<a class="logTips" href="javascript:;" >'+ I18n.system_show +'<span style="display:none;">'+ data +'</span></a>':I18n.system_empty;
}
},
{
@ -158,11 +152,11 @@ $(function() {
"render": function ( data, type, row ) {
var html = data;
if (data == 200) {
html = '<span style="color: green"></span>';
html = '<span style="color: green">'+ I18n.joblog_handleCode_200 +'</span>';
} else if (data == 500) {
html = '<span style="color: red"></span>';
html = '<span style="color: red">'+ I18n.joblog_handleCode_500 +'</span>';
} else if (data == 501) {
html = '<span style="color: red"></span>';
html = '<span style="color: red">'+ I18n.joblog_handleCode_501 +'</span>';
} else if (data == 0) {
html = '';
}
@ -173,7 +167,7 @@ $(function() {
"data": 'handleMsg',
"width":'12%',
"render": function ( data, type, row ) {
return data?'<a class="logTips" href="javascript:;" ><span style="display:none;">'+ data +'</span></a>':"无";
return data?'<a class="logTips" href="javascript:;" >'+ I18n.system_show +'<span style="display:none;">'+ data +'</span></a>':I18n.system_empty;
}
},
{
@ -184,9 +178,9 @@ $(function() {
// better support expression or string, not function
return function () {
if (row.triggerCode == 200){
var temp = '<a href="javascript:;" class="logDetail" _id="'+ row.id +'"></a>';
var temp = '<a href="javascript:;" class="logDetail" _id="'+ row.id +'">'+ I18n.joblog_rolling_log +'</a>';
if(row.handleCode == 0){
temp += '<br><a href="javascript:;" class="logKill" _id="'+ row.id +'" style="color: red;" ></a>';
temp += '<br><a href="javascript:;" class="logKill" _id="'+ row.id +'" style="color: red;" >'+ I18n.joblog_kill_log +'</a>';
}
return temp;
}
@ -195,30 +189,30 @@ $(function() {
}
}
],
"language" : {
"sProcessing" : "处理中...",
"sLengthMenu" : "每页 _MENU_ 条记录",
"sZeroRecords" : "没有匹配结果",
"sInfo" : "第 _PAGE_ 页 ( 总共 _PAGES_ 页_TOTAL_ 条记录 )",
"sInfoEmpty" : "无记录",
"sInfoFiltered" : "(由 _MAX_ 项结果过滤)",
"sInfoPostFix" : "",
"sSearch" : "搜索:",
"sUrl" : "",
"sEmptyTable" : "表中数据为空",
"sLoadingRecords" : "载入中...",
"sInfoThousands" : ",",
"oPaginate" : {
"sFirst" : "首页",
"sPrevious" : "上页",
"sNext" : "下页",
"sLast" : "末页"
},
"oAria" : {
"sSortAscending" : ": 以升序排列此列",
"sSortDescending" : ": 以降序排列此列"
}
}
"language" : {
"sProcessing" : I18n.dataTable_sProcessing ,
"sLengthMenu" : I18n.dataTable_sLengthMenu ,
"sZeroRecords" : I18n.dataTable_sZeroRecords ,
"sInfo" : I18n.dataTable_sInfo ,
"sInfoEmpty" : I18n.dataTable_sInfoEmpty ,
"sInfoFiltered" : I18n.dataTable_sInfoFiltered ,
"sInfoPostFix" : "",
"sSearch" : I18n.dataTable_sSearch ,
"sUrl" : "",
"sEmptyTable" : I18n.dataTable_sEmptyTable ,
"sLoadingRecords" : I18n.dataTable_sLoadingRecords ,
"sInfoThousands" : ",",
"oPaginate" : {
"sFirst" : I18n.dataTable_sFirst ,
"sPrevious" : I18n.dataTable_sPrevious ,
"sNext" : I18n.dataTable_sNext ,
"sLast" : I18n.dataTable_sLast
},
"oAria" : {
"sSortAscending" : I18n.dataTable_sSortAscending ,
"sSortDescending" : I18n.dataTable_sSortDescending
}
}
});
// logTips alert
@ -246,7 +240,7 @@ $(function() {
$('#joblog_list').on('click', '.logKill', function(){
var _id = $(this).attr('_id');
layer.confirm('?', {icon: 3, title:''}, function(index){
layer.confirm( (I18n.system_ok + I18n.joblog_kill_log + '?'), {icon: 3, title: I18n.system_tips }, function(index){
layer.close(index);
$.ajax({
@ -257,8 +251,8 @@ $(function() {
success : function(data){
if (data.code == 200) {
layer.open({
title: '',
content: '',
title: I18n.system_tips,
content: I18n.system_opt_suc ,
icon: '1',
end: function(layero, index){
logTable.fnDraw();
@ -266,8 +260,8 @@ $(function() {
});
} else {
layer.open({
title: '',
content: (data.msg || "操作失败"),
title: I18n.system_tips,
content: (data.msg || I18n.system_opt_fail ),
icon: '2'
});
}
@ -302,8 +296,8 @@ $(function() {
if (data.code == "200") {
$('#clearLogModal').modal('hide');
layer.open({
title: '',
content: '',
title: I18n.system_tips ,
content: (I18n.joblog_clean_log + I18n.system_success) ,
icon: '1',
end: function(layero, index){
logTable.fnDraw();
@ -311,8 +305,8 @@ $(function() {
});
} else {
layer.open({
title: '',
content: (data.msg || "日志清理失败"),
title: I18n.system_tips ,
content: (data.msg || (I18n.joblog_clean_log + I18n.system_fail) ),
icon: '2'
});
}
@ -335,7 +329,7 @@ var ComAlertTec = {
'<div class="modal-body"><div class="alert" style="color:#fff;"></div></div>' +
'<div class="modal-footer">' +
'<div class="text-center" >' +
'<button type="button" class="btn btn-info ok" data-dismiss="modal" ></button>' +
'<button type="button" class="btn btn-info ok" data-dismiss="modal" >'+ I18n.system_ok +'</button>' +
'</div>' +
'</div>' +
'</div>' +

Loading…
Cancel
Save