提交 d794fd01 编写于 作者: X xueli.xue

rolling日志交互

上级 d917c944
......@@ -118,6 +118,15 @@ public class JobLogController {
try {
ExecutorBiz executorBiz = (ExecutorBiz) new NetComClientProxy(ExecutorBiz.class, executorAddress).getObject();
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;
} catch (Exception e) {
e.printStackTrace();
......
......@@ -4,26 +4,10 @@
<title>任务调度中心</title>
<#import "/common/common.macro.ftl" as netCommon>
<@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>
<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">
<nav class="navbar navbar-static-top">
......@@ -59,15 +43,19 @@
</nav>
</header>
<div class="content-wrapper" >
<pre class="logConsolePre"><div id="logConsole"></div>
<li class="fa fa-refresh fa-spin" id="logConsoleRunning" ></li>
<div>
<pre>
<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>
</pre>
</div>
</div>
<@netCommon.commonScript />
<script>
// 参数
......
......@@ -8,7 +8,7 @@ $(function() {
}
// pull log
var fromLineNum = 0;
var fromLineNum = 0; // [from, to]
var pullFailCount = 0;
function pullLog() {
// pullFailCount, max=20
......@@ -42,8 +42,13 @@ $(function() {
console.log('pullLog fromLineNum not match');
return;
}
if (fromLineNum == (data.content.toLineNum + 1) ) {
if (fromLineNum > data.content.toLineNum ) {
console.log('pullLog already line-end');
// valid end
if (data.content.end) {
logRunStop('<span style="color: green;">[Rolling Log Finish]</span>');
return;
}
return;
}
......@@ -52,11 +57,9 @@ $(function() {
$('#logConsole').append(data.content.logContent);
pullFailCount = 0;
// valid end
if (data.content.end) {
logRunStop('<span style="color: green;">[Rolling Log Finish]</span>');
return;
}
// scroll to bottom
scrollTo(0, document.body.scrollHeight);
} else {
console.log('pullLog fail:'+data.msg);
}
......@@ -69,7 +72,7 @@ $(function() {
// handler already callback, end
if (handleCode > 0) {
logRunStop('<span style="color: green;">[Log Finish]</span>');
logRunStop('<span style="color: green;">[Load Log Finish]</span>');
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册