mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-25 06:56:38 +00:00
Fixing terminal tab to display correct API type for network warning (#1747)
This commit is contained in:
parent
f87611a39d
commit
5d80ecb462
@ -34,6 +34,7 @@ class NotebookTerminalComponentAdapter implements ReactAdapter {
|
|||||||
private getTabId: () => string,
|
private getTabId: () => string,
|
||||||
private getUsername: () => string,
|
private getUsername: () => string,
|
||||||
private isAllPublicIPAddressesEnabled: ko.Observable<boolean>,
|
private isAllPublicIPAddressesEnabled: ko.Observable<boolean>,
|
||||||
|
private kind: ViewModels.TerminalKind,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public renderComponent(): JSX.Element {
|
public renderComponent(): JSX.Element {
|
||||||
@ -42,7 +43,7 @@ class NotebookTerminalComponentAdapter implements ReactAdapter {
|
|||||||
<QuickstartFirewallNotification
|
<QuickstartFirewallNotification
|
||||||
messageType={MessageTypes.OpenPostgresNetworkingBlade}
|
messageType={MessageTypes.OpenPostgresNetworkingBlade}
|
||||||
screenshot={FirewallRuleScreenshot}
|
screenshot={FirewallRuleScreenshot}
|
||||||
shellName="PostgreSQL"
|
shellName={this.getShellNameForDisplay(this.kind)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -58,6 +59,18 @@ class NotebookTerminalComponentAdapter implements ReactAdapter {
|
|||||||
<Spinner styles={{ root: { marginTop: 10 } }} size={SpinnerSize.large}></Spinner>
|
<Spinner styles={{ root: { marginTop: 10 } }} size={SpinnerSize.large}></Spinner>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getShellNameForDisplay(terminalKind: ViewModels.TerminalKind): string {
|
||||||
|
switch (terminalKind) {
|
||||||
|
case ViewModels.TerminalKind.Postgres:
|
||||||
|
return "PostgreSQL";
|
||||||
|
case ViewModels.TerminalKind.Mongo:
|
||||||
|
case ViewModels.TerminalKind.VCoreMongo:
|
||||||
|
return "MongoDB";
|
||||||
|
default:
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class TerminalTab extends TabsBase {
|
export default class TerminalTab extends TabsBase {
|
||||||
@ -76,6 +89,7 @@ export default class TerminalTab extends TabsBase {
|
|||||||
() => this.tabId,
|
() => this.tabId,
|
||||||
() => this.getUsername(),
|
() => this.getUsername(),
|
||||||
this.isAllPublicIPAddressesEnabled,
|
this.isAllPublicIPAddressesEnabled,
|
||||||
|
options.kind,
|
||||||
);
|
);
|
||||||
this.notebookTerminalComponentAdapter.parameters = ko.computed<boolean>(() => {
|
this.notebookTerminalComponentAdapter.parameters = ko.computed<boolean>(() => {
|
||||||
if (
|
if (
|
||||||
|
Loading…
Reference in New Issue
Block a user