mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Dashboard: Run requests with correct app type (#60010)
Dashboard: Run quries with correct core app
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
||||
urlUtil,
|
||||
PanelModel as IPanelModel,
|
||||
DataSourceRef,
|
||||
CoreApp,
|
||||
} from '@grafana/data';
|
||||
import { getTemplateSrv, RefreshEvent } from '@grafana/runtime';
|
||||
import config from 'app/core/config';
|
||||
@@ -366,6 +367,7 @@ export class PanelModel implements DataConfigSource, IPanelModel {
|
||||
scopedVars: this.scopedVars,
|
||||
cacheTimeout: this.cacheTimeout,
|
||||
transformations: this.transformations,
|
||||
app: this.isEditing ? CoreApp.PanelEditor : this.isViewing ? CoreApp.PanelViewer : CoreApp.Dashboard,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ export interface QueryRunnerOptions<
|
||||
scopedVars?: ScopedVars;
|
||||
cacheTimeout?: string | null;
|
||||
transformations?: DataTransformerConfig[];
|
||||
app?: CoreApp;
|
||||
}
|
||||
|
||||
let counter = 100;
|
||||
@@ -213,6 +214,7 @@ export class PanelQueryRunner {
|
||||
maxDataPoints,
|
||||
scopedVars,
|
||||
minInterval,
|
||||
app,
|
||||
} = options;
|
||||
|
||||
if (isSharedDashboardQuery(datasource)) {
|
||||
@@ -221,7 +223,7 @@ export class PanelQueryRunner {
|
||||
}
|
||||
|
||||
const request: DataQueryRequest = {
|
||||
app: CoreApp.Dashboard,
|
||||
app: app ?? CoreApp.Dashboard,
|
||||
requestId: getNextRequestId(),
|
||||
timezone,
|
||||
panelId,
|
||||
|
||||
Reference in New Issue
Block a user