Fix #6396 Spark link is incorrect on latest server (#6398)

* Fix #6396 Spark link is incorrect on latest server
Internal Spark endpoint value changed. Updated to handle old & new URL
This commit is contained in:
Kevin Cunnane
2019-07-17 13:55:01 -07:00
committed by GitHub
parent 2d73b6afb1
commit 3c499d31e8

View File

@@ -452,7 +452,11 @@ export class CellModel implements ICellModel {
let host = endpoint && endpoint.ipAddress ? endpoint.ipAddress : model.activeConnection.serverName;
let port = endpoint && endpoint.port ? ':' + endpoint.port.toString() : defaultPort;
let html = result.data['text/html'];
// CTP 3.1 and earlier Spark link
html = this.rewriteUrlUsingRegex(/(https?:\/\/master.*\/proxy)(.*)/g, html, host, port, yarnUi);
// CTP 3.2 and later spark link
html = this.rewriteUrlUsingRegex(/(https?:\/\/sparkhead.*\/proxy)(.*)/g, html, host, port, yarnUi);
// Driver link
html = this.rewriteUrlUsingRegex(/(https?:\/\/storage.*\/containerlogs)(.*)/g, html, host, port, driverLog);
(<nb.IDisplayResult>output).data['text/html'] = html;
}