mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-26 09:35:38 -05:00
Add Azure Monitor Extension (#15397)
* Added Azure Log Analytics resource for generating AAD Token. * Fixed AzureResource * Removed debug code from connectionManagementService * Moved AzureLogAnalytics from AzureResource enum in azdata.d.ts to azdata.proposed.d.ts. Added azureLogAnalyticsResource to all azureSettings in providerSettings.ts * Updated endpoint for generating AAD Token for LogAnalytics for UsGov, UsNat, and China * Initial Commit of Azure Monitor Extension * Added extension name to azuremonitor package strings * Removed azureMonitor resource from germanyCloud in providerSettings * Added logic to exclude menuItems in object explorer for LogAnalytics * Changed exe from AzureMonitor to Kusto * Added if clause for queryName for new queries * Changed queryWindow name from KustoQuery to KQLQuery for Kusto and LogAnalytics. * Added LogAnalytics for setTaskBarContent * Added serialization and telemetry feature classes to AzureMonitor. Added references for azdata and vscode. * Added azure monitor light and dark icons * Added config for Dashboard in package.json * Added workspace information to dashboard * Added language support for LogAnalytics * Added Notebook support * Added Hide flag to package.json for databaseName * Changed providerId from LogAnalytics to LOGANALYTICS * Changed Workspace to Workspace ID in package.nls.json * Added support for Azure Widget browser * Changed fullName to use workspaceId when connecting * Changed providerId from alertsManagement to azureMonitor * Added .gitignore and *.vsix to vscodeignore. * Removed unused devDependencies * Code Review Feedback * Changed tsconfig.json to match Kusto and Sql * Changed package.json to match kusto package. * Changed tsconfig to validate unused params and implictAny. Changed existing code to satisfy build. * Fixed tsconfig to use the correct base class. * Added objectExplorerNodeProvider and all related classes. * Removed unused tmLanguage file * Added logic to to download extension from toolservice * Fixed launchArgs. Removed commented code from extension.ts. Changed config.json to use net5.0 * Added displayName to package.nls.json. Removed hide flag from databaseName. Other code review feedback. * Added readme info to AzureMonitor * Removed unused client-error-handler and ui-references files. Combined outputChannel in azuremonitorServer. Removed TODO from contextProvider. Renamed function in extension.ts. Removed unneeded 'use strict' from cancelableStream.ts. Removed second outputChannel from objectExplorerNodeProvider. * Removed unused files
This commit is contained in:
@@ -61,8 +61,10 @@ export class BreadcrumbService implements IBreadcrumbService {
|
||||
}
|
||||
|
||||
private getDbBreadcrumb(profile: ConnectionProfile): MenuItem {
|
||||
let defaultDatabaseName = profile.providerName === 'LOGANALYTICS' ? 'workspace-name' : 'database-name';
|
||||
|
||||
return {
|
||||
label: profile.databaseName ? profile.databaseName : 'database-name',
|
||||
label: profile.databaseName ? profile.databaseName : defaultDatabaseName,
|
||||
routerLink: ['database-dashboard']
|
||||
};
|
||||
}
|
||||
|
||||
@@ -287,6 +287,20 @@ export class QueryEditor extends EditorPane {
|
||||
{ action: this._listDatabasesAction }
|
||||
];
|
||||
}
|
||||
else if (providerId === 'LOGANALYTICS' || this.modeService.getExtensions('LogAnalytics').indexOf(fileExtension) > -1) {
|
||||
if (this.input instanceof UntitledQueryEditorInput) {
|
||||
this.input.setMode('loganalytics');
|
||||
}
|
||||
|
||||
content = [
|
||||
{ action: this._runQueryAction },
|
||||
{ action: this._cancelQueryAction },
|
||||
{ element: separator },
|
||||
{ action: this._toggleConnectDatabaseAction },
|
||||
{ action: this._changeConnectionAction },
|
||||
{ action: this._listDatabasesAction }
|
||||
];
|
||||
}
|
||||
else {
|
||||
if (previewFeaturesEnabled) {
|
||||
content = [
|
||||
|
||||
@@ -28,7 +28,7 @@ const editorInputFactoryRegistry = Registry.as<IEditorInputFactoryRegistry>(Edit
|
||||
|
||||
export class QueryEditorLanguageAssociation implements ILanguageAssociation {
|
||||
static readonly isDefault = true;
|
||||
static readonly languages = ['sql', 'kusto']; //TODO Add language id here for new languages supported in query editor. Make it easier to contribute new extension's languageID
|
||||
static readonly languages = ['sql', 'kusto', 'loganalytics']; //TODO Add language id here for new languages supported in query editor. Make it easier to contribute new extension's languageID
|
||||
|
||||
|
||||
constructor(@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
|
||||
@@ -101,6 +101,7 @@ MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, {
|
||||
},
|
||||
when: ContextKeyExpr.and(
|
||||
ConnectionContextKey.Provider.notEqualsTo('KUSTO'),
|
||||
ConnectionContextKey.Provider.notEqualsTo('LOGANALYTICS'),
|
||||
ContextKeyExpr.or(
|
||||
TreeNodeContextKey.NodeType.isEqualTo('Table'),
|
||||
TreeNodeContextKey.NodeType.isEqualTo('View')
|
||||
@@ -115,10 +116,9 @@ MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, {
|
||||
id: commands.OE_SCRIPT_AS_SELECT_COMMAND_ID,
|
||||
title: localize('scriptKustoSelect', "Take 10")
|
||||
},
|
||||
when: ContextKeyExpr.and(
|
||||
ConnectionContextKey.Provider.isEqualTo('KUSTO'),
|
||||
TreeNodeContextKey.NodeType.isEqualTo('Table')
|
||||
)
|
||||
when: ContextKeyExpr.or(
|
||||
ContextKeyExpr.and(ConnectionContextKey.Provider.isEqualTo('KUSTO'), TreeNodeContextKey.NodeType.isEqualTo('Table')),
|
||||
ContextKeyExpr.and(ConnectionContextKey.Provider.isEqualTo('LOGANALYTICS'), TreeNodeContextKey.NodeType.isEqualTo('Table')))
|
||||
});
|
||||
|
||||
MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, {
|
||||
@@ -132,6 +132,7 @@ MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, {
|
||||
ContextKeyExpr.and(
|
||||
TreeNodeContextKey.NodeType.isEqualTo('Table'),
|
||||
ConnectionContextKey.Provider.notEqualsTo('KUSTO'),
|
||||
ConnectionContextKey.Provider.notEqualsTo('LOGANALYTICS'),
|
||||
MssqlNodeContext.EngineEdition.notEqualsTo(DatabaseEngineEdition.SqlOnDemand.toString()),
|
||||
MssqlNodeContext.EngineEdition.notEqualsTo(DatabaseEngineEdition.SqlDataWarehouse.toString())
|
||||
)
|
||||
@@ -147,6 +148,7 @@ MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, {
|
||||
when:
|
||||
ContextKeyExpr.and(
|
||||
ConnectionContextKey.Provider.notEqualsTo('KUSTO'),
|
||||
ConnectionContextKey.Provider.notEqualsTo('LOGANALYTICS'),
|
||||
ContextKeyExpr.or(
|
||||
TreeNodeContextKey.NodeType.isEqualTo('Table'),
|
||||
TreeNodeContextKey.NodeType.isEqualTo('View'),
|
||||
@@ -218,6 +220,7 @@ MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, {
|
||||
when:
|
||||
ContextKeyExpr.and(
|
||||
ConnectionContextKey.Provider.notEqualsTo('KUSTO'),
|
||||
ConnectionContextKey.Provider.notEqualsTo('LOGANALYTICS'),
|
||||
ContextKeyExpr.or(
|
||||
TreeNodeContextKey.NodeType.isEqualTo(NodeType.Table),
|
||||
TreeNodeContextKey.NodeType.isEqualTo(NodeType.View),
|
||||
|
||||
@@ -101,8 +101,8 @@ export class QueryEditorService implements IQueryEditorService {
|
||||
|
||||
////// Private functions
|
||||
private createUntitledSqlFilePath(providerName?: string): Promise<string> {
|
||||
if (providerName === 'KUSTO') {
|
||||
return this.createPrefixedSqlFilePath(providerName + 'Query');
|
||||
if (providerName === 'LOGANALYTICS' || providerName === 'KUSTO') {
|
||||
return this.createPrefixedSqlFilePath('KQLQuery');
|
||||
}
|
||||
|
||||
return this.createPrefixedSqlFilePath('SQLQuery');
|
||||
|
||||
Reference in New Issue
Block a user