console.js.history.job_status_history.js Maven / Gradle / Ivy
The newest version!
$(function() {
$(".toolbar input").bind("keypress", function(event) {
if("13" == event.keyCode) {
$("#job-exec-status-table").bootstrapTable("refresh", {silent: true});
}
});
$("#job-exec-status-table").on("all.bs.table", function() {
doLocale();
});
});
function queryParams(params) {
var sortName = "success" === params.sortName ? "isSuccess" : params.sortName;
return {
per_page: params.pageSize,
page: params.pageNumber,
q: params.searchText,
sort: sortName,
order: params.sortOrder,
jobName: $("#job-name").val(),
state: $("#state").val(),
startTime: $("#start-time").val(),
endTime: $("#end-time").val()
};
}
function splitRemarkFormatter(value, row) {
var maxLength = 50;
var replacement = "...";
if(null != value && value.length > maxLength) {
var valueDetail = value.substring(0 , maxLength - replacement.length) + replacement;
value = value.replace(/\r\n/g,"
").replace(/\n/g,"
").replace(/\'/g, "\\'");
var remarkHtml;
if ("TASK_FAILED" === row.state || "TASK_ERROR" === row.state) {
remarkHtml = '' + valueDetail + '';
} else {
remarkHtml = '' + valueDetail + '';
}
return remarkHtml;
}
return value;
}
function stateFormatter(value) {
switch(value)
{
case "TASK_STAGING":
return "";
case "TASK_FAILED":
return "";
case "TASK_FINISHED":
return "";
case "TASK_RUNNING":
return "";
case "TASK_ERROR":
return "";
case "TASK_KILLED":
return "";
default:
return "-";
}
}