Skip to content

Commit

Permalink
fix: support grafana 8.3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
German Yepes committed Feb 16, 2022
1 parent 32c373c commit ef6ba7b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion dist/datasource.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,17 @@ function (angular, _, dateMath, moment) {
console.log(options);

var _this = this;
var sets = _.groupBy(options.targets, 'datasource');
var promisesByRefId = {};
var promises = [];
var targetsByRefId = {};
var sets;

if (typeof (options.targets[0].datasource) === 'object') {
sets = _.groupBy(options.targets, target => target.datasource.uid);
} else {
sets = _.groupBy(options.targets, 'datasource');
}

_.forEach(sets, function (targets, dsName) {
// Grafana (8.x.x) sends datasource name as undefined with mixed plugin made as default datasource
// https://github.com/grafana/grafana/issues/36508
Expand Down
9 changes: 8 additions & 1 deletion src/datasource.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,17 @@ function (angular, _, dateMath, moment) {
console.log(options);

var _this = this;
var sets = _.groupBy(options.targets, 'datasource');
var promisesByRefId = {};
var promises = [];
var targetsByRefId = {};
var sets;

if (typeof (options.targets[0].datasource) === 'object') {
sets = _.groupBy(options.targets, target => target.datasource.uid);
} else {
sets = _.groupBy(options.targets, 'datasource');
}

_.forEach(sets, function (targets, dsName) {
// Grafana (8.x.x) sends datasource name as undefined with mixed plugin made as default datasource
// https://github.com/grafana/grafana/issues/36508
Expand Down

0 comments on commit ef6ba7b

Please sign in to comment.