Skip to content
Snippets Groups Projects
Commit 0a317c12 authored by zsxwing's avatar zsxwing Committed by Andrew Or
Browse files

[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
parent 57ed16cf
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment