rolling日志交互
This commit is contained in:
parent
d917c9443b
commit
d794fd0102
|
@ -118,6 +118,15 @@ public class JobLogController {
|
||||||
try {
|
try {
|
||||||
ExecutorBiz executorBiz = (ExecutorBiz) new NetComClientProxy(ExecutorBiz.class, executorAddress).getObject();
|
ExecutorBiz executorBiz = (ExecutorBiz) new NetComClientProxy(ExecutorBiz.class, executorAddress).getObject();
|
||||||
ReturnT<LogResult> logResult = executorBiz.log(triggerTime, logId, fromLineNum);
|
ReturnT<LogResult> logResult = executorBiz.log(triggerTime, logId, fromLineNum);
|
||||||
|
|
||||||
|
// is end
|
||||||
|
if (logResult.getContent()!=null && logResult.getContent().getFromLineNum() > logResult.getContent().getToLineNum()) {
|
||||||
|
XxlJobLog jobLog = xxlJobLogDao.load(logId);
|
||||||
|
if (jobLog.getHandleCode() > 0) {
|
||||||
|
logResult.getContent().setEnd(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return logResult;
|
return logResult;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
@ -4,26 +4,10 @@
|
||||||
<title>任务调度中心</title>
|
<title>任务调度中心</title>
|
||||||
<#import "/common/common.macro.ftl" as netCommon>
|
<#import "/common/common.macro.ftl" as netCommon>
|
||||||
<@netCommon.commonStyle />
|
<@netCommon.commonStyle />
|
||||||
<style type="text/css">
|
|
||||||
.logConsolePre {
|
|
||||||
font-size:12px;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
/*bottom: 0;
|
|
||||||
top: 0px;*/
|
|
||||||
position: absolute;
|
|
||||||
/*color:white;background-color:black*/
|
|
||||||
}
|
|
||||||
#logConsoleRunning {
|
|
||||||
font-size: 20px;
|
|
||||||
margin-top: 7px;
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body class="skin-blue fixed layout-top-nav">
|
<body class="hold-transition skin-blue layout-top-nav">
|
||||||
|
|
||||||
<div class="wrapper">
|
<div class2="wrapper">
|
||||||
|
|
||||||
<header class="main-header">
|
<header class="main-header">
|
||||||
<nav class="navbar navbar-static-top">
|
<nav class="navbar navbar-static-top">
|
||||||
|
@ -59,15 +43,19 @@
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="content-wrapper" >
|
<div>
|
||||||
<pre class="logConsolePre"><div id="logConsole"></div>
|
<pre>
|
||||||
<li class="fa fa-refresh fa-spin" id="logConsoleRunning" ></li>
|
<div id="logConsole"></div>
|
||||||
|
<li class="fa fa-refresh fa-spin" style="font-size: 20px;float: left;" id="logConsoleRunning" ></li>
|
||||||
<div style="margin-top: 50px;" ></div>
|
<div style="margin-top: 50px;" ></div>
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<@netCommon.commonScript />
|
<@netCommon.commonScript />
|
||||||
<script>
|
<script>
|
||||||
// 参数
|
// 参数
|
||||||
|
|
|
@ -8,7 +8,7 @@ $(function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// pull log
|
// pull log
|
||||||
var fromLineNum = 0;
|
var fromLineNum = 0; // [from, to]
|
||||||
var pullFailCount = 0;
|
var pullFailCount = 0;
|
||||||
function pullLog() {
|
function pullLog() {
|
||||||
// pullFailCount, max=20
|
// pullFailCount, max=20
|
||||||
|
@ -42,8 +42,13 @@ $(function() {
|
||||||
console.log('pullLog fromLineNum not match');
|
console.log('pullLog fromLineNum not match');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (fromLineNum == (data.content.toLineNum + 1) ) {
|
if (fromLineNum > data.content.toLineNum ) {
|
||||||
console.log('pullLog already line-end');
|
console.log('pullLog already line-end');
|
||||||
|
// valid end
|
||||||
|
if (data.content.end) {
|
||||||
|
logRunStop('<span style="color: green;">[Rolling Log Finish]</span>');
|
||||||
|
return;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,11 +57,9 @@ $(function() {
|
||||||
$('#logConsole').append(data.content.logContent);
|
$('#logConsole').append(data.content.logContent);
|
||||||
pullFailCount = 0;
|
pullFailCount = 0;
|
||||||
|
|
||||||
// valid end
|
// scroll to bottom
|
||||||
if (data.content.end) {
|
scrollTo(0, document.body.scrollHeight);
|
||||||
logRunStop('<span style="color: green;">[Rolling Log Finish]</span>');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
console.log('pullLog fail:'+data.msg);
|
console.log('pullLog fail:'+data.msg);
|
||||||
}
|
}
|
||||||
|
@ -69,7 +72,7 @@ $(function() {
|
||||||
|
|
||||||
// handler already callback, end
|
// handler already callback, end
|
||||||
if (handleCode > 0) {
|
if (handleCode > 0) {
|
||||||
logRunStop('<span style="color: green;">[Log Finish]</span>');
|
logRunStop('<span style="color: green;">[Load Log Finish]</span>');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue