spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andrewo...@apache.org
Subject spark git commit: [SPARK-7649] [STREAMING] [WEBUI] Use window.localStorage to store the status rather than the url
Date Thu, 14 May 2015 23:57:59 GMT
Repository: spark
Updated Branches:
  refs/heads/branch-1.4 8d8876d3b -> 335848577


[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

(cherry picked from commit 0a317c124c3a43089cdb8f079345c8f2842238cd)
Signed-off-by: Andrew Or <andrew@databricks.com>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/33584857
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/33584857
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/33584857

Branch: refs/heads/branch-1.4
Commit: 3358485778b6c1ad23dc13856d3ba330f7e1a8e9
Parents: 8d8876d
Author: zsxwing <zsxwing@gmail.com>
Authored: Thu May 14 16:57:33 2015 -0700
Committer: Andrew Or <andrew@databricks.com>
Committed: Thu May 14 16:57:55 2015 -0700

----------------------------------------------------------------------
 .../apache/spark/ui/static/streaming-page.js    | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/33584857/core/src/main/resources/org/apache/spark/ui/static/streaming-page.js
----------------------------------------------------------------------
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 22b1868..0fac658 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) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org


Mime
View raw message