kibana-sinatra 3.0.0.0 → 3.0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -3
  3. data/lib/kibana/assets/app/components/extend-jquery.js +1 -1
  4. data/lib/kibana/assets/app/components/kbn.js +1 -1
  5. data/lib/kibana/assets/app/components/lodash.extended.js +1 -1
  6. data/lib/kibana/assets/app/components/require.config.js +1 -0
  7. data/lib/kibana/assets/app/controllers/all.js +1 -1
  8. data/lib/kibana/assets/app/controllers/dash.js +1 -1
  9. data/lib/kibana/assets/app/controllers/pulldown.js +1 -1
  10. data/lib/kibana/assets/app/controllers/row.js +1 -1
  11. data/lib/kibana/assets/app/dashboards/blank.json +1 -1
  12. data/lib/kibana/assets/app/dashboards/guided.json +1 -1
  13. data/lib/kibana/assets/app/dashboards/noted.json +1 -1
  14. data/lib/kibana/assets/app/directives/addPanel.js +1 -1
  15. data/lib/kibana/assets/app/directives/all.js +1 -1
  16. data/lib/kibana/assets/app/directives/arrayJoin.js +1 -1
  17. data/lib/kibana/assets/app/directives/configModal.js +1 -1
  18. data/lib/kibana/assets/app/directives/confirmClick.js +1 -1
  19. data/lib/kibana/assets/app/directives/dashUpload.js +1 -1
  20. data/lib/kibana/assets/app/directives/esVersion.js +1 -1
  21. data/lib/kibana/assets/app/directives/kibanaPanel.js +1 -1
  22. data/lib/kibana/assets/app/directives/kibanaSimplePanel.js +2 -2
  23. data/lib/kibana/assets/app/directives/ngBlur.js +1 -1
  24. data/lib/kibana/assets/app/directives/ngModelOnBlur.js +1 -1
  25. data/lib/kibana/assets/app/directives/tip.js +1 -1
  26. data/lib/kibana/assets/app/factories/store.js +1 -1
  27. data/lib/kibana/assets/app/filters/all.js +11 -3
  28. data/lib/kibana/assets/app/panels/bettermap/module.js +2 -2
  29. data/lib/kibana/assets/app/panels/filtering/module.html +19 -19
  30. data/lib/kibana/assets/app/panels/filtering/module.js +3 -1
  31. data/lib/kibana/assets/app/panels/goal/module.js +1 -1
  32. data/lib/kibana/assets/app/panels/histogram/editor.html +3 -0
  33. data/lib/kibana/assets/app/panels/histogram/module.js +4 -4
  34. data/lib/kibana/assets/app/panels/hits/module.js +1 -1
  35. data/lib/kibana/assets/app/panels/map/module.js +1 -1
  36. data/lib/kibana/assets/app/panels/query/editors/topN.html +3 -3
  37. data/lib/kibana/assets/app/panels/query/meta.html +7 -7
  38. data/lib/kibana/assets/app/panels/query/module.html +9 -9
  39. data/lib/kibana/assets/app/panels/query/module.js +4 -3
  40. data/lib/kibana/assets/app/panels/sparklines/module.js +1 -1
  41. data/lib/kibana/assets/app/panels/stats/module.js +2 -2
  42. data/lib/kibana/assets/app/panels/table/micropanel.html +1 -1
  43. data/lib/kibana/assets/app/panels/table/modal.html +1 -3
  44. data/lib/kibana/assets/app/panels/table/module.html +7 -0
  45. data/lib/kibana/assets/app/panels/table/module.js +22 -13
  46. data/lib/kibana/assets/app/panels/terms/module.html +21 -5
  47. data/lib/kibana/assets/app/panels/terms/module.js +3 -3
  48. data/lib/kibana/assets/app/panels/timepicker/module.js +0 -1
  49. data/lib/kibana/assets/app/panels/trends/module.js +6 -8
  50. data/lib/kibana/assets/app/partials/dashLoader.html +1 -1
  51. data/lib/kibana/assets/app/partials/dasheditor.html +4 -4
  52. data/lib/kibana/assets/app/partials/querySelect.html +3 -3
  53. data/lib/kibana/assets/app/services/dashboard.js +14 -12
  54. data/lib/kibana/assets/app/services/esVersion.js +14 -8
  55. data/lib/kibana/assets/app/services/fields.js +16 -15
  56. data/lib/kibana/assets/app/services/filterSrv.js +28 -22
  57. data/lib/kibana/assets/app/services/kbnIndex.js +23 -20
  58. data/lib/kibana/assets/app/services/querySrv.js +29 -20
  59. data/lib/kibana/sinatra/version.rb +1 -1
  60. data/lib/kibana/views/config.erb +5 -0
  61. data/lib/tasks/update.rb +6 -4
  62. metadata +2 -2
@@ -66,6 +66,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
66
66
 
67
67
  // An elasticJS client to use
68
68
  var ejs = ejsResource(config.elasticsearch);
69
+
69
70
  var gist_pattern = /(^\d{5,}$)|(^[a-z0-9]{10,}$)|(gist.github.com(\/*.*)\/[a-z0-9]{5,}\/*$)/;
70
71
 
71
72
  // Store a reference to this
@@ -186,7 +187,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
186
187
  _.defaults(dashboard,_dash);
187
188
  _.defaults(dashboard.index,_dash.index);
188
189
  _.defaults(dashboard.loader,_dash.loader);
189
- return dashboard;
190
+ return _.cloneDeep(dashboard);
190
191
  };
191
192
 
192
193
  this.dash_load = function(dashboard) {
@@ -351,24 +352,25 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
351
352
  };
352
353
 
353
354
  this.elasticsearch_load = function(type,id) {
354
- return $http({
355
- url: config.elasticsearch + "/" + config.kibana_index + "/"+type+"/"+id+'?' + new Date().getTime(),
356
- method: "GET",
357
- transformResponse: function(response) {
358
- return renderTemplate(angular.fromJson(response)._source.dashboard, $routeParams);
359
- }
360
- }).error(function(data, status) {
355
+ var successcb = function(data) {
356
+ var response = renderTemplate(angular.fromJson(data)._source.dashboard, $routeParams);
357
+ self.dash_load(response);
358
+ };
359
+ var errorcb = function(data, status) {
361
360
  if(status === 0) {
362
- alertSrv.set('Error',"Could not contact Elasticsearch at "+config.elasticsearch+
361
+ alertSrv.set('Error',"Could not contact Elasticsearch at "+ejs.config.server+
363
362
  ". Please ensure that Elasticsearch is reachable from your system." ,'error');
364
363
  } else {
365
364
  alertSrv.set('Error',"Could not find "+id+". If you"+
366
365
  " are using a proxy, ensure it is configured correctly",'error');
367
366
  }
368
367
  return false;
369
- }).success(function(data) {
370
- self.dash_load(data);
371
- });
368
+ };
369
+
370
+ ejs.client.get(
371
+ "/" + config.kibana_index + "/"+type+"/"+id+'?' + new Date().getTime(),
372
+ null, successcb, errorcb);
373
+
372
374
  };
373
375
 
374
376
  this.script_load = function(file) {
@@ -8,10 +8,13 @@ function (angular, _, config) {
8
8
 
9
9
  var module = angular.module('kibana.services');
10
10
 
11
- module.service('esVersion', function($http, alertSrv, esMinVersion, $q) {
11
+ module.service('esVersion', function($http, alertSrv, esMinVersion, $q, ejsResource) {
12
12
 
13
13
  this.versions = [];
14
14
 
15
+ var ejs = ejsResource(config.elasticsearch);
16
+
17
+
15
18
  // save a reference to this
16
19
  var self = this,
17
20
  defer = $q.defer();
@@ -25,21 +28,20 @@ function (angular, _, config) {
25
28
  defer.resolve(self.versions);
26
29
  return defer.promise;
27
30
  } else {
28
- var nodeInfo = $http({
29
- url: config.elasticsearch + '/_nodes',
30
- method: "GET",
31
- }).error(function(data, status) {
31
+ var nodeInfo = ejs.client.get('/_nodes',
32
+ undefined, undefined, function(data, status) {
32
33
  if(status === 0) {
33
- alertSrv.set('Error',"Could not contact Elasticsearch at "+config.elasticsearch+
34
+ alertSrv.set('Error',"Could not contact Elasticsearch at "+ejs.client.server()+
34
35
  ". Please ensure that Elasticsearch is reachable from your system." ,'error');
35
36
  } else {
36
- alertSrv.set('Error',"Could not reach "+config.elasticsearch+"/_nodes. If you"+
37
+ alertSrv.set('Error',"Could not reach "+ejs.client.server()+"/_nodes. If you"+
37
38
  " are using a proxy, ensure it is configured correctly",'error');
38
39
  }
40
+ return;
39
41
  });
40
42
 
41
43
  return nodeInfo.then(function(p) {
42
- _.each(p.data.nodes, function(v) {
44
+ _.each(p.nodes, function(v) {
43
45
  self.versions.push(v.version.split('-')[0]);
44
46
  });
45
47
  self.versions = sortVersions(_.uniq(self.versions));
@@ -143,6 +145,10 @@ function (angular, _, config) {
143
145
 
144
146
  // Determine if a specific version is greater than or equal to another
145
147
  this.compare = function (required,installed) {
148
+ if(!required || !installed) {
149
+ return undefined;
150
+ }
151
+
146
152
  var a = installed.split('.');
147
153
  var b = required.split('.');
148
154
  var i;
@@ -8,11 +8,14 @@ function (angular, _, config) {
8
8
 
9
9
  var module = angular.module('kibana.services');
10
10
 
11
- module.service('fields', function(dashboard, $rootScope, $http, esVersion, alertSrv) {
11
+ module.service('fields', function(dashboard, $rootScope, $http, esVersion, alertSrv, ejsResource) {
12
12
 
13
13
  // Save a reference to this
14
14
  var self = this;
15
15
 
16
+ var ejs = ejsResource(config.elasticsearch);
17
+
18
+
16
19
  this.list = ['_type'];
17
20
  this.indices = [];
18
21
 
@@ -45,25 +48,23 @@ function (angular, _, config) {
45
48
  };
46
49
 
47
50
  this.map = function(indices) {
48
- var request = $http({
49
- url: config.elasticsearch + "/" + indices.join(',') + "/_mapping",
50
- method: "GET"
51
- }).error(function(data, status) {
52
- if(status === 0) {
53
- alertSrv.set('Error',"Could not contact Elasticsearch at "+config.elasticsearch+
54
- ". Please ensure that Elasticsearch is reachable from your system." ,'error');
55
- } else {
56
- alertSrv.set('Error',"No index found at "+config.elasticsearch+"/" +
57
- indices.join(',')+"/_mapping. Please create at least one index." +
58
- "If you're using a proxy ensure it is configured correctly.",'error');
59
- }
60
- });
51
+ var request = ejs.client.get('/' + indices.join(',') + "/_mapping",
52
+ undefined, undefined, function(data, status) {
53
+ if(status === 0) {
54
+ alertSrv.set('Error',"Could not contact Elasticsearch at "+ejs.config.server+
55
+ ". Please ensure that Elasticsearch is reachable from your system." ,'error');
56
+ } else {
57
+ alertSrv.set('Error',"No index found at "+ejs.config.server+"/" +
58
+ indices.join(',')+"/_mapping. Please create at least one index." +
59
+ "If you're using a proxy ensure it is configured correctly.",'error');
60
+ }
61
+ });
61
62
 
62
63
  // Flatten the mapping of each index into dot notated keys.
63
64
  return request.then(function(p) {
64
65
  var mapping = {};
65
66
  return esVersion.gte('1.0.0.RC1').then(function(version) {
66
- _.each(p.data, function(indexMap,index) {
67
+ _.each(p, function(indexMap,index) {
67
68
  mapping[index] = {};
68
69
  _.each((version ? indexMap.mappings : indexMap), function (typeMap,type) {
69
70
  mapping[index][type] = flatten(typeMap);
@@ -29,16 +29,20 @@ define([
29
29
  // Populate defaults
30
30
  _.defaults(dashboard.current.services.filter,_d);
31
31
 
32
- // Accessors
33
- self.list = dashboard.current.services.filter.list;
34
- self.ids = dashboard.current.services.filter.ids;
35
-
36
- _.each(self.list,function(f) {
32
+ _.each(dashboard.current.services.filter.list,function(f) {
37
33
  self.set(f,f.id,true);
38
34
  });
39
35
 
40
36
  };
41
37
 
38
+ this.ids = function() {
39
+ return dashboard.current.services.filter.ids;
40
+ };
41
+
42
+ this.list = function() {
43
+ return dashboard.current.services.filter.list;
44
+ };
45
+
42
46
  // This is used both for adding filters and modifying them.
43
47
  // If an id is passed, the filter at that id is updated
44
48
  this.set = function(filter,id,noRefresh) {
@@ -50,8 +54,8 @@ define([
50
54
  });
51
55
 
52
56
  if(!_.isUndefined(id)) {
53
- if(!_.isUndefined(self.list[id])) {
54
- _.extend(self.list[id],filter);
57
+ if(!_.isUndefined(dashboard.current.services.filter.list[id])) {
58
+ _.extend(dashboard.current.services.filter.list[id],filter);
55
59
  _r = id;
56
60
  } else {
57
61
  _r = false;
@@ -67,8 +71,8 @@ define([
67
71
  mandate: 'must'
68
72
  };
69
73
  _.defaults(filter,_filter);
70
- self.list[_id] = filter;
71
- self.ids.push(_id);
74
+ dashboard.current.services.filter.list[_id] = filter;
75
+ dashboard.current.services.filter.ids.push(_id);
72
76
  _r = _id;
73
77
  }
74
78
  }
@@ -80,18 +84,20 @@ define([
80
84
  dashboard.refresh();
81
85
  },0);
82
86
  }
83
- self.ids = dashboard.current.services.filter.ids =
84
- _.intersection(_.map(self.list,function(v,k){return parseInt(k,10);}),self.ids);
87
+ dashboard.current.services.filter.ids = dashboard.current.services.filter.ids =
88
+ _.intersection(_.map(dashboard.current.services.filter.list,
89
+ function(v,k){return parseInt(k,10);}),dashboard.current.services.filter.ids);
85
90
  $rootScope.$broadcast('filter');
91
+
86
92
  return _r;
87
93
  };
88
94
 
89
95
  this.remove = function(id,noRefresh) {
90
96
  var _r;
91
- if(!_.isUndefined(self.list[id])) {
92
- delete self.list[id];
97
+ if(!_.isUndefined(dashboard.current.services.filter.list[id])) {
98
+ delete dashboard.current.services.filter.list[id];
93
99
  // This must happen on the full path also since _.without returns a copy
94
- self.ids = dashboard.current.services.filter.ids = _.without(self.ids,id);
100
+ dashboard.current.services.filter.ids = dashboard.current.services.filter.ids = _.without(dashboard.current.services.filter.ids,id);
95
101
  _r = true;
96
102
  } else {
97
103
  _r = false;
@@ -127,10 +133,10 @@ define([
127
133
  var added_a_filter = false;
128
134
 
129
135
  _.each(ids,function(id) {
130
- if(self.list[id].active) {
136
+ if(dashboard.current.services.filter.list[id].active) {
131
137
  added_a_filter = true;
132
138
 
133
- switch(self.list[id].mandate)
139
+ switch(dashboard.current.services.filter.list[id].mandate)
134
140
  {
135
141
  case 'mustNot':
136
142
  bool.mustNot(self.getEjsObj(id));
@@ -151,7 +157,7 @@ define([
151
157
  };
152
158
 
153
159
  this.getEjsObj = function(id) {
154
- return self.toEjsObj(self.list[id]);
160
+ return self.toEjsObj(dashboard.current.services.filter.list[id]);
155
161
  };
156
162
 
157
163
  this.toEjsObj = function (filter) {
@@ -163,7 +169,7 @@ define([
163
169
  case 'time':
164
170
  var _f = ejs.RangeFilter(filter.field).from(kbn.parseDate(filter.from).valueOf());
165
171
  if(!_.isUndefined(filter.to)) {
166
- _f = _f.to(filter.to.valueOf());
172
+ _f = _f.to(kbn.parseDate(filter.to).valueOf());
167
173
  }
168
174
  return _f;
169
175
  case 'range':
@@ -186,12 +192,12 @@ define([
186
192
  };
187
193
 
188
194
  this.getByType = function(type,inactive) {
189
- return _.pick(self.list,self.idsByType(type,inactive));
195
+ return _.pick(dashboard.current.services.filter.list,self.idsByType(type,inactive));
190
196
  };
191
197
 
192
198
  this.idsByType = function(type,inactive) {
193
199
  var _require = inactive ? {type:type} : {type:type,active:true};
194
- return _.pluck(_.where(self.list,_require),'id');
200
+ return _.pluck(_.where(dashboard.current.services.filter.list,_require),'id');
195
201
  };
196
202
 
197
203
  // TOFIX: Error handling when there is more than one field
@@ -201,7 +207,7 @@ define([
201
207
 
202
208
  // Parse is used when you need to know about the raw filter
203
209
  this.timeRange = function(parse) {
204
- var _t = _.last(_.where(self.list,{type:'time',active:true}));
210
+ var _t = _.last(_.where(dashboard.current.services.filter.list,{type:'time',active:true}));
205
211
  if(_.isUndefined(_t)) {
206
212
  return false;
207
213
  }
@@ -240,4 +246,4 @@ define([
240
246
  self.init();
241
247
  });
242
248
 
243
- });
249
+ });
@@ -9,7 +9,7 @@ function (angular, _, config, moment) {
9
9
 
10
10
  var module = angular.module('kibana.services');
11
11
 
12
- module.service('kbnIndex', function($http, alertSrv) {
12
+ module.service('kbnIndex', function($http, alertSrv, ejsResource) {
13
13
  // returns a promise containing an array of all indices matching the index
14
14
  // pattern that exist in a given range
15
15
  this.indices = function(from,to,pattern,interval) {
@@ -28,19 +28,34 @@ function (angular, _, config, moment) {
28
28
  });
29
29
  };
30
30
 
31
+ var ejs = ejsResource(config.elasticsearch);
32
+
33
+
31
34
  // returns a promise containing an array of all indices in an elasticsearch
32
35
  // cluster
33
36
  function resolve_indices(indices) {
34
37
  var something;
35
38
  indices = _.uniq(_.map(indices, encodeURIComponent));
36
- something = $http({
37
- url: config.elasticsearch + "/" + indices.join(",") + "/_aliases?ignore_missing=true",
38
- method: "GET"
39
- });
39
+
40
+ something = ejs.client.get("/" + indices.join(",") + "/_aliases?ignore_missing=true",
41
+ undefined, undefined, function (data, p) {
42
+ if (p === 404) {
43
+ return [];
44
+ }
45
+ else if(p === 0) {
46
+ alertSrv.set('Error',"Could not contact Elasticsearch at "+ejs.config.server+
47
+ ". Please ensure that Elasticsearch is reachable from your system." ,'error');
48
+ } else {
49
+ alertSrv.set('Error',"Could not reach "+ejs.config.server+"/_aliases. If you"+
50
+ " are using a proxy, ensure it is configured correctly",'error');
51
+ }
52
+ return [];
53
+ });
40
54
 
41
55
  return something.then(function(p) {
56
+
42
57
  var indices = [];
43
- _.each(p.data, function(v,k) {
58
+ _.each(p, function(v,k) {
44
59
  indices.push(k);
45
60
  // Also add the aliases. Could be expensive on systems with a lot of them
46
61
  _.each(v.aliases, function(v, k) {
@@ -48,19 +63,7 @@ function (angular, _, config, moment) {
48
63
  });
49
64
  });
50
65
  return indices;
51
- }, function (p) {
52
- if (p.status === 404) {
53
- return [];
54
- }
55
- else if(p.status === 0) {
56
- alertSrv.set('Error',"Could not contact Elasticsearch at "+config.elasticsearch+
57
- ". Please ensure that Elasticsearch is reachable from your system." ,'error');
58
- } else {
59
- alertSrv.set('Error',"Could not reach "+config.elasticsearch+"/_aliases. If you"+
60
- " are using a proxy, ensure it is configured correctly",'error');
61
- }
62
- return [];
63
- });
66
+ });
64
67
  }
65
68
 
66
69
  /*
@@ -109,4 +112,4 @@ function (angular, _, config, moment) {
109
112
  }
110
113
  });
111
114
 
112
- });
115
+ });
@@ -135,19 +135,27 @@ function (angular, _, config, kbn) {
135
135
  });
136
136
  });
137
137
 
138
+
139
+ this.list = function () {
140
+ return dashboard.current.services.query.list;
141
+ };
142
+
143
+ this.ids = function () {
144
+ return dashboard.current.services.query.ids;
145
+ };
146
+
138
147
  this.init = function() {
139
- self.list = dashboard.current.services.query.list;
140
- self.ids = dashboard.current.services.query.ids;
141
148
 
142
- self.ids = dashboard.current.services.query.ids =
143
- _.intersection(_.map(self.list,function(v,k){return parseInt(k,10);}),self.ids);
149
+ dashboard.current.services.query.ids =
150
+ _.intersection(_.map(dashboard.current.services.query.list,
151
+ function(v,k){return parseInt(k,10);}),self.ids());
144
152
 
145
153
  // Check each query object, populate its defaults
146
- _.each(self.list,function(query) {
154
+ _.each(dashboard.current.services.query.list,function(query) {
147
155
  query = self.defaults(query);
148
156
  });
149
157
 
150
- if (self.ids.length === 0) {
158
+ if (dashboard.current.services.query.ids.length === 0) {
151
159
  self.set({});
152
160
  }
153
161
  };
@@ -156,8 +164,8 @@ function (angular, _, config, kbn) {
156
164
  // the query at that id is updated
157
165
  this.set = function(query,id) {
158
166
  if(!_.isUndefined(id)) {
159
- if(!_.isUndefined(self.list[id])) {
160
- _.extend(self.list[id],query);
167
+ if(!_.isUndefined(dashboard.current.services.query.list[id])) {
168
+ _.extend(dashboard.current.services.query.list[id],query);
161
169
  return id;
162
170
  } else {
163
171
  return false;
@@ -168,8 +176,8 @@ function (angular, _, config, kbn) {
168
176
  query.color = query.color || colorAt(query.id);
169
177
  // Then it can get defaults
170
178
  query = self.defaults(query);
171
- self.list[query.id] = query;
172
- self.ids.push(query.id);
179
+ dashboard.current.services.query.list[query.id] = query;
180
+ dashboard.current.services.query.ids.push(query.id);
173
181
  return query.id;
174
182
  }
175
183
  };
@@ -182,10 +190,10 @@ function (angular, _, config, kbn) {
182
190
  };
183
191
 
184
192
  this.remove = function(id) {
185
- if(!_.isUndefined(self.list[id])) {
186
- delete self.list[id];
193
+ if(!_.isUndefined(dashboard.current.services.query.list[id])) {
194
+ delete dashboard.current.services.query.list[id];
187
195
  // This must happen on the full path also since _.without returns a copy
188
- self.ids = dashboard.current.services.query.ids = _.without(self.ids,id);
196
+ dashboard.current.services.query.ids = _.without(dashboard.current.services.query.ids,id);
189
197
  return true;
190
198
  } else {
191
199
  return false;
@@ -222,15 +230,15 @@ function (angular, _, config, kbn) {
222
230
  switch(config.mode)
223
231
  {
224
232
  case 'all':
225
- return _.pluck(_.where(self.list,{enable:true}),'id');
233
+ return _.pluck(_.where(dashboard.current.services.query.list,{enable:true}),'id');
226
234
  case 'pinned':
227
- return _.pluck(_.where(self.list,{pin:true,enable:true}),'id');
235
+ return _.pluck(_.where(dashboard.current.services.query.list,{pin:true,enable:true}),'id');
228
236
  case 'unpinned':
229
- return _.pluck(_.where(self.list,{pin:false,enable:true}),'id');
237
+ return _.pluck(_.where(dashboard.current.services.query.list,{pin:false,enable:true}),'id');
230
238
  case 'selected':
231
- return _.intersection(_.pluck(_.where(self.list,{enable:true}),'id'),config.ids);
239
+ return _.intersection(_.pluck(_.where(dashboard.current.services.query.list,{enable:true}),'id'),config.ids);
232
240
  default:
233
- return _.pluck(_.where(self.list,{enable:true}),'id');
241
+ return _.pluck(_.where(dashboard.current.services.query.list,{enable:true}),'id');
234
242
  }
235
243
  };
236
244
 
@@ -238,8 +246,9 @@ function (angular, _, config, kbn) {
238
246
  this.resolve = function() {
239
247
  // Find ids of all abstract queries
240
248
  // Get a list of resolvable ids, constrast with total list to get abstract ones
241
- return $q.all(_.map(self.ids,function(q) {
242
- return self.queryTypes[self.list[q].type].resolve(_.clone(self.list[q])).then(function(data){
249
+ return $q.all(_.map(dashboard.current.services.query.ids,function(q) {
250
+ return self.queryTypes[dashboard.current.services.query.list[q].type].resolve(
251
+ _.clone(dashboard.current.services.query.list[q])).then(function(data){
243
252
  return data;
244
253
  });
245
254
  })).then(function(data) {