Skip to content
Snippets Groups Projects
Commit 74bd3fc6 authored by Karen Feng's avatar Karen Feng
Browse files

Added byte range on log pages

parent 24196c91
No related branches found
No related tags found
No related merge requests found
...@@ -86,7 +86,10 @@ class WorkerWebUI(val worker: ActorRef, val workDir: File, requestedPort: Option ...@@ -86,7 +86,10 @@ class WorkerWebUI(val worker: ActorRef, val workDir: File, requestedPort: Option
else if (offset > logLength) logLength else if (offset > logLength) logLength
else offset else offset
val logText = <node>{Utils.offsetBytes(path, fixedOffset, fixedOffset+logPageLength)}</node> val endOffset = math.min(fixedOffset+logPageLength, logLength)
val range = <h3>Bytes {fixedOffset.toString} - {(endOffset).toString} of {logLength}</h3>
val logText = <node>{Utils.offsetBytes(path, fixedOffset, endOffset)}</node>
val backButton = val backButton =
if (fixedOffset > 0) { if (fixedOffset > 0) {
...@@ -101,9 +104,9 @@ class WorkerWebUI(val worker: ActorRef, val workDir: File, requestedPort: Option ...@@ -101,9 +104,9 @@ class WorkerWebUI(val worker: ActorRef, val workDir: File, requestedPort: Option
} }
val nextButton = val nextButton =
if (fixedOffset+logPageLength < logLength) { if (endOffset < logLength) {
<a href={"?appId=%s&executorId=%s&logType=%s&offset=%s&byteLength=%s". <a href={"?appId=%s&executorId=%s&logType=%s&offset=%s&byteLength=%s".
format(appId, executorId, logType, fixedOffset+logPageLength, logPageLength)}> format(appId, executorId, logType, endOffset, logPageLength)}>
<button style="float:right">next</button> <button style="float:right">next</button>
</a> </a>
} }
...@@ -114,6 +117,7 @@ class WorkerWebUI(val worker: ActorRef, val workDir: File, requestedPort: Option ...@@ -114,6 +117,7 @@ class WorkerWebUI(val worker: ActorRef, val workDir: File, requestedPort: Option
val content = val content =
<html> <html>
<body> <body>
{range}
<hr></hr> <hr></hr>
{backButton} {backButton}
{nextButton} {nextButton}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment