YARN-8040. [UI2] New YARN UI webapp does not respect current pathname for REST 
api. Contributed by Sunil G.


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

Branch: refs/heads/branch-3.1
Commit: d98c3ca5fd8795eb10fe3e68215934f083ab1135
Parents: 21717db
Author: Sunil G <sun...@apache.org>
Authored: Sun Mar 18 10:44:33 2018 +0530
Committer: Arpit Agarwal <a...@apache.org>
Committed: Fri Apr 13 10:18:39 2018 -0700

----------------------------------------------------------------------
 .../hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/d98c3ca5/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js
----------------------------------------------------------------------
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js
index d047ed1..83df971 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js
@@ -40,7 +40,7 @@ function getTimeLineV1URL(rmhost) {
 
 function updateConfigs(application) {
   var hostname = window.location.hostname;
-  var rmhost = hostname + (window.location.port ? ':' + window.location.port: 
'');
+  var rmhost = hostname + (window.location.port ? ':' + window.location.port: 
'') + skipTrailingSlash(window.location.pathname);
 
   if(!ENV.hosts.rmWebAddress) {
     ENV.hosts.rmWebAddress = rmhost;
@@ -130,3 +130,8 @@ export default {
   before: 'env',
   initialize
 };
+
+const skipTrailingSlash = function(path) {
+  path = path.replace('ui2/', '');
+  return path.replace(/\/$/, '');
+};


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to