This is an automated email from the ASF dual-hosted git repository. dongjoon pushed a commit to branch branch-3.2 in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-3.2 by this push: new 6b62459 [SPARK-35822][UI] Spark UI-Executor tab is empty in IE11 6b62459 is described below commit 6b62459c09bcabbaea34609996b0cdb2a0ad464a Author: dgd_contributor <dgd_contribu...@viettel.com.vn> AuthorDate: Sat Sep 11 15:58:31 2021 -0700 [SPARK-35822][UI] Spark UI-Executor tab is empty in IE11 ### What changes were proposed in this pull request? Refactor some functions in utils.js to fix the empty UI-Executor tab in yarn mode in IE11. ### Why are the changes needed? Spark UI-Executor tab is empty in IE11: So this PR to fix this. ![Executortab_IE](https://user-images.githubusercontent.com/84778052/132786964-b17b6d12-457f-4ba3-894f-3f2e1c285b1e.PNG) ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Existed UT Testcase Closes #33937 from dgd-contributor/SPARK-35822-v2. Authored-by: dgd_contributor <dgd_contribu...@viettel.com.vn> Signed-off-by: Dongjoon Hyun <dongj...@apache.org> (cherry picked from commit ebca01f03e4f89b1ddfb12916e3b6bac5be36469) Signed-off-by: Dongjoon Hyun <dongj...@apache.org> --- .../main/resources/org/apache/spark/ui/static/log-view.js | 4 ++-- .../main/resources/org/apache/spark/ui/static/stagepage.js | 8 ++++---- core/src/main/resources/org/apache/spark/ui/static/utils.js | 12 ++++++++---- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/core/src/main/resources/org/apache/spark/ui/static/log-view.js b/core/src/main/resources/org/apache/spark/ui/static/log-view.js index 1a4f925..2f416d8 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/log-view.js +++ b/core/src/main/resources/org/apache/spark/ui/static/log-view.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global $ */ +/* global $, getBaseURI */ var baseParams; @@ -58,7 +58,7 @@ function getRESTEndPoint() { // If the worker is served from the master through a proxy (see doc on spark.ui.reverseProxy), // we need to retain the leading ../proxy/<workerid>/ part of the URL when making REST requests. // Similar logic is contained in executorspage.js function createRESTEndPoint. - var words = document.baseURI.split('/'); + var words = getBaseURI().split('/'); var ind = words.indexOf("proxy"); if (ind > 0) { return words.slice(0, ind + 2).join('/') + "/log"; diff --git a/core/src/main/resources/org/apache/spark/ui/static/stagepage.js b/core/src/main/resources/org/apache/spark/ui/static/stagepage.js index fea595d..5eabee3 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/stagepage.js +++ b/core/src/main/resources/org/apache/spark/ui/static/stagepage.js @@ -17,7 +17,7 @@ /* global $, ConvertDurationString, Mustache, createRESTEndPointForExecutorsPage */ /* global createTemplateURI, formatBytes, formatDate, formatDuration, formatLogsCells */ -/* global getStandAloneAppId, setDataTableDefaults, uiRoot */ +/* global getStandAloneAppId, setDataTableDefaults, getBaseURI, uiRoot */ var shouldBlockUI = true; @@ -71,8 +71,8 @@ $.extend( $.fn.dataTable.ext.type.order, { // e.g. (history) https://domain:50509/history/application_1536254569791_3806251/1/stages/stage/?id=4&attempt=1 // e.g. (proxy) https://domain:50505/proxy/application_1502220952225_59143/stages/stage?id=4&attempt=1 function stageEndPoint(appId) { - var queryString = document.baseURI.split('?'); - var words = document.baseURI.split('/'); + var queryString = getBaseURI().split('?'); + var words = getBaseURI().split('/'); var indexOfProxy = words.indexOf("proxy"); var stageId = queryString[1].split("&").filter(word => word.includes("id="))[0].split("=")[1]; var newBaseURI; @@ -303,7 +303,7 @@ function reselectCheckboxesBasedOnTaskTableState() { } function getStageAttemptId() { - var words = document.baseURI.split('?'); + var words = getBaseURI().split('?'); var digitsRegex = /[0-9]+/; // We are using regex here to extract the stage attempt id as there might be certain url's with format // like /proxy/application_1539986433979_27115/stages/stage/?id=0&attempt=0#tasksTitle diff --git a/core/src/main/resources/org/apache/spark/ui/static/utils.js b/core/src/main/resources/org/apache/spark/ui/static/utils.js index a2d4f55..1bec1c1 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/utils.js +++ b/core/src/main/resources/org/apache/spark/ui/static/utils.js @@ -96,7 +96,7 @@ function formatLogsCells(execLogs, type) { } function getStandAloneAppId(cb) { - var words = document.baseURI.split('/'); + var words = getBaseURI().split('/'); var ind = words.indexOf("proxy"); var appId; if (ind > 0) { @@ -148,7 +148,7 @@ function ConvertDurationString(data) { } function createTemplateURI(appId, templateName) { - var words = document.baseURI.split('/'); + var words = getBaseURI().split('/'); var ind = words.indexOf("proxy"); var baseURI; if (ind > 0) { @@ -183,7 +183,7 @@ function formatDate(date) { } function createRESTEndPointForExecutorsPage(appId) { - var words = document.baseURI.split('/'); + var words = getBaseURI().split('/'); var ind = words.indexOf("proxy"); var newBaseURI; if (ind > 0) { @@ -206,7 +206,7 @@ function createRESTEndPointForExecutorsPage(appId) { } function createRESTEndPointForMiscellaneousProcess(appId) { - var words = document.baseURI.split('/'); + var words = getBaseURI().split('/'); var ind = words.indexOf("proxy"); var newBaseURI; if (ind > 0) { @@ -227,4 +227,8 @@ function createRESTEndPointForMiscellaneousProcess(appId) { } return uiRoot + "/api/v1/applications/" + appId + "/allmiscellaneousprocess"; } + +function getBaseURI() { + return document.baseURI || document.URL; +} /* eslint-enable no-unused-vars */ \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org