mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Add troubleshoot button to arc controller/MIAA dashboard (#12534)
* Add troubleshoot button to arc controller dashboard * Add MIAA button * Fix links
This commit is contained in:
@@ -9,6 +9,9 @@ export const refreshActionId = 'arc.refresh';
|
||||
|
||||
export const credentialNamespace = 'arcCredentials';
|
||||
|
||||
export const controllerTroubleshootDocsUrl = 'https://aka.ms/arc-data-tsg';
|
||||
export const miaaTroubleshootDocsUrl = 'https://aka.ms/miaa-tsg';
|
||||
|
||||
export interface IconPath {
|
||||
dark: string;
|
||||
light: string;
|
||||
|
||||
@@ -8,7 +8,7 @@ import * as azdata from 'azdata';
|
||||
import * as azurecore from 'azurecore';
|
||||
import * as vscode from 'vscode';
|
||||
import { getConnectionModeDisplayText, getResourceTypeIcon, resourceTypeToDisplayName } from '../../../common/utils';
|
||||
import { cssStyles, Endpoints, IconPathHelper, iconSize } from '../../../constants';
|
||||
import { cssStyles, Endpoints, IconPathHelper, controllerTroubleshootDocsUrl, iconSize } from '../../../constants';
|
||||
import * as loc from '../../../localizedConstants';
|
||||
import { ControllerModel } from '../../../models/controllerModel';
|
||||
import { DashboardPage } from '../../components/dashboardPage';
|
||||
@@ -178,18 +178,30 @@ export class ControllerDashboardOverviewPage extends DashboardPage {
|
||||
this._openInAzurePortalButton.onDidClick(async () => {
|
||||
const config = this._controllerModel.controllerConfig;
|
||||
if (config) {
|
||||
vscode.env.openExternal(vscode.Uri.parse(
|
||||
await vscode.env.openExternal(vscode.Uri.parse(
|
||||
`https://portal.azure.com/#resource/subscriptions/${config.spec.settings.azure.subscription}/resourceGroups/${config.spec.settings.azure.resourceGroup}/providers/Microsoft.AzureData/${ResourceType.dataControllers}/${config.metadata.name}`));
|
||||
} else {
|
||||
vscode.window.showErrorMessage(loc.couldNotFindControllerRegistration);
|
||||
}
|
||||
}));
|
||||
|
||||
const troubleshootButton = this.modelView.modelBuilder.button().withProperties<azdata.ButtonProperties>({
|
||||
label: loc.troubleshoot,
|
||||
iconPath: IconPathHelper.wrench
|
||||
}).component();
|
||||
|
||||
this.disposables.push(
|
||||
troubleshootButton.onDidClick(async () => {
|
||||
await vscode.env.openExternal(vscode.Uri.parse(controllerTroubleshootDocsUrl));
|
||||
})
|
||||
);
|
||||
|
||||
return this.modelView.modelBuilder.toolbarContainer().withToolbarItems(
|
||||
[
|
||||
{ component: newInstance },
|
||||
{ component: refreshButton, toolbarSeparatorAfter: true },
|
||||
{ component: this._openInAzurePortalButton }
|
||||
{ component: this._openInAzurePortalButton, toolbarSeparatorAfter: true },
|
||||
{ component: troubleshootButton }
|
||||
]
|
||||
).component();
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import * as azdataExt from 'azdata-ext';
|
||||
import * as azurecore from 'azurecore';
|
||||
import * as vscode from 'vscode';
|
||||
import { getDatabaseStateDisplayText, promptForInstanceDeletion } from '../../../common/utils';
|
||||
import { cssStyles, Endpoints, IconPathHelper } from '../../../constants';
|
||||
import { cssStyles, Endpoints, IconPathHelper, miaaTroubleshootDocsUrl } from '../../../constants';
|
||||
import * as loc from '../../../localizedConstants';
|
||||
import { ControllerModel } from '../../../models/controllerModel';
|
||||
import { MiaaModel } from '../../../models/miaaModel';
|
||||
@@ -257,6 +257,17 @@ export class MiaaDashboardOverviewPage extends DashboardPage {
|
||||
}
|
||||
}));
|
||||
|
||||
const troubleshootButton = this.modelView.modelBuilder.button().withProperties<azdata.ButtonProperties>({
|
||||
label: loc.troubleshoot,
|
||||
iconPath: IconPathHelper.wrench
|
||||
}).component();
|
||||
|
||||
this.disposables.push(
|
||||
troubleshootButton.onDidClick(async () => {
|
||||
await vscode.env.openExternal(vscode.Uri.parse(miaaTroubleshootDocsUrl));
|
||||
})
|
||||
);
|
||||
|
||||
return this.modelView.modelBuilder.toolbarContainer().withToolbarItems(
|
||||
[
|
||||
{ component: deleteButton },
|
||||
|
||||
Reference in New Issue
Block a user