mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix derivequeries
This commit is contained in:
parent
6203ef6cb2
commit
ad69ccc07f
@ -19,7 +19,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('kibana.derivequeries', [])
|
angular.module('kibana.derivequeries', [])
|
||||||
.controller('derivequeries', function($scope, $rootScope, query, fields, dashboard, filterSrv) {
|
.controller('derivequeries', function($scope, $rootScope, querySrv, fields, dashboard, filterSrv) {
|
||||||
|
|
||||||
// Set and populate defaults
|
// Set and populate defaults
|
||||||
var _d = {
|
var _d = {
|
||||||
@ -87,15 +87,15 @@ angular.module('kibana.derivequeries', [])
|
|||||||
_.each(results.facets.query.terms, function(v) {
|
_.each(results.facets.query.terms, function(v) {
|
||||||
var _q = $scope.panel.field+':"'+v.term+'"'+suffix;
|
var _q = $scope.panel.field+':"'+v.term+'"'+suffix;
|
||||||
// if it isn't in the list, remove it
|
// if it isn't in the list, remove it
|
||||||
var _iq = query.findQuery(_q);
|
var _iq = querySrv.findQuery(_q);
|
||||||
if(!_iq) {
|
if(!_iq) {
|
||||||
ids.push(query.set({query:_q}));
|
ids.push(querySrv.set({query:_q}));
|
||||||
} else {
|
} else {
|
||||||
ids.push(_iq.id);
|
ids.push(_iq.id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
_.each(_.difference($scope.panel.ids,ids),function(id){
|
_.each(_.difference($scope.panel.ids,ids),function(id){
|
||||||
query.remove(id);
|
querySrv.remove(id);
|
||||||
});
|
});
|
||||||
$scope.panel.ids = ids;
|
$scope.panel.ids = ids;
|
||||||
dashboard.refresh();
|
dashboard.refresh();
|
||||||
|
Loading…
Reference in New Issue
Block a user