mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05: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:
@@ -1,31 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------------------------
|
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
||||||
*--------------------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
import * as azdata from 'azdata';
|
|
||||||
import * as loc from '../../../localizedConstants';
|
|
||||||
import { IconPathHelper } from '../../../constants';
|
|
||||||
import { DashboardPage } from '../../components/dashboardPage';
|
|
||||||
|
|
||||||
export class PostgresBackupPage extends DashboardPage {
|
|
||||||
protected get title(): string {
|
|
||||||
return loc.backup;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected get id(): string {
|
|
||||||
return 'postgres-backup';
|
|
||||||
}
|
|
||||||
|
|
||||||
protected get icon(): { dark: string; light: string; } {
|
|
||||||
return IconPathHelper.backup;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected get container(): azdata.Component {
|
|
||||||
return this.modelView.modelBuilder.text().withProperties<azdata.TextComponentProperties>({ value: loc.backup }).component();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected get toolbarContainer(): azdata.ToolbarContainer {
|
|
||||||
return this.modelView.modelBuilder.toolbarContainer().component();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------------------------
|
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
||||||
*--------------------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
import * as azdata from 'azdata';
|
|
||||||
import * as loc from '../../../localizedConstants';
|
|
||||||
import { IconPathHelper } from '../../../constants';
|
|
||||||
import { DashboardPage } from '../../components/dashboardPage';
|
|
||||||
|
|
||||||
export class PostgresComputeStoragePage extends DashboardPage {
|
|
||||||
protected get title(): string {
|
|
||||||
return loc.computeAndStorage;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected get id(): string {
|
|
||||||
return 'postgres-compute-storage';
|
|
||||||
}
|
|
||||||
|
|
||||||
protected get icon(): { dark: string; light: string; } {
|
|
||||||
return IconPathHelper.computeStorage;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected get container(): azdata.Component {
|
|
||||||
return this.modelView.modelBuilder.text().withProperties<azdata.TextComponentProperties>({ value: loc.computeAndStorage }).component();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected get toolbarContainer(): azdata.ToolbarContainer {
|
|
||||||
return this.modelView.modelBuilder.toolbarContainer().component();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------------------------
|
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
||||||
*--------------------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
import * as azdata from 'azdata';
|
|
||||||
import * as loc from '../../../localizedConstants';
|
|
||||||
import { IconPathHelper } from '../../../constants';
|
|
||||||
import { DashboardPage } from '../../components/dashboardPage';
|
|
||||||
|
|
||||||
export class PostgresNetworkingPage extends DashboardPage {
|
|
||||||
protected get title(): string {
|
|
||||||
return loc.networking;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected get id(): string {
|
|
||||||
return 'postgres-networking';
|
|
||||||
}
|
|
||||||
|
|
||||||
protected get icon(): { dark: string; light: string; } {
|
|
||||||
return IconPathHelper.networking;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected get container(): azdata.Component {
|
|
||||||
return this.modelView.modelBuilder.text().withProperties<azdata.TextComponentProperties>({ value: loc.networking }).component();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected get toolbarContainer(): azdata.ToolbarContainer {
|
|
||||||
return this.modelView.modelBuilder.toolbarContainer().component();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,12 +5,13 @@
|
|||||||
|
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import * as azdata from 'azdata';
|
import * as azdata from 'azdata';
|
||||||
|
import * as azdataExt from 'azdata-ext';
|
||||||
import * as loc from '../../../localizedConstants';
|
import * as loc from '../../../localizedConstants';
|
||||||
import { IconPathHelper, cssStyles, Endpoints } from '../../../constants';
|
import { IconPathHelper, cssStyles, Endpoints } from '../../../constants';
|
||||||
import { DashboardPage } from '../../components/dashboardPage';
|
import { DashboardPage } from '../../components/dashboardPage';
|
||||||
import { ControllerModel } from '../../../models/controllerModel';
|
import { ControllerModel } from '../../../models/controllerModel';
|
||||||
import { PostgresModel } from '../../../models/postgresModel';
|
import { PostgresModel } from '../../../models/postgresModel';
|
||||||
import { promptAndConfirmPassword } from '../../../common/utils';
|
import { promptAndConfirmPassword, promptForResourceDeletion } from '../../../common/utils';
|
||||||
|
|
||||||
export class PostgresOverviewPage extends DashboardPage {
|
export class PostgresOverviewPage extends DashboardPage {
|
||||||
|
|
||||||
@@ -22,8 +23,11 @@ export class PostgresOverviewPage extends DashboardPage {
|
|||||||
private kibanaLink?: azdata.HyperlinkComponent;
|
private kibanaLink?: azdata.HyperlinkComponent;
|
||||||
private grafanaLink?: azdata.HyperlinkComponent;
|
private grafanaLink?: azdata.HyperlinkComponent;
|
||||||
|
|
||||||
|
private readonly _azdataApi: azdataExt.IExtension;
|
||||||
|
|
||||||
constructor(protected modelView: azdata.ModelView, private _controllerModel: ControllerModel, private _postgresModel: PostgresModel) {
|
constructor(protected modelView: azdata.ModelView, private _controllerModel: ControllerModel, private _postgresModel: PostgresModel) {
|
||||||
super(modelView);
|
super(modelView);
|
||||||
|
this._azdataApi = vscode.extensions.getExtension(azdataExt.extension.name)?.exports;
|
||||||
|
|
||||||
this.disposables.push(
|
this.disposables.push(
|
||||||
this._controllerModel.onEndpointsUpdated(() => this.eventuallyRunOnInitialized(() => this.handleEndpointsUpdated())),
|
this._controllerModel.onEndpointsUpdated(() => this.eventuallyRunOnInitialized(() => this.handleEndpointsUpdated())),
|
||||||
@@ -170,13 +174,11 @@ export class PostgresOverviewPage extends DashboardPage {
|
|||||||
deleteButton.onDidClick(async () => {
|
deleteButton.onDidClick(async () => {
|
||||||
deleteButton.enabled = false;
|
deleteButton.enabled = false;
|
||||||
try {
|
try {
|
||||||
/*
|
if (await promptForResourceDeletion(this._postgresModel.info.name)) {
|
||||||
if (await promptForResourceDeletion(this._postgresModel.namespace, this._postgresModel.name)) {
|
await this._azdataApi.azdata.arc.postgres.server.delete(this._postgresModel.info.name);
|
||||||
await this._postgresModel.delete();
|
await this._controllerModel.refreshTreeNode();
|
||||||
await this._controllerModel.deleteRegistration(ResourceType.postgresInstances, this._postgresModel.namespace, this._postgresModel.name);
|
vscode.window.showInformationMessage(loc.resourceDeleted(this._postgresModel.info.name));
|
||||||
vscode.window.showInformationMessage(loc.resourceDeleted(this._postgresModel.fullName));
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
vscode.window.showErrorMessage(loc.resourceDeletionFailed(this._postgresModel.info.name, error));
|
vscode.window.showErrorMessage(loc.resourceDeletionFailed(this._postgresModel.info.name, error));
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -78,6 +78,9 @@ export class AzdataTool implements IAzdataTool {
|
|||||||
},
|
},
|
||||||
postgres: {
|
postgres: {
|
||||||
server: {
|
server: {
|
||||||
|
delete: async (name: string) => {
|
||||||
|
return this.executeCommand<void>(['arc', 'postgres', 'server', 'delete', '-n', name]);
|
||||||
|
},
|
||||||
list: async () => {
|
list: async () => {
|
||||||
return this.executeCommand<azdataExt.PostgresServerListResult[]>(['arc', 'postgres', 'server', 'list']);
|
return this.executeCommand<azdataExt.PostgresServerListResult[]>(['arc', 'postgres', 'server', 'list']);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -85,6 +85,10 @@ export async function activate(context: vscode.ExtensionContext): Promise<azdata
|
|||||||
},
|
},
|
||||||
postgres: {
|
postgres: {
|
||||||
server: {
|
server: {
|
||||||
|
delete: async (name: string) => {
|
||||||
|
await throwIfNoAzdataOrEulaNotAccepted();
|
||||||
|
return localAzdata!.arc.postgres.server.delete(name);
|
||||||
|
},
|
||||||
list: async () => {
|
list: async () => {
|
||||||
await throwIfNoAzdataOrEulaNotAccepted();
|
await throwIfNoAzdataOrEulaNotAccepted();
|
||||||
return localAzdata!.arc.postgres.server.list();
|
return localAzdata!.arc.postgres.server.list();
|
||||||
|
|||||||
@@ -228,6 +228,7 @@ declare module 'azdata-ext' {
|
|||||||
},
|
},
|
||||||
postgres: {
|
postgres: {
|
||||||
server: {
|
server: {
|
||||||
|
delete(name: string): Promise<AzdataOutput<void>>,
|
||||||
list(): Promise<AzdataOutput<PostgresServerListResult[]>>,
|
list(): Promise<AzdataOutput<PostgresServerListResult[]>>,
|
||||||
show(name: string): Promise<AzdataOutput<PostgresServerShowResult>>,
|
show(name: string): Promise<AzdataOutput<PostgresServerShowResult>>,
|
||||||
edit(args: {
|
edit(args: {
|
||||||
|
|||||||
Reference in New Issue
Block a user