Skip to content

Commit 6a6705d

Browse files
committed
More fixes
1 parent 67629f5 commit 6a6705d

File tree

6 files changed

+84
-34
lines changed

6 files changed

+84
-34
lines changed

core/src/main/resources/org/apache/spark/ui/static/timeline-view.css

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,18 @@ div#application-timeline, div#job-timeline {
6868
}
6969

7070
.vis.timeline .item.stage.running {
71-
background-color: #a3ffc2;
71+
background-color: #a2fcc0;
7272
border-color: #36f572;
7373
}
7474

7575
.vis.timeline .item.stage.running.selected {
76-
background-color: #a3ffc2;
76+
background-color: #a2fcc0;
7777
border-color: #36f572;
7878
z-index: auto;
7979
}
8080

8181
.legend-area rect.active-stage-legend {
82-
fill: #a3ffc2;
82+
fill: #a2fcc0;
8383
stroke: #36f572;
8484
}
8585

@@ -89,6 +89,7 @@ div#application-timeline, div#job-timeline {
8989

9090
.vis.timeline .item.job.succeeded {
9191
background-color: #A0DFFF;
92+
border-color: #3EC0FF;
9293
}
9394

9495
.vis.timeline .item.job.succeeded.selected {
@@ -119,23 +120,24 @@ div#application-timeline, div#job-timeline {
119120
}
120121

121122
.vis.timeline .item.job.running {
122-
background-color: #a3ffc2;
123+
background-color: #a2fcc0;
123124
border-color: #36f572;
124125
}
125126

126127
.vis.timeline .item.job.running.selected {
127-
background-color: #a3ffc2;
128+
background-color: #a2fcc0;
128129
border-color: #36f572;
129130
z-index: auto;
130131
}
131132

132133
.legend-area rect.running-job-legend {
133-
fill: #a3ffc2;
134+
fill: #a2fcc0;
134135
stroke: #36f572;
135136
}
136137

137138
.vis.timeline .item.executor.added {
138139
background-color: #A0DFFF;
140+
border-color: #3EC0FF;
139141
}
140142

141143
.legend-area rect.executor-added-legend {
@@ -154,7 +156,7 @@ div#application-timeline, div#job-timeline {
154156
}
155157

156158
.vis.timeline .item.executor.selected {
157-
background-color: #a3ffc2;
159+
background-color: #a2fcc0;
158160
border-color: #36f572;
159161
z-index: 2;
160162
}
@@ -175,6 +177,10 @@ tr.corresponding-item-hover > td, tr.corresponding-item-hover > th {
175177
margin-bottom: 5px;
176178
}
177179

