Repository: storm
Updated Branches:
  refs/heads/master 3ff904bda -> e485e08e0


STORM-456: Changing the url-encode method to use ring ecnode as ring auto 
decodes the requests with its own scheme.


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

Branch: refs/heads/master
Commit: 16b7382dc7675d7a8b7aa0108af836913eef0560
Parents: 527eb29
Author: Parth Brahmbhatt <[email protected]>
Authored: Tue Dec 23 11:56:08 2014 -0800
Committer: Parth Brahmbhatt <[email protected]>
Committed: Tue Dec 23 12:18:43 2014 -0800

----------------------------------------------------------------------
 storm-core/src/clj/backtype/storm/ui/core.clj   | 24 ++++++++++----------
 .../templates/topology-page-template.html       |  8 +++----
 2 files changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/16b7382d/storm-core/src/clj/backtype/storm/ui/core.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/ui/core.clj 
b/storm-core/src/clj/backtype/storm/ui/core.clj
index 3dc7396..7527fcb 100644
--- a/storm-core/src/clj/backtype/storm/ui/core.clj
+++ b/storm-core/src/clj/backtype/storm/ui/core.clj
@@ -544,7 +544,7 @@
     (for [^TopologySummary t summs]
       {
        "id" (.get_id t)
-       "encodedId" (url-encode (.get_id t))
+       "encodedId" (ring.util.codec/url-encode (.get_id t))
        "owner" (.get_owner t)
        "name" (.get_name t)
        "status" (.get_status t)
@@ -578,7 +578,7 @@
               error-host (get-error-host last-error)
               error-port (get-error-port last-error error-host top-id)]]
     {"spoutId" id
-     "encodedSpoutId" (url-encode id)
+     "encodedSpoutId" (ring.util.codec/url-encode id)
      "executors" (count summs)
      "tasks" (sum-tasks summs)
      "emitted" (get-in stats [:emitted window])
@@ -602,7 +602,7 @@
               error-host (get-error-host last-error)
               error-port (get-error-port last-error error-host top-id)]]
     {"boltId" id
-     "encodedBoltId" (url-encode id)
+     "encodedBoltId" (ring.util.codec/url-encode id)
      "executors" (count summs)
      "tasks" (sum-tasks summs)
      "emitted" (get-in stats [:emitted window])
@@ -624,7 +624,7 @@
         workers (set (for [^ExecutorSummary e executors]
                        [(.get_host e) (.get_port e)]))]
       {"id" (.get_id summ)
-       "encodedId" (url-encode (.get_id summ))
+       "encodedId" (ring.util.codec/url-encode (.get_id summ))
        "owner" (.get_owner summ)
        "name" (.get_name summ)
        "status" (.get_status summ)
@@ -706,7 +706,7 @@
                           swap-map-order
                           (get window)))]]
     {"id" (pretty-executor-info (.get_executor_info e))
-     "encodedId" (url-encode (pretty-executor-info (.get_executor_info e)))
+     "encodedId" (ring.util.codec/url-encode (pretty-executor-info 
(.get_executor_info e)))
      "uptime" (pretty-uptime-sec (.get_uptime_secs e))
      "host" (.get_host e)
      "port" (.get_port e)
@@ -783,7 +783,7 @@
             swap-map-order)]
     (for [[^GlobalStreamId s stats] stream-summary]
       {"component" (.get_componentId s)
-       "encodedComponent" (url-encode (.get_componentId s))
+       "encodedComponent" (ring.util.codec/url-encode (.get_componentId s))
        "stream" (.get_streamId s)
        "executeLatency" (float-str (:execute-latencies stats))
        "processLatency" (float-str (:execute-latencies stats))
@@ -802,7 +802,7 @@
                           swap-map-order
                           (get window)))]]
     {"id" (pretty-executor-info (.get_executor_info e))
-     "encodedId" (url-encode (pretty-executor-info (.get_executor_info e)))
+     "encodedId" (ring.util.codec/url-encode (pretty-executor-info 
(.get_executor_info e)))
      "uptime" (pretty-uptime-sec (.get_uptime_secs e))
      "host" (.get_host e)
      "port" (.get_port e)
@@ -843,12 +843,12 @@
       (merge
         {"user" user
          "id" component
-         "encodedId" (url-encode component)
+         "encodedId" (ring.util.codec/url-encode component)
          "name" (.get_name summ)
          "executors" (count summs)
          "tasks" (sum-tasks summs)
          "topologyId" topology-id
-         "encodedTopologyId" (url-encode topology-id)
+         "encodedTopologyId" (ring.util.codec/url-encode topology-id)
          "window" window
          "componentType" (name type)
          "windowHint" (window-hint window)}
@@ -916,7 +916,7 @@
         (assert-authorized-user servlet-request "deactivate" (topology-config 
id))
         (.deactivate nimbus name)
         (log-message "Deactivating topology '" name "'")))
-    (resp/redirect (str "/api/v1/topology/" (url-encode id))))
+    (resp/redirect (str "/api/v1/topology/" (ring.util.codec/url-encode id))))
   (POST "/api/v1/topology/:id/rebalance/:wait-time" [:as {:keys [cookies 
servlet-request]} id wait-time]
     (with-nimbus nimbus
       (let [tplg (.getTopologyInfo ^Nimbus$Client nimbus id)
@@ -926,7 +926,7 @@
         (.set_wait_secs options (Integer/parseInt wait-time))
         (.rebalance nimbus name options)
         (log-message "Rebalancing topology '" name "' with wait time: " 
wait-time " secs")))
-    (resp/redirect (str "/api/v1/topology/" (url-encode id))))
+    (resp/redirect (str "/api/v1/topology/" (ring.util.codec/url-encode id))))
   (POST "/api/v1/topology/:id/kill/:wait-time" [:as {:keys [cookies 
servlet-request]} id wait-time]
     (with-nimbus nimbus
       (let [tplg (.getTopologyInfo ^Nimbus$Client nimbus id)
@@ -936,7 +936,7 @@
         (.set_wait_secs options (Integer/parseInt wait-time))
         (.killTopologyWithOpts nimbus name options)
         (log-message "Killing topology '" name "' with wait time: " wait-time 
" secs")))
-    (resp/redirect (str "/api/v1/topology/" (url-encode id))))
+    (resp/redirect (str "/api/v1/topology/" (ring.util.codec/url-encode id))))
 
   (GET "/" [:as {cookies :cookies}]
        (resp/redirect "/index.html"))

http://git-wip-us.apache.org/repos/asf/storm/blob/16b7382d/storm-core/src/ui/public/templates/topology-page-template.html
----------------------------------------------------------------------
diff --git a/storm-core/src/ui/public/templates/topology-page-template.html 
b/storm-core/src/ui/public/templates/topology-page-template.html
index b74edd2..0a10446 100644
--- a/storm-core/src/ui/public/templates/topology-page-template.html
+++ b/storm-core/src/ui/public/templates/topology-page-template.html
@@ -340,9 +340,9 @@
 <script id="topology-actions-template" type="text/html">
   <h2>Topology actions</h2>
   <p id="topology-actions">
-    <input {{activateStatus}} onclick="confirmAction('{{id}}', '{{name}}', 
'activate', false, 0)" type="button" value="Activate">
-    <input {{deactivateStatus}} onclick="confirmAction('{{id}}', '{{name}}', 
'deactivate', false, 0)" type="button" value="Deactivate">
-    <input {{rebalanceStatus}} onclick="confirmAction('{{id}}', '{{name}}', 
'rebalance', true, {{msgTimeout}})" type="button" value="Rebalance">
-    <input {{killStatus}} onclick="confirmAction('{{id}}', '{{name}}', 'kill', 
true, 30)" type="button" value="Kill">
+    <input {{activateStatus}} onclick="confirmAction('{{encodedId}}', 
'{{name}}', 'activate', false, 0)" type="button" value="Activate">
+    <input {{deactivateStatus}} onclick="confirmAction('{{encodedId}}', 
'{{name}}', 'deactivate', false, 0)" type="button" value="Deactivate">
+    <input {{rebalanceStatus}} onclick="confirmAction('{{encodedId}}', 
'{{name}}', 'rebalance', true, {{msgTimeout}})" type="button" value="Rebalance">
+    <input {{killStatus}} onclick="confirmAction('{{encodedId}}', '{{name}}', 
'kill', true, 30)" type="button" value="Kill">
   </p>
 </script>

Reply via email to