mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-09 17:52:34 -05:00
MIAA Dashboard Updates (#10960)
* Add database info to MIAA dashboard * hook up open in azure button * Only use plural text
This commit is contained in:
@@ -160,7 +160,7 @@ export class ControllerDashboardOverviewPage extends DashboardPage {
|
||||
vscode.env.openExternal(vscode.Uri.parse(
|
||||
`https://portal.azure.com/#resource/subscriptions/${r.subscriptionId}/resourceGroups/${r.resourceGroupName}/providers/Microsoft.AzureData/${ResourceType.dataControllers}/${r.instanceName}`));
|
||||
} else {
|
||||
vscode.window.showErrorMessage(loc.couldNotFindControllerResource);
|
||||
vscode.window.showErrorMessage(loc.couldNotFindRegistration(this._controllerModel.namespace, 'controller'));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import * as loc from '../../../localizedConstants';
|
||||
import { DashboardPage } from '../../components/dashboardPage';
|
||||
import { IconPathHelper, cssStyles, ResourceType } from '../../../constants';
|
||||
@@ -33,7 +34,7 @@ export class MiaaDashboardOverviewPage extends DashboardPage {
|
||||
subscriptionId: '-',
|
||||
miaaAdmin: '-',
|
||||
host: '-',
|
||||
computeAndStorage: '-'
|
||||
vCores: '-'
|
||||
};
|
||||
|
||||
constructor(modelView: azdata.ModelView, private _controllerModel: ControllerModel, private _miaaModel: MiaaModel) {
|
||||
@@ -157,7 +158,6 @@ export class MiaaDashboardOverviewPage extends DashboardPage {
|
||||
}).component();
|
||||
|
||||
this._databasesTableLoading = this.modelView.modelBuilder.loadingComponent().withItem(this._databasesTable).component();
|
||||
this._databasesTableLoading.loading = false;
|
||||
rootContainer.addItem(this._databasesTableLoading, { CSSStyles: { 'margin-bottom': '20px' } });
|
||||
|
||||
this.initialized = true;
|
||||
@@ -166,8 +166,8 @@ export class MiaaDashboardOverviewPage extends DashboardPage {
|
||||
|
||||
public get toolbarContainer(): azdata.ToolbarContainer {
|
||||
|
||||
const createNewButton = this.modelView.modelBuilder.button().withProperties<azdata.ButtonProperties>({
|
||||
label: loc.createNew,
|
||||
const createDatabaseButton = this.modelView.modelBuilder.button().withProperties<azdata.ButtonProperties>({
|
||||
label: loc.newDatabase,
|
||||
iconPath: IconPathHelper.add
|
||||
}).component();
|
||||
|
||||
@@ -186,9 +186,19 @@ export class MiaaDashboardOverviewPage extends DashboardPage {
|
||||
iconPath: IconPathHelper.openInTab
|
||||
}).component();
|
||||
|
||||
openInAzurePortalButton.onDidClick(async () => {
|
||||
const r = this._controllerModel.getRegistration(ResourceType.sqlManagedInstances, this._miaaModel.namespace, this._miaaModel.name);
|
||||
if (r) {
|
||||
vscode.env.openExternal(vscode.Uri.parse(
|
||||
`https://portal.azure.com/#resource/subscriptions/${r.subscriptionId}/resourceGroups/${r.resourceGroupName}/providers/Microsoft.AzureData/${ResourceType.sqlManagedInstances}/${r.instanceName}`));
|
||||
} else {
|
||||
vscode.window.showErrorMessage(loc.couldNotFindRegistration(this._miaaModel.namespace, this._miaaModel.name));
|
||||
}
|
||||
});
|
||||
|
||||
return this.modelView.modelBuilder.toolbarContainer().withToolbarItems(
|
||||
[
|
||||
{ component: createNewButton },
|
||||
{ component: createDatabaseButton },
|
||||
{ component: deleteButton },
|
||||
{ component: resetPasswordButton, toolbarSeparatorAfter: true },
|
||||
{ component: openInAzurePortalButton }
|
||||
@@ -203,7 +213,7 @@ export class MiaaDashboardOverviewPage extends DashboardPage {
|
||||
this._instanceProperties.dataController = this._controllerModel.controllerRegistration?.instanceName || '-';
|
||||
this._instanceProperties.region = (await getAzurecoreApi()).getRegionDisplayName(reg.location);
|
||||
this._instanceProperties.subscriptionId = reg.subscriptionId || '-';
|
||||
this._instanceProperties.computeAndStorage = reg.vCores || '-';
|
||||
this._instanceProperties.vCores = reg.vCores || '-';
|
||||
this._instanceProperties.host = reg.externalEndpoint || '-';
|
||||
this.refreshDisplayedProperties();
|
||||
}
|
||||
@@ -264,8 +274,8 @@ export class MiaaDashboardOverviewPage extends DashboardPage {
|
||||
value: this._instanceProperties.host
|
||||
},
|
||||
{
|
||||
displayName: loc.computeAndStorage,
|
||||
value: this._instanceProperties.computeAndStorage
|
||||
displayName: loc.compute,
|
||||
value: loc.numVCores(this._instanceProperties.vCores)
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user