Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

执行器增加超链接跳转到该执行器所属任务列表 #3510

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ $(function() {
{
"data": 'appname',
"visible" : true,
"width":'30%'
"width":'30%',
"render": function ( data, type, row ) {
return '<a href="'+base_url+'/jobinfo?jobGroup='+row.id+'">['+row.id+'] '+row.appname+'</a>';
}
},
{
"data": 'title',
Expand Down
244 changes: 131 additions & 113 deletions xxl-job-admin/src/main/resources/static/js/joblog.index.1.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,126 +92,137 @@ $(function() {
"ordering": false,
//"scrollX": false,
"columns": [
{
"data": 'jobId',
"visible" : true,
"width":'10%',
"render": function ( data, type, row ) {
{
"data": 'jobId',
"visible" : true,
"width":'5%',
"render": function ( data, type, row ) {

var jobhandler = '';
if (row.executorHandler) {
jobhandler = "<br>JobHandler:" + row.executorHandler;
}
var jobhandler = '';
if (row.executorHandler) {
jobhandler = "<br>JobHandler:" + row.executorHandler;
}

var temp = '';
temp += I18n.joblog_field_executorAddress + ':' + (row.executorAddress?row.executorAddress:'');
temp += jobhandler;
temp += '<br>'+ I18n.jobinfo_field_executorparam +':' + row.executorParam;
var temp = '';
temp += I18n.joblog_field_executorAddress + ':' + (row.executorAddress?row.executorAddress:'');
temp += jobhandler;
temp += '<br>'+ I18n.jobinfo_field_executorparam +':' + row.executorParam;

return '<a class="logTips" href="javascript:;" >'+ row.jobId +'<span style="display:none;">'+ temp +'</span></a>';
}
},
{ "data": 'jobGroup', "visible" : false},
{
"data": 'triggerTime',
"width":'20%',
"render": function ( data, type, row ) {
return data?moment(data).format("YYYY-MM-DD HH:mm:ss"):"";
}
},
{
"data": 'triggerCode',
"width":'10%',
"render": function ( data, type, row ) {
var html = data;
if (data == 200) {
html = '<span style="color: green">'+ I18n.system_success +'</span>';
} else if (data == 500) {
html = '<span style="color: red">'+ I18n.system_fail +'</span>';
} else if (data == 0) {
html = '';
}
return html;
}
},
{
"data": 'triggerMsg',
"width":'10%',
"render": function ( data, type, row ) {
return data?'<a class="logTips" href="javascript:;" >'+ I18n.system_show +'<span style="display:none;">'+ data +'</span></a>':I18n.system_empty;
}
},
{
"data": 'handleTime',
"width":'20%',
"render": function ( data, type, row ) {
return data?moment(data).format("YYYY-MM-DD HH:mm:ss"):"";
}
},
{
"data": 'handleCode',
"width":'10%',
"render": function ( data, type, row ) {
var html = data;
if (data == 200) {
html = '<span style="color: green">'+ I18n.joblog_handleCode_200 +'</span>';
} else if (data == 500) {
html = '<span style="color: red">'+ I18n.joblog_handleCode_500 +'</span>';
} else if (data == 502) {
html = '<span style="color: red">'+ I18n.joblog_handleCode_502 +'</span>';
} else if (data == 0) {
html = '';
}
return html;
}
},
{
"data": 'handleMsg',
"width":'10%',
"render": function ( data, type, row ) {
return data?'<a class="logTips" href="javascript:;" >'+ I18n.system_show +'<span style="display:none;">'+ data +'</span></a>':I18n.system_empty;
}
},
{
"data": 'handleMsg' ,
"bSortable": false,
"width":'10%',
"render": function ( data, type, row ) {
// better support expression or string, not function
return function () {
if (row.triggerCode == 200 || row.handleCode != 0){
return '<a class="logTips" href="javascript:;" >'+ row.jobId +'<span style="display:none;">'+ temp +'</span></a>';
}
},
{
"data": 'jobGroup',
"visible": true,
"width":'5%',
"render": function(data, type, row) {
return function() {
var temp = '<a href="javascript:;" class="toJobGroup" _jobGroupId="' + row.jobGroup + '">' +
row.jobGroup + '</a>';
return temp;
}
}
},
{
"data": 'triggerTime',
"width":'20%',
"render": function ( data, type, row ) {
return data?moment(data).format("YYYY-MM-DD HH:mm:ss"):"";
}
},
{
"data": 'triggerCode',
"width":'10%',
"render": function ( data, type, row ) {
var html = data;
if (data == 200) {
html = '<span style="color: green">'+ I18n.system_success +'</span>';
} else if (data == 500) {
html = '<span style="color: red">'+ I18n.system_fail +'</span>';
} else if (data == 0) {
html = '';
}
return html;
}
},
{
"data": 'triggerMsg',
"width":'10%',
"render": function ( data, type, row ) {
return data?'<a class="logTips" href="javascript:;" >'+ I18n.system_show +'<span style="display:none;">'+ data +'</span></a>':I18n.system_empty;
}
},
{
"data": 'handleTime',
"width":'20%',
"render": function ( data, type, row ) {
return data?moment(data).format("YYYY-MM-DD HH:mm:ss"):"";
}
},
{
"data": 'handleCode',
"width":'10%',
"render": function ( data, type, row ) {
var html = data;
if (data == 200) {
html = '<span style="color: green">'+ I18n.joblog_handleCode_200 +'</span>';
} else if (data == 500) {
html = '<span style="color: red">'+ I18n.joblog_handleCode_500 +'</span>';
} else if (data == 502) {
html = '<span style="color: red">'+ I18n.joblog_handleCode_502 +'</span>';
} else if (data == 0) {
html = '';
}
return html;
}
},
{
"data": 'handleMsg',
"width":'10%',
"render": function ( data, type, row ) {
return data?'<a class="logTips" href="javascript:;" >'+ I18n.system_show +'<span style="display:none;">'+ data +'</span></a>':I18n.system_empty;
}
},
{
"data": 'handleMsg' ,
"bSortable": false,
"width":'10%',
"render": function ( data, type, row ) {
// better support expression or string, not function
return function () {
if (row.triggerCode == 200 || row.handleCode != 0){

/*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;" >'+ I18n.joblog_kill_log +'</a>';
}*/
//return temp;
/*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;" >'+ I18n.joblog_kill_log +'</a>';
}*/
//return temp;

var logKillDiv = '';
if(row.handleCode == 0){
logKillDiv = ' <li class="divider"></li>\n' +
' <li><a href="javascript:void(0);" class="logKill" _id="'+ row.id +'" >'+ I18n.joblog_kill_log +'</a></li>\n';
}
var logKillDiv = '';
if(row.handleCode == 0){
logKillDiv = ' <li class="divider"></li>\n' +
' <li><a href="javascript:void(0);" class="logKill" _id="'+ row.id +'" >'+ I18n.joblog_kill_log +'</a></li>\n';
}

var html = '<div class="btn-group">\n' +
' <button type="button" class="btn btn-primary btn-sm">'+ I18n.system_opt +'</button>\n' +
' <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown">\n' +
' <span class="caret"></span>\n' +
' <span class="sr-only">Toggle Dropdown</span>\n' +
' </button>\n' +
' <ul class="dropdown-menu" role="menu" _id="'+ row.id +'" >\n' +
' <li><a href="javascript:void(0);" class="logDetail" _id="'+ row.id +'" >'+ I18n.joblog_rolling_log +'</a></li>\n' +
logKillDiv +
' </ul>\n' +
' </div>';
var html = '<div class="btn-group">\n' +
' <button type="button" class="btn btn-primary btn-sm">'+ I18n.system_opt +'</button>\n' +
' <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown">\n' +
' <span class="caret"></span>\n' +
' <span class="sr-only">Toggle Dropdown</span>\n' +
' </button>\n' +
' <ul class="dropdown-menu" role="menu" _id="'+ row.id +'" >\n' +
' <li><a href="javascript:void(0);" class="logDetail" _id="'+ row.id +'" >'+ I18n.joblog_rolling_log +'</a></li>\n' +
logKillDiv +
' </ul>\n' +
' </div>';

return html;
}
return null;
}
}
}
],
return html;
}
return null;
}
}
}
],
"language" : {
"sProcessing" : I18n.dataTable_sProcessing ,
"sLengthMenu" : I18n.dataTable_sLengthMenu ,
Expand Down Expand Up @@ -254,6 +265,13 @@ $(function() {
logTable.fnDraw();
});

// toJobGroup look
$('#joblog_list').on('click', '.toJobGroup', function() {
var _id = $(this).attr('_jobGroupId');
window.location.href = base_url + '/jobinfo?jobGroup=' + _id;
return;
});

// logDetail look
$('#joblog_list').on('click', '.logDetail', function(){
var _id = $(this).attr('_id');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<thead>
<tr>
<th name="jobId" >${I18n.jobinfo_field_id}</th>
<th name="jobGroup" >jobGroup</th>
<th name="jobGroup" >${I18n.jobinfo_field_jobgroup}</th>
<#--<th name="executorAddress" >执行器地址</th>
<th name="glueType" >运行模式</th>
<th name="executorParam" >任务参数</th>-->
Expand Down