mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-18 19:11:36 -04:00
Nasc/delete instance code removal (#12307)
* Formatted page * Removed ResourceHealthPage from the dashboard * Deleted files that no longer applies to the public preview backend * shouldn't be able to open the postgres dashboard
This commit is contained in:
@@ -5,12 +5,13 @@
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as azdata from 'azdata';
|
||||
import * as azdataExt from 'azdata-ext';
|
||||
import * as loc from '../../../localizedConstants';
|
||||
import { IconPathHelper, cssStyles, Endpoints } from '../../../constants';
|
||||
import { DashboardPage } from '../../components/dashboardPage';
|
||||
import { ControllerModel } from '../../../models/controllerModel';
|
||||
import { PostgresModel } from '../../../models/postgresModel';
|
||||
import { promptAndConfirmPassword } from '../../../common/utils';
|
||||
import { promptAndConfirmPassword, promptForResourceDeletion } from '../../../common/utils';
|
||||
|
||||
export class PostgresOverviewPage extends DashboardPage {
|
||||
|
||||
@@ -22,8 +23,11 @@ export class PostgresOverviewPage extends DashboardPage {
|
||||
private kibanaLink?: azdata.HyperlinkComponent;
|
||||
private grafanaLink?: azdata.HyperlinkComponent;
|
||||
|
||||
private readonly _azdataApi: azdataExt.IExtension;
|
||||
|
||||
constructor(protected modelView: azdata.ModelView, private _controllerModel: ControllerModel, private _postgresModel: PostgresModel) {
|
||||
super(modelView);
|
||||
this._azdataApi = vscode.extensions.getExtension(azdataExt.extension.name)?.exports;
|
||||
|
||||
this.disposables.push(
|
||||
this._controllerModel.onEndpointsUpdated(() => this.eventuallyRunOnInitialized(() => this.handleEndpointsUpdated())),
|
||||
@@ -170,13 +174,11 @@ export class PostgresOverviewPage extends DashboardPage {
|
||||
deleteButton.onDidClick(async () => {
|
||||
deleteButton.enabled = false;
|
||||
try {
|
||||
/*
|
||||
if (await promptForResourceDeletion(this._postgresModel.namespace, this._postgresModel.name)) {
|
||||
await this._postgresModel.delete();
|
||||
await this._controllerModel.deleteRegistration(ResourceType.postgresInstances, this._postgresModel.namespace, this._postgresModel.name);
|
||||
vscode.window.showInformationMessage(loc.resourceDeleted(this._postgresModel.fullName));
|
||||
if (await promptForResourceDeletion(this._postgresModel.info.name)) {
|
||||
await this._azdataApi.azdata.arc.postgres.server.delete(this._postgresModel.info.name);
|
||||
await this._controllerModel.refreshTreeNode();
|
||||
vscode.window.showInformationMessage(loc.resourceDeleted(this._postgresModel.info.name));
|
||||
}
|
||||
*/
|
||||
} catch (error) {
|
||||
vscode.window.showErrorMessage(loc.resourceDeletionFailed(this._postgresModel.info.name, error));
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user