Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support grafana 8.3.x #141

Merged
merged 1 commit into from
Feb 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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