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
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,63 @@
* to be registered after the page loads. */
$(function() {
$("span.expand-additional-metrics").click(function(){
var status = window.localStorage.getItem("expand-additional-metrics") == "true";
status = !status;

// Expand the list of additional metrics.
var additionalMetricsDiv = $(this).parent().find('.additional-metrics');
$(additionalMetricsDiv).toggleClass('collapsed');

// Switch the class of the arrow from open to closed.
$(this).find('.expand-additional-metrics-arrow').toggleClass('arrow-open');
$(this).find('.expand-additional-metrics-arrow').toggleClass('arrow-closed');

window.localStorage.setItem("expand-additional-metrics", "" + status);
});

if (window.localStorage.getItem("expand-additional-metrics") == "true") {
// Set it to false so that the click function can revert it
window.localStorage.setItem("expand-additional-metrics", "false");
$("span.expand-additional-metrics").trigger("click");
}

stripeSummaryTable();

$('input[type="checkbox"]').click(function() {
var column = "table ." + $(this).attr("name");
var name = $(this).attr("name")
var column = "table ." + name;
Copy link
Contributor

Choose a reason for hiding this comment

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

is the space between table and . here intentional? I notice this is also in the old code

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. I think so. . is a css class selector. E.g., if name is deserialization_time, it will select all cells in the table like <td sorttable_customkey="0" class="deserialization_time">.

var status = window.localStorage.getItem(name) == "true";
status = !status;
$(column).toggle();
stripeSummaryTable();
window.localStorage.setItem(name, "" + status);
});

$("#select-all-metrics").click(function() {
var status = window.localStorage.getItem("select-all-metrics") == "true";
status = !status;
if (this.checked) {
// Toggle all un-checked options.
$('input[type="checkbox"]:not(:checked)').trigger('click');
} else {
// Toggle all checked options.
$('input[type="checkbox"]:checked').trigger('click');
}
window.localStorage.setItem("select-all-metrics", "" + status);
});

if (window.localStorage.getItem("select-all-metrics") == "true") {
$("#select-all-metrics").attr('checked', status);
}

$("span.additional-metric-title").parent().find('input[type="checkbox"]').each(function() {
var name = $(this).attr("name")
// If name is undefined, then skip it because it's the "select-all-metrics" checkbox
if (name && window.localStorage.getItem(name) == "true") {
// Set it to false so that the click function can revert it
window.localStorage.setItem(name, "false");
$(this).trigger("click")
}
});

// Trigger a click on the checkbox if a user clicks the label next to it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,24 @@ var StagePageVizConstants = {
rankSep: 40
};

/*
* Return "expand-dag-viz-arrow-job" if forJob is true.
* Otherwise, return "expand-dag-viz-arrow-stage".
*/
function expandDagVizArrowKey(forJob) {
return forJob ? "expand-dag-viz-arrow-job" : "expand-dag-viz-arrow-stage";
}

/*
* Show or hide the RDD DAG visualization.
*
* The graph is only rendered the first time this is called.
* This is the narrow interface called from the Scala UI code.
*/
function toggleDagViz(forJob) {
var status = window.localStorage.getItem(expandDagVizArrowKey(forJob)) == "true";
status = !status;

var arrowSelector = ".expand-dag-viz-arrow";
$(arrowSelector).toggleClass('arrow-closed');
$(arrowSelector).toggleClass('arrow-open');
Expand All @@ -93,8 +104,24 @@ function toggleDagViz(forJob) {
// Save the graph for later so we don't have to render it again
graphContainer().style("display", "none");
}

window.localStorage.setItem(expandDagVizArrowKey(forJob), "" + status);
}

$(function (){
if (window.localStorage.getItem(expandDagVizArrowKey(false)) == "true") {
// Set it to false so that the click function can revert it
window.localStorage.setItem(expandDagVizArrowKey(false), "false");
toggleDagViz(false);
}

if (window.localStorage.getItem(expandDagVizArrowKey(true)) == "true") {
// Set it to false so that the click function can revert it
window.localStorage.setItem(expandDagVizArrowKey(true), "false");
toggleDagViz(true);
}
});

/*
* Render the RDD DAG visualization.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,27 @@ function drawApplicationTimeline(groupArray, eventObjArray, startTime) {
setupJobEventAction();

$("span.expand-application-timeline").click(function() {
var status = window.localStorage.getItem("expand-application-timeline") == "true";
status = !status;

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

// 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');

window.localStorage.setItem("expand-application-timeline", "" + status);
});
}

$(function (){
if (window.localStorage.getItem("expand-application-timeline") == "true") {
// 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');
}
});

function drawJobTimeline(groupArray, eventObjArray, startTime) {
var groups = new vis.DataSet(groupArray);
var items = new vis.DataSet(eventObjArray);
Expand Down Expand Up @@ -125,14 +138,27 @@ function drawJobTimeline(groupArray, eventObjArray, startTime) {
setupStageEventAction();

$("span.expand-job-timeline").click(function() {
var status = window.localStorage.getItem("expand-job-timeline") == "true";
status = !status;

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

// 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');

window.localStorage.setItem("expand-job-timeline", "" + status);
});
}

$(function (){
if (window.localStorage.getItem("expand-job-timeline") == "true") {
// 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');
}
});

function drawTaskAssignmentTimeline(groupArray, eventObjArray, minLaunchTime, maxFinishTime) {
var groups = new vis.DataSet(groupArray);
var items = new vis.DataSet(eventObjArray);
Expand Down Expand Up @@ -176,14 +202,27 @@ function drawTaskAssignmentTimeline(groupArray, eventObjArray, minLaunchTime, ma
setupZoomable("#task-assignment-timeline-zoom-lock", taskTimeline);

$("span.expand-task-assignment-timeline").click(function() {
var status = window.localStorage.getItem("expand-task-assignment-timeline") == "true";
status = !status;

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

// 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");

window.localStorage.setItem("expand-task-assignment-timeline", "" + status);
});
}

$(function (){
if (window.localStorage.getItem("expand-task-assignment-timeline") == "true") {
// 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');
}
});

function setupExecutorEventAction() {
$(".item.box.executor").each(function () {
$(this).hover(
Expand Down
Loading