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
parent 49c747ab18
commit 98356a3dde

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;
@ -127,3 +127,8 @@ export default {
before: 'env',
initialize
};
const skipTrailingSlash = function(path) {
path = path.replace('ui2/', '');
return path.replace(/\/$/, '');
};