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

This commit is contained in:
Sunil G 2018-03-18 10:44:33 +05:30 committed by Arpit Agarwal
parent 21717db6a0
commit d98c3ca5fd
1 changed files with 6 additions and 1 deletions

View File

@ -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(/\/$/, '');
};