mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
changing callback fn into arrow functions for correct usage of this (#12673)
This commit is contained in:
parent
a17a9218da
commit
6b071054a3
@ -480,17 +480,17 @@ export default class OpenTsDatasource {
|
|||||||
|
|
||||||
mapMetricsToTargets(metrics, options, tsdbVersion) {
|
mapMetricsToTargets(metrics, options, tsdbVersion) {
|
||||||
var interpolatedTagValue, arrTagV;
|
var interpolatedTagValue, arrTagV;
|
||||||
return _.map(metrics, function(metricData) {
|
return _.map(metrics, metricData => {
|
||||||
if (tsdbVersion === 3) {
|
if (tsdbVersion === 3) {
|
||||||
return metricData.query.index;
|
return metricData.query.index;
|
||||||
} else {
|
} else {
|
||||||
return _.findIndex(options.targets, function(target) {
|
return _.findIndex(options.targets, target => {
|
||||||
if (target.filters && target.filters.length > 0) {
|
if (target.filters && target.filters.length > 0) {
|
||||||
return target.metric === metricData.metric;
|
return target.metric === metricData.metric;
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
target.metric === metricData.metric &&
|
target.metric === metricData.metric &&
|
||||||
_.every(target.tags, function(tagV, tagK) {
|
_.every(target.tags, (tagV, tagK) => {
|
||||||
interpolatedTagValue = this.templateSrv.replace(tagV, options.scopedVars, 'pipe');
|
interpolatedTagValue = this.templateSrv.replace(tagV, options.scopedVars, 'pipe');
|
||||||
arrTagV = interpolatedTagValue.split('|');
|
arrTagV = interpolatedTagValue.split('|');
|
||||||
return _.includes(arrTagV, metricData.tags[tagK]) || interpolatedTagValue === '*';
|
return _.includes(arrTagV, metricData.tags[tagK]) || interpolatedTagValue === '*';
|
||||||
|
Loading…
Reference in New Issue
Block a user