180+
.control-panel input[type="checkbox"] {
181+
margin: 0;
182+
}
183+
178184
span.expand-application-timeline, span.expand-job-timeline {
179185
cursor: pointer;
180186
}
@@ -190,3 +196,17 @@ span.expand-application-timeline, span.expand-job-timeline {
190196
.vis.timeline .item .tooltip-inner {
191197
max-width: unset !important;
192198
}
199+
200+
.vispanel.center {
201+
font-size: 12px;
202+
line-height: 12px;
203+
}
204+
205+
.legend-area text {
206+
fill: #4d4d4d;
207+
}
208+
209+
.additional-metrics ul {
210+
list-style: none;
211+
margin-left: 15px;
212+
}

core/src/main/resources/org/apache/spark/ui/static/webui.css

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,18 @@ span.rest-uri {
106106
}
107107

108108
pre {
109-
font-size: 0.8em;
109+
font-size: 12px;
110+
line-height: 18px;
111+
padding: 6px;
112+
margin: 0;
113+
border-radius: 3px;
110114
}
111115

112116
.stage-details {
113117
max-height: 100px;
114118
overflow-y: auto;
115119
margin: 0;
116-
transition: max-height 0.5s ease-out, padding 0.5s ease-out;
120+
transition: max-height 0.25s ease-out, padding 0.25s ease-out;
117121
}
118122

119123
.stage-details.collapsed {
@@ -135,7 +139,7 @@ pre {
135139
max-height: 300px;
136140
overflow-y: auto;
137141
margin: 0;
138-
transition: max-height 0.5s ease-out, padding 0.5s ease-out;
142+
transition: max-height 0.25s ease-out, padding 0.25s ease-out;
139143
}
140144

141145
.stacktrace-details.collapsed {
@@ -158,26 +162,28 @@ span.additional-metric-title {
158162
}
159163

160164
.tooltip {
161-
font-weight: normal;
165+
font-weight: normal;
162166
}
163167

164168
.arrow-open {
165169
width: 0;
166170
height: 0;
167171
border-left: 5px solid transparent;
168172
border-right: 5px solid transparent;
169-
border-top: 5px solid black;
170-
float: left;
171-
margin-top: 6px;
173+
border-top: 5px solid #08c;
174+
display: inline-block;
175+
margin-bottom: 2px;
172176
}
173177

174178
.arrow-closed {
175179
width: 0;
176180
height: 0;
177181
border-top: 5px solid transparent;
178182
border-bottom: 5px solid transparent;
179-
border-left: 5px solid black;
183+
border-left: 5px solid #08c;
180184
display: inline-block;
185+
margin-left: 2px;
186+
margin-right: 3px;
181187
}
182188

183189
.version {
@@ -196,3 +202,17 @@ span.additional-metric-title {
196202
.serialization_time, .getting_result_time {
197203
display: none;
198204
}
205+
206+
.accordion-inner {
207+
background: #f5f5f5;
208+
}
209+
210+
.accordion-inner pre {
211+
border: 0;
212+
padding: 0;
213+
background: none;
214+
}
215+
216+
a.expandbutton {
217+
cursor: pointer;
218+
}

core/src/main/scala/org/apache/spark/ui/UIUtils.scala

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,14 @@ private[spark] object UIUtils extends Logging {
156156

157157
def commonHeaderNodes: Seq[Node] = {
158158
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
159-
<link rel="stylesheet" href={prependBaseUri("/static/bootstrap.min.css")} type="text/css" />
160-
<link rel="stylesheet" href={prependBaseUri("/static/webui.css")} type="text/css" />
161-
<link rel="stylesheet" href={prependBaseUri("/static/vis.min.css")} type="text/css" />
162-
<link rel="stylesheet" href={prependBaseUri("/static/timeline-view.css")} type="text/css" />
159+
<link rel="stylesheet" href={prependBaseUri("/static/bootstrap.min.css")}
160+
type="text/css" />
161+
<link rel="stylesheet" href={prependBaseUri("/static/vis.min.css")}
162+
type="text/css" />
163+
<link rel="stylesheet" href={prependBaseUri("/static/webui.css")}
164+
type="text/css" />
165+
<link rel="stylesheet" href={prependBaseUri("/static/timeline-view.css")}
166+
type="text/css"></link>
163167
<script src={prependBaseUri("/static/sorttable.js")} ></script>
164168
<script src={prependBaseUri("/static/jquery-1.11.1.min.js")}></script>
165169
<script src={prependBaseUri("/static/vis.min.js")}></script>
@@ -350,7 +354,7 @@ private[spark] object UIUtils extends Logging {
350354
<div>
351355
<span class="expand-dag-viz" onclick={s"toggleDagViz($forJob);"}>
352356
<span class="expand-dag-viz-arrow arrow-closed"></span>
353-
<strong>DAG Visualization</strong>
357+
<a>DAG Visualization</a>
354358
</span>
355359
<div id="dag-viz-graph"></div>
356360
<div id="dag-viz-metadata">

core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
package org.apache.spark.ui.jobs
1919

2020
import scala.collection.mutable.{HashMap, ListBuffer}
21-
import scala.xml.{Node, NodeSeq, Unparsed}
21+
import scala.xml.{Node, NodeSeq, Unparsed, Utility}
2222

2323
import java.util.Date
2424
import javax.servlet.http.HttpServletRequest
@@ -81,6 +81,9 @@ private[ui] class AllJobsPage(parent: JobsTab) extends WebUIPage("") {
8181
case JobExecutionStatus.RUNNING => "running"
8282
}
8383

84+
// The timeline library treats contents as HTML, so we have to escape them; for the
85+
// data-title attribute string we have to escape them twice since that's in a string.
86+
val escapedDesc = Utility.escape(displayJobDescription)
8487
val jobEventJsonAsStr =
8588
s"""
8689
|{
@@ -90,7 +93,8 @@ private[ui] class AllJobsPage(parent: JobsTab) extends WebUIPage("") {
9093
| 'end': new Date(${completionTime}),
9194
| 'content': '<div class="application-timeline-content"' +
9295
| 'data-html="true" data-placement="top" data-toggle="tooltip"' +
93-
| 'data-title="${displayJobDescription} (Job ${jobId})<br>Status: ${status}<br>' +
96+
| 'data-title="${Utility.escape(escapedDesc)} (Job ${jobId})<br>' +
97+
| 'Status: ${status}<br>' +
9498
| 'Submitted: ${UIUtils.formatDate(new Date(submissionTime))}' +
9599
| '${
96100
if (status != JobExecutionStatus.RUNNING) {
@@ -99,7 +103,7 @@ private[ui] class AllJobsPage(parent: JobsTab) extends WebUIPage("") {
99103
""
100104
}
101105
}">' +
102-
| '${displayJobDescription} (Job ${jobId})</div>'
106+
| '${escapedDesc} (Job ${jobId})</div>'
103107
|}
104108
""".stripMargin
105109
jobEventJsonAsStr
@@ -179,7 +183,7 @@ private[ui] class AllJobsPage(parent: JobsTab) extends WebUIPage("") {
179183

180184
<span class="expand-application-timeline">
181185
<span class="expand-application-timeline-arrow arrow-closed"></span>
182-
<strong>Event Timeline</strong>
186+
<a>Event Timeline</a>
183187
</span> ++
184188
<div id="application-timeline" class="collapsed">
185189
<div class="control-panel">
@@ -331,8 +335,7 @@ private[ui] class AllJobsPage(parent: JobsTab) extends WebUIPage("") {
331335
}
332336

333337
val helpText = """A job is triggered by an action, like "count()" or "saveAsTextFile()".""" +
334-
" Click on a job's title to see information about the stages of tasks associated with" +
335-
" the job."
338+
" Click on a job to see information about the stages of tasks inside it."
336339

337340
UIUtils.headerSparkPage("Spark Jobs", content, parent, helpText = Some(helpText))
338341
}

core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ package org.apache.spark.ui.jobs
2020
import java.util.Date
2121

2222
import scala.collection.mutable.{Buffer, HashMap, ListBuffer}
23-
import scala.xml.{NodeSeq, Node, Unparsed}
23+
import scala.xml.{NodeSeq, Node, Unparsed, Utility}
2424

2525
import javax.servlet.http.HttpServletRequest
2626

@@ -64,6 +64,9 @@ private[ui] class JobPage(parent: JobsTab) extends WebUIPage("job") {
6464
val submissionTime = stage.submissionTime.get
6565
val completionTime = stage.completionTime.getOrElse(System.currentTimeMillis())
6666

67+
// The timeline library treats contents as HTML, so we have to escape them; for the
68+
// data-title attribute string we have to escape them twice since that's in a string.
69+
val escapedName = Utility.escape(name)
6770
s"""
6871
|{
6972
| 'className': 'stage job-timeline-object ${status}',
@@ -72,17 +75,17 @@ private[ui] class JobPage(parent: JobsTab) extends WebUIPage("job") {
7275
| 'end': new Date(${completionTime}),
7376
| 'content': '<div class="job-timeline-content" data-toggle="tooltip"' +
7477
| 'data-placement="top" data-html="true"' +
75-
| 'data-title="${name} (Stage ${stageId}.${attemptId})<br>' +
78+
| 'data-title="${Utility.escape(escapedName)} (Stage ${stageId}.${attemptId})<br>' +
7679
| 'Status: ${status.toUpperCase}<br>' +
77-
| 'Submission Time: ${UIUtils.formatDate(new Date(submissionTime))}' +
80+
| 'Submitted: ${UIUtils.formatDate(new Date(submissionTime))}' +
7881
| '${
7982
if (status != "running") {
80-
s"""<br>Completion Time: ${UIUtils.formatDate(new Date(completionTime))}"""
83+
s"""<br>Completed: ${UIUtils.formatDate(new Date(completionTime))}"""
8184
} else {
8285
""
8386
}
8487
}">' +
85-
| '${name} (Stage ${stageId}.${attemptId})</div>',
88+
| '${escapedName} (Stage ${stageId}.${attemptId})</div>',
8689
|}
8790
""".stripMargin
8891
}
@@ -161,7 +164,7 @@ private[ui] class JobPage(parent: JobsTab) extends WebUIPage("job") {
161164

162165
<span class="expand-job-timeline">
163166
<span class="expand-job-timeline-arrow arrow-closed"></span>
164-
<strong>Event Timeline</strong>
167+
<a>Event Timeline</a>
165168
</span> ++
166169
<div id="job-timeline" class="collapsed">
167170
<div class="control-panel">

core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") {
119119
<div>
120120
<span class="expand-additional-metrics">
121121
<span class="expand-additional-metrics-arrow arrow-closed"></span>
122-
<strong>Show Additional Metrics</strong>
122+
<a>Show Additional Metrics</a>
123123
</span>
124124
<div class="additional-metrics collapsed">
125-
<ul style="list-style-type:none">
125+
<ul>
126126
<li>
127127
<input type="checkbox" id="select-all-metrics"/>
128128
<span class="additional-metric-title"><em>(De)select All</em></span>

0 commit comments

Comments
 (0)