YARN-8040. [UI2] New YARN UI webapp does not respect current pathname for REST api. Contributed by Sunil G.
This commit is contained in:
parent
49c747ab18
commit
98356a3dde
|
@ -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(/\/$/, '');
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue