mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Fix to ensure that we rewrite spark ui links correctly (#4962)
This commit is contained in:
@@ -390,7 +390,19 @@ export class CellModel implements ICellModel {
|
|||||||
let endpoint = this.getKnoxEndpoint(model.activeConnection);
|
let endpoint = this.getKnoxEndpoint(model.activeConnection);
|
||||||
let host = endpoint && endpoint.ipAddress ? endpoint.ipAddress : model.activeConnection.serverName;
|
let host = endpoint && endpoint.ipAddress ? endpoint.ipAddress : model.activeConnection.serverName;
|
||||||
let html = result.data['text/html'];
|
let html = result.data['text/html'];
|
||||||
html = html.replace(/(https?:\/\/mssql-master.*\/proxy)(.*)/g, function (a, b, c) {
|
html =this.rewriteUrlUsingRegex(/(https?:\/\/mssql-master.*\/proxy)(.*)/g, html, host);
|
||||||
|
html =this.rewriteUrlUsingRegex(/(https?:\/\/master.*master-svc.*\/proxy)(.*)/g, html, host);
|
||||||
|
(<nb.IDisplayResult>output).data['text/html'] = html;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (e) { }
|
||||||
|
}
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
private rewriteUrlUsingRegex(regex: RegExp, html: string, host: string): string {
|
||||||
|
return html.replace(regex, function (a, b, c) {
|
||||||
let ret = '';
|
let ret = '';
|
||||||
if (b !== '') {
|
if (b !== '') {
|
||||||
ret = 'https://' + host + ':30443/gateway/default/yarn/proxy';
|
ret = 'https://' + host + ':30443/gateway/default/yarn/proxy';
|
||||||
@@ -400,13 +412,6 @@ export class CellModel implements ICellModel {
|
|||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
});
|
});
|
||||||
(<nb.IDisplayResult>output).data['text/html'] = html;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (e) { }
|
|
||||||
}
|
|
||||||
return output;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private getDisplayId(msg: nb.IIOPubMessage): string | undefined {
|
private getDisplayId(msg: nb.IIOPubMessage): string | undefined {
|
||||||
|
|||||||
Reference in New Issue
Block a user