No Attached Accounts Message (#1589)
This commit is contained in:
Родитель
e8e38d58b3
Коммит
55fee635e8
|
@ -102,18 +102,24 @@ export async function activateInternal(context: vscode.ExtensionContext, perfSta
|
|||
await ext.tree.refresh(ext.attachedAccountsNode);
|
||||
});
|
||||
registerCommand('azureDatabases.refresh', async (_actionContext: IActionContext, node?: AzExtTreeItem) => await ext.tree.refresh(node));
|
||||
registerCommand('cosmosDB.detachDatabaseAccount', async (actionContext: IActionContext, node?: AzureTreeItem) => {
|
||||
if (!node) {
|
||||
node = await ext.tree.showTreeItemPicker<AzureTreeItem>(cosmosDBTopLevelContextValues.map((val: string) => val += AttachedAccountSuffix), actionContext);
|
||||
}
|
||||
if (node instanceof MongoAccountTreeItem) {
|
||||
if (ext.connectedMongoDB && node.fullId === ext.connectedMongoDB.parent.fullId) {
|
||||
setConnectedNode(undefined, codeLensProvider);
|
||||
await node.refresh();
|
||||
registerCommand('cosmosDB.detachDatabaseAccount', async (actionContext: IActionContext & ITreeItemPickerContext, node?: AzureTreeItem) => {
|
||||
const children = await ext.attachedAccountsNode.loadAllChildren(actionContext);
|
||||
if (children[0].contextValue === "cosmosDBAttachDatabaseAccount") {
|
||||
const message = localize('noAttachedAccounts', 'There are no Attached Accounts.');
|
||||
vscode.window.showInformationMessage(message);
|
||||
} else {
|
||||
if (!node) {
|
||||
node = await ext.tree.showTreeItemPicker<AzureTreeItem>(cosmosDBTopLevelContextValues.map((val: string) => val += AttachedAccountSuffix), actionContext);
|
||||
}
|
||||
if (node instanceof MongoAccountTreeItem) {
|
||||
if (ext.connectedMongoDB && node.fullId === ext.connectedMongoDB.parent.fullId) {
|
||||
setConnectedNode(undefined, codeLensProvider);
|
||||
await node.refresh();
|
||||
}
|
||||
}
|
||||
await ext.attachedAccountsNode.detach(node);
|
||||
await ext.tree.refresh(ext.attachedAccountsNode);
|
||||
}
|
||||
await ext.attachedAccountsNode.detach(node);
|
||||
await ext.tree.refresh(ext.attachedAccountsNode);
|
||||
});
|
||||
registerCommand('cosmosDB.importDocument', async (actionContext: IActionContext, selectedNode: vscode.Uri | MongoCollectionTreeItem | DocDBCollectionTreeItem, uris: vscode.Uri[]) => {
|
||||
if (selectedNode instanceof vscode.Uri) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче