|
|
@@ -19,6 +19,7 @@ import { profiler } from 'app/core/profiler';
|
|
|
import { DashboardModel, PanelModel } from '../state';
|
|
|
import { PanelPlugin } from 'app/types';
|
|
|
import { DataQueryResponse, TimeRange, LoadingState, PanelData, DataQueryError } from '@grafana/ui';
|
|
|
+import { ScopedVars } from '@grafana/ui';
|
|
|
|
|
|
import variables from 'sass/_variables.generated.scss';
|
|
|
import templateSrv from 'app/features/templating/template_srv';
|
|
|
@@ -85,8 +86,13 @@ export class PanelChrome extends PureComponent<Props, State> {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- replaceVariables = (value: string, format?: string) => {
|
|
|
- return templateSrv.replace(value, this.props.panel.scopedVars, format);
|
|
|
+ replaceVariables = (value: string, extraVars?: ScopedVars, format?: string) => {
|
|
|
+ let vars = this.props.panel.scopedVars;
|
|
|
+ if (extraVars) {
|
|
|
+ vars = vars ? { ...vars, ...extraVars } : extraVars;
|
|
|
+ }
|
|
|
+ console.log('VARiables', vars);
|
|
|
+ return templateSrv.replace(value, vars, format);
|
|
|
};
|
|
|
|
|
|
onDataResponse = (dataQueryResponse: DataQueryResponse) => {
|