mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Add progress indicator for arc instance deletion (#12510)
This commit is contained in:
@@ -129,6 +129,7 @@ export const noExternalEndpoint = localize('arc.noExternalEndpoint', "No Externa
|
|||||||
export const podsReady = localize('arc.podsReady', "pods ready");
|
export const podsReady = localize('arc.podsReady', "pods ready");
|
||||||
|
|
||||||
export function databaseCreated(name: string): string { return localize('arc.databaseCreated', "Database {0} created", name); }
|
export function databaseCreated(name: string): string { return localize('arc.databaseCreated', "Database {0} created", name); }
|
||||||
|
export function deletingInstance(name: string): string { return localize('arc.deletingInstance', "Deleting instance '{0}'...", name); }
|
||||||
export function instanceDeleted(name: string): string { return localize('arc.instanceDeleted', "Instance '{0}' deleted", name); }
|
export function instanceDeleted(name: string): string { return localize('arc.instanceDeleted', "Instance '{0}' deleted", name); }
|
||||||
export function copiedToClipboard(name: string): string { return localize('arc.copiedToClipboard', "{0} copied to clipboard", name); }
|
export function copiedToClipboard(name: string): string { return localize('arc.copiedToClipboard', "{0} copied to clipboard", name); }
|
||||||
export function clickTheTroubleshootButton(resourceType: string): string { return localize('arc.clickTheTroubleshootButton', "Click the troubleshoot button to open the Azure Arc {0} troubleshooting notebook.", resourceType); }
|
export function clickTheTroubleshootButton(resourceType: string): string { return localize('arc.clickTheTroubleshootButton', "Click the troubleshoot button to open the Azure Arc {0} troubleshooting notebook.", resourceType); }
|
||||||
|
|||||||
@@ -199,7 +199,16 @@ export class MiaaDashboardOverviewPage extends DashboardPage {
|
|||||||
deleteButton.enabled = false;
|
deleteButton.enabled = false;
|
||||||
try {
|
try {
|
||||||
if (await promptForInstanceDeletion(this._miaaModel.info.name)) {
|
if (await promptForInstanceDeletion(this._miaaModel.info.name)) {
|
||||||
await this._azdataApi.azdata.arc.sql.mi.delete(this._miaaModel.info.name);
|
await vscode.window.withProgress(
|
||||||
|
{
|
||||||
|
location: vscode.ProgressLocation.Notification,
|
||||||
|
title: loc.deletingInstance(this._miaaModel.info.name),
|
||||||
|
cancellable: false
|
||||||
|
},
|
||||||
|
(_progress, _token) => {
|
||||||
|
return this._azdataApi.azdata.arc.sql.mi.delete(this._miaaModel.info.name);
|
||||||
|
}
|
||||||
|
);
|
||||||
await this._controllerModel.refreshTreeNode();
|
await this._controllerModel.refreshTreeNode();
|
||||||
vscode.window.showInformationMessage(loc.instanceDeleted(this._miaaModel.info.name));
|
vscode.window.showInformationMessage(loc.instanceDeleted(this._miaaModel.info.name));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,7 +182,16 @@ export class PostgresOverviewPage extends DashboardPage {
|
|||||||
deleteButton.enabled = false;
|
deleteButton.enabled = false;
|
||||||
try {
|
try {
|
||||||
if (await promptForInstanceDeletion(this._postgresModel.info.name)) {
|
if (await promptForInstanceDeletion(this._postgresModel.info.name)) {
|
||||||
await this._azdataApi.azdata.arc.postgres.server.delete(this._postgresModel.info.name);
|
await vscode.window.withProgress(
|
||||||
|
{
|
||||||
|
location: vscode.ProgressLocation.Notification,
|
||||||
|
title: loc.deletingInstance(this._postgresModel.info.name),
|
||||||
|
cancellable: false
|
||||||
|
},
|
||||||
|
(_progress, _token) => {
|
||||||
|
return this._azdataApi.azdata.arc.postgres.server.delete(this._postgresModel.info.name);
|
||||||
|
}
|
||||||
|
);
|
||||||
await this._controllerModel.refreshTreeNode();
|
await this._controllerModel.refreshTreeNode();
|
||||||
vscode.window.showInformationMessage(loc.instanceDeleted(this._postgresModel.info.name));
|
vscode.window.showInformationMessage(loc.instanceDeleted(this._postgresModel.info.name));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user