Skip to content

Commit

Permalink
Backported SPARK-31420.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarutak committed Apr 14, 2020
1 parent fc13b27 commit d6f746e
Show file tree
Hide file tree
Showing 15 changed files with 140 additions and 114 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,18 +238,6 @@ tr.corresponding-item-hover > td, tr.corresponding-item-hover > th {
background-color: #D6FFE4 !important;
}

#application-timeline.collapsed {
display: none;
}

#job-timeline.collapsed {
display: none;
}

#task-assignment-timeline.collapsed {
display: none;
}

.control-panel {
margin-bottom: 5px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function drawApplicationTimeline(groupArray, eventObjArray, startTime, offset) {
editable: false,
align: 'left',
showCurrentTime: false,
min: startTime,
start: startTime,
zoomable: false,
moment: function (date) {
return vis.moment(date).utcOffset(offset);
Expand All @@ -50,7 +50,7 @@ function drawApplicationTimeline(groupArray, eventObjArray, startTime, offset) {
};

$(this).click(function() {
var jobPagePath = $(getSelectorForJobEntry(this)).find("a.name-link").attr("href")
var jobPagePath = $(getSelectorForJobEntry(this)).find("a.name-link").attr("href");
window.location.href = jobPagePath
});

Expand All @@ -75,6 +75,9 @@ function drawApplicationTimeline(groupArray, eventObjArray, startTime, offset) {

$("#application-timeline").toggleClass('collapsed');

var visibilityState = status ? "" : "none";
$("#application-timeline").css("display", visibilityState);

// Switch the class of the arrow from open to closed.
$(this).find('.expand-application-timeline-arrow').toggleClass('arrow-open');
$(this).find('.expand-application-timeline-arrow').toggleClass('arrow-closed');
Expand All @@ -89,6 +92,8 @@ $(function () {
// Set it to false so that the click function can revert it
window.localStorage.setItem("expand-application-timeline", "false");
$("span.expand-application-timeline").trigger('click');
} else {
$("#application-timeline").css("display", "none");
}
});

Expand All @@ -103,7 +108,7 @@ function drawJobTimeline(groupArray, eventObjArray, startTime, offset) {
editable: false,
align: 'left',
showCurrentTime: false,
min: startTime,
start: startTime,
zoomable: false,
moment: function (date) {
return vis.moment(date).utcOffset(offset);
Expand Down Expand Up @@ -152,6 +157,9 @@ function drawJobTimeline(groupArray, eventObjArray, startTime, offset) {

$("#job-timeline").toggleClass('collapsed');

var visibilityState = status ? "" : "none";
$("#job-timeline").css("display", visibilityState);

// Switch the class of the arrow from open to closed.
$(this).find('.expand-job-timeline-arrow').toggleClass('arrow-open');
$(this).find('.expand-job-timeline-arrow').toggleClass('arrow-closed');
Expand All @@ -166,13 +174,15 @@ $(function () {
// Set it to false so that the click function can revert it
window.localStorage.setItem("expand-job-timeline", "false");
$("span.expand-job-timeline").trigger('click');
} else {
$("#job-timeline").css("display", "none");
}
});

function drawTaskAssignmentTimeline(groupArray, eventObjArray, minLaunchTime, maxFinishTime, offset) {
var groups = new vis.DataSet(groupArray);
var items = new vis.DataSet(eventObjArray);
var container = $("#task-assignment-timeline")[0]
var container = $("#task-assignment-timeline")[0];
var options = {
groupOrder: function(a, b) {
return a.value - b.value
Expand All @@ -181,15 +191,15 @@ function drawTaskAssignmentTimeline(groupArray, eventObjArray, minLaunchTime, ma
align: 'left',
selectable: false,
showCurrentTime: false,
min: minLaunchTime,
max: maxFinishTime,
start: minLaunchTime,
end: maxFinishTime,
zoomable: false,
moment: function (date) {
return vis.moment(date).utcOffset(offset);
}
};

var taskTimeline = new vis.Timeline(container)
var taskTimeline = new vis.Timeline(container);
taskTimeline.setOptions(options);
taskTimeline.setGroups(groups);
taskTimeline.setItems(items);
Expand Down Expand Up @@ -220,6 +230,9 @@ function drawTaskAssignmentTimeline(groupArray, eventObjArray, minLaunchTime, ma

$("#task-assignment-timeline").toggleClass("collapsed");

var visibilityState = status ? "" : "none";
$("#task-assignment-timeline").css("display", visibilityState);

// Switch the class of the arrow from open to closed.
$(this).find(".expand-task-assignment-timeline-arrow").toggleClass("arrow-open");
$(this).find(".expand-task-assignment-timeline-arrow").toggleClass("arrow-closed");
Expand All @@ -234,6 +247,8 @@ $(function () {
// Set it to false so that the click function can revert it
window.localStorage.setItem("expand-task-assignment-timeline", "false");
$("span.expand-task-assignment-timeline").trigger('click');
} else {
$("#task-assignment-timeline").css("display", "none");
}
});

Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

45 changes: 0 additions & 45 deletions core/src/main/resources/org/apache/spark/ui/static/vis.min.js

This file was deleted.

5 changes: 3 additions & 2 deletions core/src/main/scala/org/apache/spark/ui/UIUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,14 @@ private[spark] object UIUtils extends Logging {
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet"
href={prependBaseUri(request, "/static/bootstrap.min.css")} type="text/css"/>
<link rel="stylesheet" href={prependBaseUri(request, "/static/vis.min.css")} type="text/css"/>
<link rel="stylesheet"
href={prependBaseUri(request, "/static/vis-timeline-graph2d.min.css")} type="text/css"/>
<link rel="stylesheet" href={prependBaseUri(request, "/static/webui.css")} type="text/css"/>
<link rel="stylesheet"
href={prependBaseUri(request, "/static/timeline-view.css")} type="text/css"/>
<script src={prependBaseUri(request, "/static/sorttable.js")} ></script>
<script src={prependBaseUri(request, "/static/jquery-3.4.1.min.js")}></script>
<script src={prependBaseUri(request, "/static/vis.min.js")}></script>
<script src={prependBaseUri(request, "/static/vis-timeline-graph2d.min.js")}></script>
<script src={prependBaseUri(request, "/static/bootstrap-tooltip.js")}></script>
<script src={prependBaseUri(request, "/static/initialize-tooltips.js")}></script>
<script src={prependBaseUri(request, "/static/table.js")}></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import org.apache.spark.status.api.v1.{JacksonMessageWriter, RDDDataDistribution

private[spark] class SparkUICssErrorHandler extends DefaultCssErrorHandler {

private val cssWhiteList = List("bootstrap.min.css", "vis.min.css")
private val cssWhiteList = List("bootstrap.min.css", "vis-timeline-graph2d.min.css")

private def isInWhileList(uri: String): Boolean = cssWhiteList.exists(uri.endsWith)

Expand Down
6 changes: 4 additions & 2 deletions dev/.rat-excludes
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ d3.min.js
dagre-d3.min.js
graphlib-dot.min.js
sorttable.js
vis.min.js
vis.min.css
vis-timeline-graph2d.min.js
vis-timeline-graph2d.min.js.map
vis-timeline-graph2d.min.css
vis-timeline-graph2d.min.css.map
dataTables.bootstrap.css
dataTables.bootstrap.min.js
dataTables.rowsGroup.js
Expand Down
23 changes: 23 additions & 0 deletions licenses-binary/LICENSE-vis-timeline.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
vis-timeline and vis-graph2d
https://visjs.github.io/vis-timeline/

Create a fully customizable, interactive timeline with items and ranges.

@version 7.3.4
@date 2020-03-18T17:03:58.105Z

@copyright (c) 2011-2017 Almende B.V, http://almende.com
@copyright (c) 2017-2019 visjs contributors, https://github.com/visjs

@license
vis.js is dual licensed under both

1. The Apache 2.0 License
http://www.apache.org/licenses/LICENSE-2.0

and

2. The MIT License
http://opensource.org/licenses/MIT

vis.js may be distributed under either license.
22 changes: 0 additions & 22 deletions licenses-binary/LICENSE-vis.txt

This file was deleted.

23 changes: 23 additions & 0 deletions licenses/LICENSE-vis-timeline.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
vis-timeline and vis-graph2d
https://visjs.github.io/vis-timeline/

Create a fully customizable, interactive timeline with items and ranges.

@version 7.3.4
@date 2020-03-18T17:03:58.105Z

@copyright (c) 2011-2017 Almende B.V, http://almende.com
@copyright (c) 2017-2019 visjs contributors, https://github.com/visjs

@license
vis.js is dual licensed under both

1. The Apache 2.0 License
http://www.apache.org/licenses/LICENSE-2.0

and

2. The MIT License
http://opensource.org/licenses/MIT

vis.js may be distributed under either license.
22 changes: 0 additions & 22 deletions licenses/LICENSE-vis.txt

This file was deleted.

0 comments on commit d6f746e

Please sign in to comment.