|
@@ -12,10 +12,12 @@ import { getTimeSrv } from 'app/features/dashboard/services/TimeSrv';
|
|
|
// Types
|
|
// Types
|
|
|
import { PanelModel } from '../state/PanelModel';
|
|
import { PanelModel } from '../state/PanelModel';
|
|
|
import { DataQuery, DataSourceApi, TimeRange } from '@grafana/ui';
|
|
import { DataQuery, DataSourceApi, TimeRange } from '@grafana/ui';
|
|
|
|
|
+import { DashboardModel } from '../state/DashboardModel';
|
|
|
|
|
|
|
|
interface Props {
|
|
interface Props {
|
|
|
panel: PanelModel;
|
|
panel: PanelModel;
|
|
|
query: DataQuery;
|
|
query: DataQuery;
|
|
|
|
|
+ dashboard: DashboardModel;
|
|
|
onAddQuery: (query?: DataQuery) => void;
|
|
onAddQuery: (query?: DataQuery) => void;
|
|
|
onRemoveQuery: (query: DataQuery) => void;
|
|
onRemoveQuery: (query: DataQuery) => void;
|
|
|
onMoveQuery: (query: DataQuery, direction: number) => void;
|
|
onMoveQuery: (query: DataQuery, direction: number) => void;
|
|
@@ -83,13 +85,14 @@ export class QueryEditorRow extends PureComponent<Props, State> {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
getAngularQueryComponentScope(): AngularQueryComponentScope {
|
|
getAngularQueryComponentScope(): AngularQueryComponentScope {
|
|
|
- const { panel, query } = this.props;
|
|
|
|
|
|
|
+ const { panel, query, dashboard } = this.props;
|
|
|
const { datasource } = this.state;
|
|
const { datasource } = this.state;
|
|
|
|
|
|
|
|
return {
|
|
return {
|
|
|
datasource: datasource,
|
|
datasource: datasource,
|
|
|
target: query,
|
|
target: query,
|
|
|
panel: panel,
|
|
panel: panel,
|
|
|
|
|
+ dashboard: dashboard,
|
|
|
refresh: () => panel.refresh(),
|
|
refresh: () => panel.refresh(),
|
|
|
render: () => panel.render(),
|
|
render: () => panel.render(),
|
|
|
events: panel.events,
|
|
events: panel.events,
|
|
@@ -265,6 +268,7 @@ export class QueryEditorRow extends PureComponent<Props, State> {
|
|
|
export interface AngularQueryComponentScope {
|
|
export interface AngularQueryComponentScope {
|
|
|
target: DataQuery;
|
|
target: DataQuery;
|
|
|
panel: PanelModel;
|
|
panel: PanelModel;
|
|
|
|
|
+ dashboard: DashboardModel;
|
|
|
events: Emitter;
|
|
events: Emitter;
|
|
|
refresh: () => void;
|
|
refresh: () => void;
|
|
|
render: () => void;
|
|
render: () => void;
|