Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions core/src/main/resources/org/apache/spark/ui/static/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,27 +96,27 @@ function formatLogsCells(execLogs, type) {
}

function getStandAloneAppId(cb) {
var words = getBaseURI().split('/');
var ind = words.indexOf("proxy");
var appId;
if (ind > 0) {
appId = words[ind + 1];
cb(appId);
return;
}
ind = words.indexOf("history");
if (ind > 0) {
appId = words[ind + 1];
cb(appId);
return;
}
// Looks like Web UI is running in standalone mode
// Let's get application-id using REST End Point
$.getJSON(uiRoot + "/api/v1/applications", function(response, status, jqXHR) {
if (response && response.length > 0) {
var appId = response[0].id;
cb(appId);
return;
} else {
var words = document.baseURI.split('/');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, have you tested the code changes for Spark UI behind proxy and Spark UI of History server?

var ind = words.indexOf("proxy");
if (ind > 0) {
var appId = words[ind + 1];
cb(appId);
return;
}
ind = words.indexOf("history");
if (ind > 0) {
var appId = words[ind + 1];
cb(appId)
return;
}
}
});
}
Expand Down Expand Up @@ -231,4 +231,4 @@ function createRESTEndPointForMiscellaneousProcess(appId) {
function getBaseURI() {
return document.baseURI || document.URL;
}
/* eslint-enable no-unused-vars */
/* eslint-enable no-unused-vars */