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

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

@ -18,14 +18,21 @@ system_add_suc=新增成功
system_add_fail=新增失败 system_add_fail=新增失败
system_update_suc=更新成功 system_update_suc=更新成功
system_update_fail=更新失败 system_update_fail=更新失败
system_all=全部
system_api_error=接口异常
system_show=查看
system_empty=
system_opt_suc=操作成功
system_opt_fail=操作失败
## daterangepicker ## daterangepicker
daterangepicker_ranges_recent_hour=最近一小时
daterangepicker_ranges_today=今日 daterangepicker_ranges_today=今日
daterangepicker_ranges_yesterday=昨日 daterangepicker_ranges_yesterday=昨日
daterangepicker_ranges_this_month=本月 daterangepicker_ranges_this_month=本月
daterangepicker_ranges_last_month=上个月 daterangepicker_ranges_last_month=上个月
daterangepicker_ranges_recent_week=最近1 daterangepicker_ranges_recent_week=最近
daterangepicker_ranges_recent_month=最近1 daterangepicker_ranges_recent_month=最近
daterangepicker_custom_name=自定义 daterangepicker_custom_name=自定义
daterangepicker_custom_starttime=起始时间 daterangepicker_custom_starttime=起始时间
daterangepicker_custom_endtime=结束时间 daterangepicker_custom_endtime=结束时间
@ -87,13 +94,14 @@ job_dashboard_rate_report_fail_count=失败调度次数
## job info ## job info
jobinfo_name=任务管理 jobinfo_name=任务管理
jobinfo_job=任务
jobinfo_field_add=新增任务 jobinfo_field_add=新增任务
jobinfo_field_update=更新任务 jobinfo_field_update=更新任务
jobinfo_field_id=任务ID jobinfo_field_id=任务ID
jobinfo_field_jobgroup=执行器 jobinfo_field_jobgroup=执行器
jobinfo_field_jobdesc=任务描述 jobinfo_field_jobdesc=任务描述
jobinfo_field_gluetype=运行模式 jobinfo_field_gluetype=运行模式
jobinfo_field_executorparam=执行参数 jobinfo_field_executorparam=任务参数
jobinfo_field_author=负责人 jobinfo_field_author=负责人
jobinfo_field_alarmemail=报警邮件 jobinfo_field_alarmemail=报警邮件
jobinfo_field_alarmemail_placeholder=请输入报警邮件,多个邮件地址则逗号分隔 jobinfo_field_alarmemail_placeholder=请输入报警邮件,多个邮件地址则逗号分隔
@ -114,6 +122,35 @@ jobinfo_opt_del=删除
## job log ## job log
joblog_name=调度日志 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 ## job group
jobgroup_name=执行器管理 jobgroup_name=执行器管理

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

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

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

Loading…
Cancel
Save