|
@@ -84,9 +84,36 @@ function getSecurityURL(rmhost) {
|
|
return url;
|
|
return url;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+function getClusterIdFromYARN(rmhost, application) {
|
|
|
|
+ var httpUrl = window.location.protocol + '//' +
|
|
|
|
+ (ENV.hosts.localBaseAddress? ENV.hosts.localBaseAddress + '/' : '') + rmhost;
|
|
|
|
+
|
|
|
|
+ httpUrl += '/conf?name=yarn.resourcemanager.cluster-id';
|
|
|
|
+ Ember.Logger.log("Get cluster-id URL is: " + httpUrl);
|
|
|
|
+
|
|
|
|
+ var clusterId = "";
|
|
|
|
+ $.ajax({
|
|
|
|
+ type: 'GET',
|
|
|
|
+ dataType: 'json',
|
|
|
|
+ async: false,
|
|
|
|
+ context: this,
|
|
|
|
+ url: httpUrl,
|
|
|
|
+ success: function(data) {
|
|
|
|
+ clusterId = data.property.value;
|
|
|
|
+ Ember.Logger.log("Cluster Id from RM: " + clusterId);
|
|
|
|
+ application.advanceReadiness();
|
|
|
|
+ },
|
|
|
|
+ error: function() {
|
|
|
|
+ application.advanceReadiness();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return clusterId;
|
|
|
|
+}
|
|
|
|
+
|
|
function updateConfigs(application) {
|
|
function updateConfigs(application) {
|
|
var hostname = window.location.hostname;
|
|
var hostname = window.location.hostname;
|
|
- var rmhost = hostname + (window.location.port ? ':' + window.location.port: '') + skipTrailingSlash(window.location.pathname);
|
|
|
|
|
|
+ var rmhost = hostname + (window.location.port ? ':' + window.location.port: '') +
|
|
|
|
+ skipTrailingSlash(window.location.pathname);
|
|
|
|
|
|
window.ENV = window.ENV || {};
|
|
window.ENV = window.ENV || {};
|
|
window.ENV.hosts = window.ENV.hosts || {};
|
|
window.ENV.hosts = window.ENV.hosts || {};
|
|
@@ -103,6 +130,10 @@ function updateConfigs(application) {
|
|
var protocolSchemeFromRM = getYarnHttpProtocolScheme(rmhost, application);
|
|
var protocolSchemeFromRM = getYarnHttpProtocolScheme(rmhost, application);
|
|
Ember.Logger.log("Is protocol scheme https? " + (protocolSchemeFromRM == "HTTPS_ONLY"));
|
|
Ember.Logger.log("Is protocol scheme https? " + (protocolSchemeFromRM == "HTTPS_ONLY"));
|
|
var isHttpsSchemeEnabled = (protocolSchemeFromRM == "HTTPS_ONLY");
|
|
var isHttpsSchemeEnabled = (protocolSchemeFromRM == "HTTPS_ONLY");
|
|
|
|
+
|
|
|
|
+ var clusterIdFromYARN = getClusterIdFromYARN(rmhost, application);
|
|
|
|
+ ENV.clusterId = clusterIdFromYARN;
|
|
|
|
+
|
|
if(!ENV.hosts.timelineWebAddress) {
|
|
if(!ENV.hosts.timelineWebAddress) {
|
|
var timelinehost = "";
|
|
var timelinehost = "";
|
|
$.ajax({
|
|
$.ajax({
|
|
@@ -207,6 +238,7 @@ export default {
|
|
};
|
|
};
|
|
|
|
|
|
const skipTrailingSlash = function(path) {
|
|
const skipTrailingSlash = function(path) {
|
|
|
|
+ path = path.replace('index.html', '');
|
|
path = path.replace('ui2/', '');
|
|
path = path.replace('ui2/', '');
|
|
path = path.replace(/\/$/, '');
|
|
path = path.replace(/\/$/, '');
|
|
console.log('base url:' + path)
|
|
console.log('base url:' + path)
|