mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Azure: Fixes annotations query editor not working properly (#37476)
This commit is contained in:
parent
c2247f51e6
commit
0965132bff
@ -2,15 +2,20 @@ import { getTemplateSrv, TemplateSrv } from '@grafana/runtime';
|
|||||||
|
|
||||||
export class AzureMonitorAnnotationsQueryCtrl {
|
export class AzureMonitorAnnotationsQueryCtrl {
|
||||||
static templateUrl = 'partials/annotations.editor.html';
|
static templateUrl = 'partials/annotations.editor.html';
|
||||||
datasource: any;
|
declare datasource: any;
|
||||||
annotation: any;
|
declare annotation: any;
|
||||||
declare workspaces: any[];
|
declare workspaces: any[];
|
||||||
declare subscriptions: Array<{ text: string; value: string }>;
|
declare subscriptions: Array<{ text: string; value: string }>;
|
||||||
|
private templateSrv: TemplateSrv = getTemplateSrv();
|
||||||
|
|
||||||
defaultQuery =
|
defaultQuery =
|
||||||
'<your table>\n| where $__timeFilter() \n| project TimeGenerated, Text=YourTitleColumn, Tags="tag1,tag2"';
|
'<your table>\n| where $__timeFilter() \n| project TimeGenerated, Text=YourTitleColumn, Tags="tag1,tag2"';
|
||||||
|
|
||||||
constructor(private templateSrv: TemplateSrv = getTemplateSrv()) {
|
/** @ngInject */
|
||||||
|
constructor($scope: any) {
|
||||||
|
this.annotation = $scope.ctrl.annotation;
|
||||||
|
this.datasource = $scope.ctrl.datasource;
|
||||||
|
|
||||||
this.annotation.queryType = this.annotation.queryType || 'Azure Log Analytics';
|
this.annotation.queryType = this.annotation.queryType || 'Azure Log Analytics';
|
||||||
this.annotation.rawQuery = this.annotation.rawQuery || this.defaultQuery;
|
this.annotation.rawQuery = this.annotation.rawQuery || this.defaultQuery;
|
||||||
this.initDropdowns();
|
this.initDropdowns();
|
||||||
|
Loading…
Reference in New Issue
Block a user