mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-02-16 17:25:58 +00:00
open Legacy Mongo SHell with correct base URL in sovereign clouds (#1823)
Co-authored-by: Asier Isayas <aisayas@microsoft.com>
This commit is contained in:
parent
618c5ec0fe
commit
cbd5e6bf76
@ -35,7 +35,7 @@ export interface IMongoShellTabAccessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface IMongoShellTabComponentStates {
|
export interface IMongoShellTabComponentStates {
|
||||||
url: URL;
|
url: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IMongoShellTabComponentProps {
|
export interface IMongoShellTabComponentProps {
|
||||||
@ -221,7 +221,7 @@ export default class MongoShellTabComponent extends Component<
|
|||||||
name="explorer"
|
name="explorer"
|
||||||
className="iframe"
|
className="iframe"
|
||||||
style={{ width: "100%", height: "100%", border: 0, padding: 0, margin: 0, overflow: "hidden" }}
|
style={{ width: "100%", height: "100%", border: 0, padding: 0, margin: 0, overflow: "hidden" }}
|
||||||
src={this.state.url.toString()}
|
src={this.state.url}
|
||||||
id={this.props.tabsBaseInstance.tabId}
|
id={this.props.tabsBaseInstance.tabId}
|
||||||
onLoad={(event) => this.setContentFocus(event)}
|
onLoad={(event) => this.setContentFocus(event)}
|
||||||
title="Mongo Shell"
|
title="Mongo Shell"
|
||||||
|
@ -1,15 +1,11 @@
|
|||||||
import { configContext } from "ConfigContext";
|
|
||||||
import { userContext } from "../../../UserContext";
|
import { userContext } from "../../../UserContext";
|
||||||
|
|
||||||
export function getMongoShellUrl(useMongoProxyEndpoint?: boolean): URL {
|
export function getMongoShellUrl(useMongoProxyEndpoint?: boolean): string {
|
||||||
const { databaseAccount: account } = userContext;
|
const { databaseAccount: account } = userContext;
|
||||||
const resourceId = account?.id;
|
const resourceId = account?.id;
|
||||||
const accountName = account?.name;
|
const accountName = account?.name;
|
||||||
const mongoEndpoint = account?.properties?.mongoEndpoint || account?.properties?.documentEndpoint;
|
const mongoEndpoint = account?.properties?.mongoEndpoint || account?.properties?.documentEndpoint;
|
||||||
const queryString = `resourceId=${resourceId}&accountName=${accountName}&mongoEndpoint=${mongoEndpoint}`;
|
const queryString = `resourceId=${resourceId}&accountName=${accountName}&mongoEndpoint=${mongoEndpoint}`;
|
||||||
const path: string = useMongoProxyEndpoint
|
|
||||||
? `/mongoshell/index.html?${queryString}`
|
|
||||||
: `/mongoshell/indexv2.html?${queryString}`;
|
|
||||||
|
|
||||||
return new URL(path, configContext.hostedExplorerURL);
|
return useMongoProxyEndpoint ? `/mongoshell/index.html?${queryString}` : `/mongoshell/indexv2.html?${queryString}`;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user