Repository: spark Updated Branches: refs/heads/branch-1.2 04b1bdbae -> a93d64c8c
[SPARK-4463] Add (de)select all button for add'l metrics. This commit removes the behavior where when a user clicks "Show additional metrics" on the stage page, all of the additional metrics are automatically selected; now, collapsing and expanding the additional metrics has no effect on which options are selected. Instead, there's a "(De)select All" box at the top; checking this box checks all additional metrics (and similarly, unchecking it unchecks all additional metrics). This commit is intended to be backported to 1.2, so that the additional metrics behavior is not confusing to users. Now when a user clicks the "Show additional metrics" menu, this is what it looks like:  Author: Kay Ousterhout <[email protected]> Closes #3331 from kayousterhout/SPARK-4463 and squashes the following commits: 9e17cea [Kay Ousterhout] Added italics b731230 [Kay Ousterhout] [SPARK-4463] Add (de)select all button for add'l metrics. (cherry picked from commit 010bc86e40a0e54b6850b75abd6105e70eb1af10) Signed-off-by: Andrew Or <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/a93d64c8 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/a93d64c8 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/a93d64c8 Branch: refs/heads/branch-1.2 Commit: a93d64c8c677f7121599b21883e1671e1226ec0b Parents: 04b1bdb Author: Kay Ousterhout <[email protected]> Authored: Tue Nov 18 15:01:06 2014 -0800 Committer: Andrew Or <[email protected]> Committed: Tue Nov 18 15:01:16 2014 -0800 ---------------------------------------------------------------------- .../apache/spark/ui/static/additional-metrics.js | 17 ++++++++++------- .../scala/org/apache/spark/ui/jobs/StagePage.scala | 4 ++++ 2 files changed, 14 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/a93d64c8/core/src/main/resources/org/apache/spark/ui/static/additional-metrics.js ---------------------------------------------------------------------- diff --git a/core/src/main/resources/org/apache/spark/ui/static/additional-metrics.js b/core/src/main/resources/org/apache/spark/ui/static/additional-metrics.js index badd85e..d33c5c7 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/additional-metrics.js +++ b/core/src/main/resources/org/apache/spark/ui/static/additional-metrics.js @@ -26,13 +26,6 @@ $(function() { // 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'); - - // If clicking caused the metrics to expand, automatically check all options for additional - // metrics (don't trigger a click when collapsing metrics, because it leads to weird - // toggling behavior). - if (!$(additionalMetricsDiv).hasClass('collapsed')) { - $(this).parent().find('input:checkbox:not(:checked)').trigger('click'); - } }); $("input:checkbox:not(:checked)").each(function() { @@ -48,6 +41,16 @@ $(function() { stripeTables(); }); + $("#select-all-metrics").click(function() { + if (this.checked) { + // Toggle all un-checked options. + $('input:checkbox:not(:checked)').trigger('click'); + } else { + // Toggle all checked options. + $('input:checkbox:checked').trigger('click'); + } + }); + // Trigger a click on the checkbox if a user clicks the label next to it. $("span.additional-metric-title").click(function() { $(this).parent().find('input:checkbox').trigger('click'); http://git-wip-us.apache.org/repos/asf/spark/blob/a93d64c8/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala ---------------------------------------------------------------------- diff --git a/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala b/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala index 16bc3f6..36afc49 100644 --- a/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala +++ b/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala @@ -115,6 +115,10 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") { <div class="additional-metrics collapsed"> <ul style="list-style-type:none"> <li> + <input type="checkbox" id="select-all-metrics"/> + <span class="additional-metric-title"><em>(De)select All</em></span> + </li> + <li> <span data-toggle="tooltip" title={ToolTips.SCHEDULER_DELAY} data-placement="right"> <input type="checkbox" name={TaskDetailsClassNames.SCHEDULER_DELAY}/> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
