Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions core/src/main/resources/org/apache/spark/ui/static/webui.css
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,22 @@ pre {
line-height: 18px;
padding: 6px;
margin: 0;
word-break: break-word;
border-radius: 3px;
}

.stage-details {
max-height: 100px;
overflow-y: auto;
margin: 0;
display: block;
transition: max-height 0.25s ease-out, padding 0.25s ease-out;
}

.stage-details.collapsed {
max-height: 0;
padding-top: 0;
padding-bottom: 0;
border: none;
display: none;
}

.description-input {
Expand All @@ -143,14 +144,15 @@ pre {
max-height: 300px;
overflow-y: auto;
margin: 0;
display: block;
transition: max-height 0.25s ease-out, padding 0.25s ease-out;
}

.stacktrace-details.collapsed {
max-height: 0;
padding-top: 0;
padding-bottom: 0;
border: none;
display: none;
}

span.expand-additional-metrics, span.expand-dag-viz {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ private[ui] class AllExecutionsPage(parent: SQLTab) extends WebUIPage("") with L
}
_content
}
content ++=
<script>
function clickDetail(details) {{
details.parentNode.querySelector('.stage-details').classList.toggle('collapsed')
}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you need double }} here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, copied from ExecutionPage

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's necessary to escape { in xml.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Necessary when writing XML in Scala code right? it's not reserved in XML)

</script>
UIUtils.headerSparkPage("SQL", content, parent, Some(5000))
}
}
Expand Down Expand Up @@ -118,14 +124,12 @@ private[ui] abstract class ExecutionTable(
{failedJobs}
</td>
}}
{detailCell(executionUIData.physicalPlanDescription)}
</tr>
}

private def descriptionCell(execution: SQLExecutionUIData): Seq[Node] = {
val details = if (execution.details.nonEmpty) {
<span onclick="this.parentNode.querySelector('.stage-details').classList.toggle('collapsed')"
class="expand-details">
<span onclick="clickDetail(this)" class="expand-details">
+details
</span> ++
<div class="stage-details collapsed">
Expand All @@ -142,30 +146,6 @@ private[ui] abstract class ExecutionTable(
<div>{desc} {details}</div>
}

private def detailCell(physicalPlan: String): Seq[Node] = {
val isMultiline = physicalPlan.indexOf('\n') >= 0
val summary = StringEscapeUtils.escapeHtml4(
if (isMultiline) {
physicalPlan.substring(0, physicalPlan.indexOf('\n'))
} else {
physicalPlan
})
val details = if (isMultiline) {
// scalastyle:off
<span onclick="this.parentNode.querySelector('.stacktrace-details').classList.toggle('collapsed')"
class="expand-details">
+details
</span> ++
<div class="stacktrace-details collapsed">
<pre>{physicalPlan}</pre>
</div>
// scalastyle:on
} else {
""
}
<td>{summary}{details}</td>
}

def toNodeSeq: Seq[Node] = {
<div>
<h4>{tableName}</h4>
Expand Down Expand Up @@ -197,7 +177,7 @@ private[ui] class RunningExecutionTable(
showFailedJobs = true) {

override protected def header: Seq[String] =
baseHeader ++ Seq("Running Jobs", "Succeeded Jobs", "Failed Jobs", "Detail")
baseHeader ++ Seq("Running Jobs", "Succeeded Jobs", "Failed Jobs")
}

private[ui] class CompletedExecutionTable(
Expand All @@ -215,7 +195,7 @@ private[ui] class CompletedExecutionTable(
showSucceededJobs = true,
showFailedJobs = false) {

override protected def header: Seq[String] = baseHeader ++ Seq("Jobs", "Detail")
override protected def header: Seq[String] = baseHeader ++ Seq("Jobs")
}

private[ui] class FailedExecutionTable(
Expand All @@ -234,5 +214,5 @@ private[ui] class FailedExecutionTable(
showFailedJobs = true) {

override protected def header: Seq[String] =
baseHeader ++ Seq("Succeeded Jobs", "Failed Jobs", "Detail")
baseHeader ++ Seq("Succeeded Jobs", "Failed Jobs")
}
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ class UISeleniumSuite
List("4/4", "4/4", "4/4", "0/4 (1 failed)"))

// Check stacktrace
val errorCells = findAll(cssSelector(""".stacktrace-details""")).map(_.text).toSeq
val errorCells = findAll(cssSelector(""".stacktrace-details""")).map(_.underlying).toSeq
errorCells should have size 1
errorCells(0) should include("java.lang.RuntimeException: Oops")
// Can't get the inner (invisible) text without running JS

// Check the job link in the batch page is right
go to (jobLinks(0))
Expand Down