diff options
author | zsxwing <zsxwing@gmail.com> | 2015-05-14 16:57:33 -0700 |
---|---|---|
committer | Andrew Or <andrew@databricks.com> | 2015-05-14 16:57:33 -0700 |
commit | 0a317c124c3a43089cdb8f079345c8f2842238cd (patch) | |
tree | ffcf97ff46f0e16ae170da4411876eb580967699 | |
parent | 57ed16cf9372c109e84bd51b728f2c82940949a7 (diff) | |
download | spark-0a317c124c3a43089cdb8f079345c8f2842238cd.tar.gz spark-0a317c124c3a43089cdb8f079345c8f2842238cd.tar.bz2 spark-0a317c124c3a43089cdb8f079345c8f2842238cd.zip |
[SPARK-7649] [STREAMING] [WEBUI] Use window.localStorage to store the status rather than the url
Use window.localStorage to store the status rather than the url so that the url won't be changed.
cc tdas
Author: zsxwing <zsxwing@gmail.com>
Closes #6158 from zsxwing/SPARK-7649 and squashes the following commits:
3c56fef [zsxwing] Use window.localStorage to store the status rather than the url
-rw-r--r-- | core/src/main/resources/org/apache/spark/ui/static/streaming-page.js | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/core/src/main/resources/org/apache/spark/ui/static/streaming-page.js b/core/src/main/resources/org/apache/spark/ui/static/streaming-page.js index 22b186873e..0fac658d57 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/streaming-page.js +++ b/core/src/main/resources/org/apache/spark/ui/static/streaming-page.js @@ -252,28 +252,16 @@ function drawHistogram(id, values, minY, maxY, unitY, batchInterval) { } $(function() { - function getParameterFromURL(param) - { - var parameters = window.location.search.substring(1); // Remove "?" - var keyValues = parameters.split('&'); - for (var i = 0; i < keyValues.length; i++) - { - var paramKeyValue = keyValues[i].split('='); - if (paramKeyValue[0] == param) - { - return paramKeyValue[1]; - } - } - } - - var status = getParameterFromURL("show-streams-detail") == "true"; + var status = window.localStorage && window.localStorage.getItem("show-streams-detail") == "true"; $("span.expand-input-rate").click(function() { status = !status; $("#inputs-table").toggle('collapsed'); // Toggle the class of the arrow between open and closed $(this).find('.expand-input-rate-arrow').toggleClass('arrow-open').toggleClass('arrow-closed'); - window.history.pushState('', document.title, window.location.pathname + '?show-streams-detail=' + status); + if (window.localStorage) { + window.localStorage.setItem("show-streams-detail", "" + status); + } }); if (status) { |