mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix: added events to MetricsTabCtrl to closer mimic MetricsPanelCtrl
This commit is contained in:
parent
1eecda48f8
commit
c0197bcb15
@ -5,6 +5,7 @@ import Remarkable from 'remarkable';
|
|||||||
// Services & utils
|
// Services & utils
|
||||||
import coreModule from 'app/core/core_module';
|
import coreModule from 'app/core/core_module';
|
||||||
import config from 'app/core/config';
|
import config from 'app/core/config';
|
||||||
|
import { Emitter } from 'app/core/utils/emitter';
|
||||||
|
|
||||||
// Types
|
// Types
|
||||||
import { DashboardModel } from '../dashboard/dashboard_model';
|
import { DashboardModel } from '../dashboard/dashboard_model';
|
||||||
@ -25,6 +26,7 @@ export class MetricsTabCtrl {
|
|||||||
hasQueryHelp: boolean;
|
hasQueryHelp: boolean;
|
||||||
helpHtml: string;
|
helpHtml: string;
|
||||||
queryOptions: any;
|
queryOptions: any;
|
||||||
|
events: Emitter;
|
||||||
|
|
||||||
/** @ngInject */
|
/** @ngInject */
|
||||||
constructor($scope, private $sce, datasourceSrv, private backendSrv) {
|
constructor($scope, private $sce, datasourceSrv, private backendSrv) {
|
||||||
@ -39,6 +41,10 @@ export class MetricsTabCtrl {
|
|||||||
this.datasources = datasourceSrv.getMetricSources();
|
this.datasources = datasourceSrv.getMetricSources();
|
||||||
this.panelDsValue = this.panelCtrl.panel.datasource;
|
this.panelDsValue = this.panelCtrl.panel.datasource;
|
||||||
|
|
||||||
|
// addded here as old query controller expects this on panelCtrl but
|
||||||
|
// they are getting MetricsTabCtrl instead
|
||||||
|
this.events = this.panel.events;
|
||||||
|
|
||||||
for (const ds of this.datasources) {
|
for (const ds of this.datasources) {
|
||||||
if (ds.value === this.panelDsValue) {
|
if (ds.value === this.panelDsValue) {
|
||||||
this.datasourceInstance = ds;
|
this.datasourceInstance = ds;
|
||||||
|
Loading…
Reference in New Issue
Block a user