mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Only allow one arc controller connection (#12685)
This commit is contained in:
@@ -26,6 +26,14 @@ export async function activate(context: vscode.ExtensionContext): Promise<arc.IE
|
|||||||
});
|
});
|
||||||
|
|
||||||
vscode.commands.registerCommand('arc.connectToController', async () => {
|
vscode.commands.registerCommand('arc.connectToController', async () => {
|
||||||
|
const nodes = await treeDataProvider.getChildren();
|
||||||
|
if (nodes.length > 0) {
|
||||||
|
const response = await vscode.window.showErrorMessage(loc.onlyOneControllerSupported, loc.yes, loc.no);
|
||||||
|
if (response !== loc.yes) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await treeDataProvider.removeController(nodes[0] as ControllerTreeNode);
|
||||||
|
}
|
||||||
const dialog = new ConnectToControllerDialog(treeDataProvider);
|
const dialog = new ConnectToControllerDialog(treeDataProvider);
|
||||||
dialog.showDialog();
|
dialog.showDialog();
|
||||||
const model = await dialog.waitForClose();
|
const model = await dialog.waitForClose();
|
||||||
|
|||||||
@@ -167,3 +167,4 @@ export function errorConnectingToController(error: any): string { return localiz
|
|||||||
export function passwordAcquisitionFailed(error: any): string { return localize('arc.passwordAcquisitionFailed', "Failed to acquire password. {0}", getErrorMessage(error)); }
|
export function passwordAcquisitionFailed(error: any): string { return localize('arc.passwordAcquisitionFailed', "Failed to acquire password. {0}", getErrorMessage(error)); }
|
||||||
export const invalidPassword = localize('arc.invalidPassword', "The password did not work, try again.");
|
export const invalidPassword = localize('arc.invalidPassword', "The password did not work, try again.");
|
||||||
export function errorVerifyingPassword(error: any): string { return localize('arc.errorVerifyingPassword', "Error encountered while verifying password. {0}", getErrorMessage(error)); }
|
export function errorVerifyingPassword(error: any): string { return localize('arc.errorVerifyingPassword', "Error encountered while verifying password. {0}", getErrorMessage(error)); }
|
||||||
|
export const onlyOneControllerSupported = localize('arc.onlyOneControllerSupported', "Only one controller connection is currently supported at this time. Do you wish to remove the existing connection and add a new one?");
|
||||||
|
|||||||
Reference in New Issue
Block a user