Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
熊鹏飞
/
xxljob220
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d794fd01
authored
Mar 24, 2017
by
xueli.xue
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
rolling日志交互
parent
d917c944
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
29 deletions
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java
xxl-job-admin/src/main/webapp/WEB-INF/template/joblog/logdetail.ftl
xxl-job-admin/src/main/webapp/static/js/logdetail.index.1.js
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java
View file @
d794fd01
...
@@ -118,6 +118,15 @@ public class JobLogController {
...
@@ -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
();
...
...
xxl-job-admin/src/main/webapp/WEB-INF/template/joblog/logdetail.ftl
View file @
d794fd01
...
@@ -4,26 +4,10 @@
...
@@ -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
class
2
=
"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 @@
...
@@ -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>
// 参数
// 参数
...
...
xxl-job-admin/src/main/webapp/static/js/logdetail.index.1.js
View file @
d794fd01
...
@@ -8,7 +8,7 @@ $(function() {
...
@@ -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() {
...
@@ -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() {
...
@@ -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() {
...
@@ -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;">[Lo
ad Lo
g Finish]</span>'
);
return
;
return
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment