Browse Source

YARN-9493. Scheduler Page does not display the right page by query string. Contributed by Wanqiang Ji.

Giovanni Matteo Fumarola 6 years ago
parent
commit
29ff7fb140

+ 3 - 1
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/SchedulerPageUtil.java

@@ -28,7 +28,8 @@ public class SchedulerPageUtil {
       html.
       html.
           script().$type("text/javascript").
           script().$type("text/javascript").
           __("function reopenQueryNodes() {",
           __("function reopenQueryNodes() {",
-            "  var currentParam = window.location.href.split('?');",
+            "  var currentParam = decodeURIComponent(window.location.href)"
+                + ".split('?');",
             "  var tmpCurrentParam = currentParam;",
             "  var tmpCurrentParam = currentParam;",
             "  var queryQueuesString = '';",
             "  var queryQueuesString = '';",
             "  if (tmpCurrentParam.length > 1) {",
             "  if (tmpCurrentParam.length > 1) {",
@@ -136,6 +137,7 @@ public class SchedulerPageUtil {
             "};",
             "};",
             "",
             "",
             "function removeQueueName(queryString, queueName) {",
             "function removeQueueName(queryString, queueName) {",
+            "  queryString = decodeURIComponent(queryString);",
             "  var index = queryString.indexOf(queueName);",
             "  var index = queryString.indexOf(queueName);",
             "  // Finding if queue is present in query param then only remove it",
             "  // Finding if queue is present in query param then only remove it",
             "  if (index != -1) {",
             "  if (index != -1) {",