kibana-sinatra 0.0.8 → 3.0.0.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 (46) hide show
  1. checksums.yaml +4 -4
  2. data/lib/kibana/assets/app/components/kbn.js +3 -3
  3. data/lib/kibana/assets/app/controllers/dash.js +2 -19
  4. data/lib/kibana/assets/app/dashboards/guided.json +1 -1
  5. data/lib/kibana/assets/app/panels/bettermap/module.html +1 -1
  6. data/lib/kibana/assets/app/panels/bettermap/module.js +11 -4
  7. data/lib/kibana/assets/app/panels/column/module.js +3 -0
  8. data/lib/kibana/assets/app/panels/{pie → goal}/editor.html +1 -25
  9. data/lib/kibana/assets/app/panels/{pie → goal}/module.html +4 -4
  10. data/lib/kibana/assets/app/panels/goal/module.js +252 -0
  11. data/lib/kibana/assets/app/panels/histogram/interval.js +1 -1
  12. data/lib/kibana/assets/app/panels/histogram/module.html +12 -3
  13. data/lib/kibana/assets/app/panels/histogram/module.js +16 -14
  14. data/lib/kibana/assets/app/panels/hits/module.js +7 -3
  15. data/lib/kibana/assets/app/panels/map/module.html +1 -1
  16. data/lib/kibana/assets/app/panels/map/module.js +9 -1
  17. data/lib/kibana/assets/app/panels/query/module.html +1 -1
  18. data/lib/kibana/assets/app/panels/sparklines/interval.js +1 -1
  19. data/lib/kibana/assets/app/panels/sparklines/module.js +5 -1
  20. data/lib/kibana/assets/app/panels/table/editor.html +1 -1
  21. data/lib/kibana/assets/app/panels/table/micropanel.html +3 -3
  22. data/lib/kibana/assets/app/panels/table/module.html +63 -16
  23. data/lib/kibana/assets/app/panels/table/module.js +4 -1
  24. data/lib/kibana/assets/app/panels/terms/module.js +7 -4
  25. data/lib/kibana/assets/app/panels/text/module.js +2 -0
  26. data/lib/kibana/assets/app/panels/timepicker/module.js +9 -1
  27. data/lib/kibana/assets/app/panels/trends/module.js +4 -0
  28. data/lib/kibana/assets/app/partials/dashboard.html +4 -2
  29. data/lib/kibana/assets/app/partials/panelgeneral.html +1 -1
  30. data/lib/kibana/assets/app/services/dashboard.js +9 -7
  31. data/lib/kibana/assets/app/services/fields.js +34 -3
  32. data/lib/kibana/assets/app/services/kbnIndex.js +5 -3
  33. data/lib/kibana/assets/css/bootstrap.dark.min.css +1 -1
  34. data/lib/kibana/assets/css/bootstrap.light.min.css +1 -1
  35. data/lib/kibana/assets/favicon.ico +0 -0
  36. data/lib/kibana/assets/img/annotation-icon.png +0 -0
  37. data/lib/kibana/assets/index.html +14 -9
  38. data/lib/kibana/assets/vendor/bootstrap/less/overrides.less +11 -5
  39. data/lib/kibana/assets/vendor/bootstrap/less/tooltip.less +4 -4
  40. data/lib/kibana/assets/vendor/jquery/jquery.flot.events.js +15 -9
  41. data/lib/kibana/assets/vendor/jquery/jquery.flot.js +154 -77
  42. data/lib/kibana/assets/vendor/jquery/jquery.flot.pie.js +6 -6
  43. data/lib/kibana/sinatra/version.rb +1 -1
  44. data/lib/kibana/views/config.erb +8 -2
  45. metadata +8 -6
  46. data/lib/kibana/assets/app/panels/pie/module.js +0 -334
@@ -69,6 +69,7 @@ More detail and specific examples can be found in the included HTML file.
69
69
 
70
70
  var canvas = null,
71
71
  target = null,
72
+ options = null,
72
73
  maxRadius = null,
73
74
  centerLeft = null,
74
75
  centerTop = null,
@@ -293,16 +294,15 @@ More detail and specific examples can be found in the included HTML file.
293
294
  } else {
294
295
  centerLeft -= legendWidth / 2;
295
296
  }
297
+ if (centerLeft < maxRadius) {
298
+ centerLeft = maxRadius;
299
+ } else if (centerLeft > canvasWidth - maxRadius) {
300
+ centerLeft = canvasWidth - maxRadius;
301
+ }
296
302
  } else {
297
303
  centerLeft += options.series.pie.offset.left;
298
304
  }
299
305
 
300
- if (centerLeft < maxRadius) {
301
- centerLeft = maxRadius;
302
- } else if (centerLeft > canvasWidth - maxRadius) {
303
- centerLeft = canvasWidth - maxRadius;
304
- }
305
-
306
306
  var slices = plot.getData(),
307
307
  attempts = 0;
308
308
 
@@ -1,5 +1,5 @@
1
1
  module Kibana
2
2
  module Sinatra
3
- VERSION = "0.0.8"
3
+ VERSION = "3.0.0.0"
4
4
  end
5
5
  end
@@ -1,4 +1,5 @@
1
1
  /** @scratch /configuration/config.js/1
2
+ *
2
3
  * == Configuration
3
4
  * config.js is where you will find the core Kibana configuration. This file contains parameter that
4
5
  * must be set before kibana is run for the first time.
@@ -8,11 +9,13 @@ function (Settings) {
8
9
  "use strict";
9
10
 
10
11
  /** @scratch /configuration/config.js/2
12
+ *
11
13
  * === Parameters
12
14
  */
13
15
  return new Settings({
14
16
 
15
17
  /** @scratch /configuration/config.js/5
18
+ *
16
19
  * ==== elasticsearch
17
20
  *
18
21
  * The URL to your elasticsearch server. You almost certainly don't
@@ -24,17 +27,19 @@ function (Settings) {
24
27
  elasticsearch: "<%= elasticsearch_url %>",
25
28
 
26
29
  /** @scratch /configuration/config.js/5
30
+ *
27
31
  * ==== default_route
28
32
  *
29
33
  * This is the default landing page when you don't specify a dashboard to load. You can specify
30
34
  * files, scripts or saved dashboards here. For example, if you had saved a dashboard called
31
35
  * `WebLogs' to elasticsearch you might use:
32
36
  *
33
- * +default_route: '/dashboard/elasticsearch/WebLogs',+
37
+ * default_route: '/dashboard/elasticsearch/WebLogs',
34
38
  */
35
39
  default_route : '/dashboard/file/default.json',
36
40
 
37
41
  /** @scratch /configuration/config.js/5
42
+ *
38
43
  * ==== kibana-int
39
44
  *
40
45
  * The default ES index to use for storing Kibana specific object
@@ -43,6 +48,7 @@ function (Settings) {
43
48
  kibana_index: "<%= kibana_index %>",
44
49
 
45
50
  /** @scratch /configuration/config.js/5
51
+ *
46
52
  * ==== panel_name
47
53
  *
48
54
  * An array of panel modules available. Panels will only be loaded when they are defined in the
@@ -51,7 +57,7 @@ function (Settings) {
51
57
  panel_names: [
52
58
  'histogram',
53
59
  'map',
54
- 'pie',
60
+ 'goal',
55
61
  'table',
56
62
  'filtering',
57
63
  'timepicker',
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kibana-sinatra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 3.0.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Neubert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-14 00:00:00.000000000 Z
11
+ date: 2014-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -187,6 +187,9 @@ files:
187
187
  - lib/kibana/assets/app/panels/filtering/meta.html
188
188
  - lib/kibana/assets/app/panels/filtering/module.html
189
189
  - lib/kibana/assets/app/panels/filtering/module.js
190
+ - lib/kibana/assets/app/panels/goal/editor.html
191
+ - lib/kibana/assets/app/panels/goal/module.html
192
+ - lib/kibana/assets/app/panels/goal/module.js
190
193
  - lib/kibana/assets/app/panels/histogram/editor.html
191
194
  - lib/kibana/assets/app/panels/histogram/interval.js
192
195
  - lib/kibana/assets/app/panels/histogram/module.html
@@ -204,9 +207,6 @@ files:
204
207
  - lib/kibana/assets/app/panels/map/lib/map.world.js
205
208
  - lib/kibana/assets/app/panels/map/module.html
206
209
  - lib/kibana/assets/app/panels/map/module.js
207
- - lib/kibana/assets/app/panels/pie/editor.html
208
- - lib/kibana/assets/app/panels/pie/module.html
209
- - lib/kibana/assets/app/panels/pie/module.js
210
210
  - lib/kibana/assets/app/panels/query/editor.html
211
211
  - lib/kibana/assets/app/panels/query/editors/lucene.html
212
212
  - lib/kibana/assets/app/panels/query/editors/regex.html
@@ -277,11 +277,13 @@ files:
277
277
  - lib/kibana/assets/css/font-awesome.min.css
278
278
  - lib/kibana/assets/css/normalize.min.css
279
279
  - lib/kibana/assets/css/timepicker.css
280
+ - lib/kibana/assets/favicon.ico
280
281
  - lib/kibana/assets/font/FontAwesome.otf
281
282
  - lib/kibana/assets/font/fontawesome-webfont.eot
282
283
  - lib/kibana/assets/font/fontawesome-webfont.svg
283
284
  - lib/kibana/assets/font/fontawesome-webfont.ttf
284
285
  - lib/kibana/assets/font/fontawesome-webfont.woff
286
+ - lib/kibana/assets/img/annotation-icon.png
285
287
  - lib/kibana/assets/img/cubes.png
286
288
  - lib/kibana/assets/img/glyphicons-halflings-white.png
287
289
  - lib/kibana/assets/img/glyphicons-halflings.png
@@ -410,7 +412,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
410
412
  version: '0'
411
413
  requirements: []
412
414
  rubyforge_project:
413
- rubygems_version: 2.0.3
415
+ rubygems_version: 2.2.2
414
416
  signing_key:
415
417
  specification_version: 4
416
418
  summary: This gem packages up Kibana 3 into a Sinatra app that can be used stand alone,
@@ -1,334 +0,0 @@
1
- /** @scratch /panels/5
2
- * include::panels/pie.asciidoc[]
3
- */
4
-
5
- /** @scratch /panels/pie/0
6
- * == Pie
7
- * Status: *Deprecated*
8
- *
9
- * The pie panel has been largely replaced by the +terms+ panel. It exists for backwards compatibility
10
- * for now, but will be removed in a future release
11
- *
12
- */
13
- define([
14
- 'angular',
15
- 'app',
16
- 'lodash',
17
- 'jquery',
18
- 'kbn',
19
- 'config'
20
- ], function (angular, app, _, $, kbn) {
21
- 'use strict';
22
-
23
- var module = angular.module('kibana.panels.pie', []);
24
- app.useModule(module);
25
-
26
- module.controller('pie', function($scope, $rootScope, querySrv, dashboard, filterSrv) {
27
-
28
- $scope.panelMeta = {
29
- editorTabs : [
30
- {title:'Queries', src:'app/partials/querySelect.html'}
31
- ],
32
- modals : [
33
- {
34
- description: "Inspect",
35
- icon: "icon-info-sign",
36
- partial: "app/partials/inspector.html",
37
- show: $scope.panel.spyable
38
- }
39
- ],
40
- status : "Deprecated",
41
- description : "Uses an Elasticsearch terms facet to create a pie chart. You should really only"+
42
- " point this at not_analyzed fields for that reason. This panel is going away soon, it has"+
43
- " <strong>been replaced by the terms panel</strong>. Please use that one instead."
44
- };
45
-
46
- // Set and populate defaults
47
- var _d = {
48
- /** @scratch /panels/pie/3
49
- * === Parameters
50
- *
51
- * mode:: terms or goal. Terms mode finds the top N most popular terms, Goal mode display
52
- * progress towards a fix goal in terms of documents matched
53
- */
54
- mode : "terms",
55
- /** @scratch /panels/pie/3
56
- * size:: The max number of results to display in +terms+ mode.
57
- */
58
- size : 10,
59
- /** @scratch /panels/pie/3
60
- * exclude:: Exclude these terms in terms mode
61
- */
62
- exclude : [],
63
- /** @scratch /panels/pie/3
64
- * donut:: Draw a hole in the middle of the pie, creating a tasty donut.
65
- */
66
- donut : false,
67
- /** @scratch /panels/pie/3
68
- * tilt:: Tilt the pie back into an oval shape
69
- */
70
- tilt : false,
71
- /** @scratch /panels/pie/3
72
- * legend:: The location of the legend, above, below or none
73
- */
74
- legend : "above",
75
- /** @scratch /panels/pie/3
76
- * labels:: Set to false to disable drawing labels inside the pie slices
77
- */
78
- labels : true,
79
- /** @scratch /panels/pie/3
80
- * spyable:: Set to false to disable the inspect function.
81
- */
82
- spyable : true,
83
- /** @scratch /panels/pie/3
84
- * ==== Query
85
- *
86
- * query object:: This confusingly named object has properties to set the terms mode field,
87
- * and the fixed goal for the goal mode
88
- * query.field::: the field to facet on in terms mode
89
- * query.goal::: the fixed goal for goal mode
90
- */
91
- query : { field:"_type", goal: 100},
92
- /** @scratch /panels/pie/5
93
- * ==== Queries
94
- *
95
- * queries object:: This object describes the queries to use on this panel.
96
- * queries.mode::: Of the queries available, which to use. Options: +all, pinned, unpinned, selected+
97
- * queries.ids::: In +selected+ mode, which query ids are selected.
98
- */
99
- queries : {
100
- mode : 'all',
101
- ids : []
102
- },
103
- default_field : '_type',
104
-
105
- };
106
- _.defaults($scope.panel,_d);
107
-
108
- $scope.init = function() {
109
- $scope.$on('refresh',function(){$scope.get_data();});
110
- $scope.get_data();
111
- };
112
-
113
- $scope.set_mode = function(mode) {
114
- switch(mode)
115
- {
116
- case 'terms':
117
- $scope.panel.query = {field:"_all"};
118
- break;
119
- case 'goal':
120
- $scope.panel.query = {goal:100};
121
- break;
122
- }
123
- };
124
-
125
- $scope.set_refresh = function (state) {
126
- $scope.refresh = state;
127
- };
128
-
129
- $scope.close_edit = function() {
130
- if($scope.refresh) {
131
- $scope.get_data();
132
- }
133
- $scope.refresh = false;
134
- $scope.$emit('render');
135
- };
136
-
137
- $scope.get_data = function() {
138
-
139
- // Make sure we have everything for the request to complete
140
- if(dashboard.indices.length === 0) {
141
- return;
142
- }
143
-
144
-
145
- $scope.panelMeta.loading = true;
146
- var request = $scope.ejs.Request().indices(dashboard.indices);
147
-
148
- $scope.panel.queries.ids = querySrv.idsByMode($scope.panel.queries);
149
- var queries = querySrv.getQueryObjs($scope.panel.queries.ids);
150
-
151
- // This could probably be changed to a BoolFilter
152
- var boolQuery = $scope.ejs.BoolQuery();
153
- _.each(queries,function(q) {
154
- boolQuery = boolQuery.should(querySrv.toEjsObj(q));
155
- });
156
-
157
- var results;
158
-
159
- // Terms mode
160
- if ($scope.panel.mode === "terms") {
161
- request = request
162
- .facet($scope.ejs.TermsFacet('pie')
163
- .field($scope.panel.query.field || $scope.panel.default_field)
164
- .size($scope.panel.size)
165
- .exclude($scope.panel.exclude)
166
- .facetFilter($scope.ejs.QueryFilter(
167
- $scope.ejs.FilteredQuery(
168
- boolQuery,
169
- filterSrv.getBoolFilter(filterSrv.ids)
170
- )))).size(0);
171
-
172
- $scope.inspector = angular.toJson(JSON.parse(request.toString()),true);
173
-
174
- results = request.doSearch();
175
-
176
- // Populate scope when we have results
177
- results.then(function(results) {
178
- $scope.panelMeta.loading = false;
179
- $scope.hits = results.hits.total;
180
- $scope.data = [];
181
- var k = 0;
182
- _.each(results.facets.pie.terms, function(v) {
183
- var slice = { label : v.term, data : v.count };
184
- $scope.data.push();
185
- $scope.data.push(slice);
186
- k = k + 1;
187
- });
188
- $scope.$emit('render');
189
- });
190
- // Goal mode
191
- } else {
192
- request = request
193
- .query(boolQuery)
194
- .filter(filterSrv.getBoolFilter(filterSrv.ids))
195
- .size(0);
196
-
197
- $scope.inspector = angular.toJson(JSON.parse(request.toString()),true);
198
-
199
- results = request.doSearch();
200
-
201
- results.then(function(results) {
202
- $scope.panelMeta.loading = false;
203
- var complete = results.hits.total;
204
- var remaining = $scope.panel.query.goal - complete;
205
- $scope.data = [
206
- { label : 'Complete', data : complete, color: '#BF6730' },
207
- { data : remaining, color: '#e2d0c4' }
208
- ];
209
- $scope.$emit('render');
210
- });
211
- }
212
- };
213
-
214
- });
215
-
216
- module.directive('pie', function(querySrv, filterSrv) {
217
- return {
218
- restrict: 'A',
219
- link: function(scope, elem) {
220
-
221
- elem.html('<center><img src="img/load_big.gif"></center>');
222
-
223
- // Receive render events
224
- scope.$on('render',function(){
225
- render_panel();
226
- });
227
-
228
- // Or if the window is resized
229
- angular.element(window).bind('resize', function(){
230
- render_panel();
231
- });
232
-
233
- // Function for rendering panel
234
- function render_panel() {
235
- // IE doesn't work without this
236
- elem.css({height:scope.panel.height||scope.row.height});
237
-
238
- var label;
239
-
240
- if(scope.panel.mode === 'goal') {
241
- label = {
242
- show: scope.panel.labels,
243
- radius: 0,
244
- formatter: function(label, series){
245
- var font = parseInt(scope.row.height.replace('px',''),10)/8 + String('px');
246
- if(!(_.isUndefined(label))) {
247
- return '<div style="font-size:'+font+';font-weight:bold;text-align:center;padding:2px;color:#fff;">'+
248
- Math.round(series.percent)+'%</div>';
249
- } else {
250
- return '';
251
- }
252
- },
253
- };
254
- } else {
255
- label = {
256
- show: scope.panel.labels,
257
- radius: 2/3,
258
- formatter: function(label, series){
259
- return '<div "style="font-size:8pt;text-align:center;padding:2px;color:white;">'+
260
- label+'<br/>'+Math.round(series.percent)+'%</div>';
261
- },
262
- threshold: 0.1
263
- };
264
- }
265
-
266
- var pie = {
267
- series: {
268
- pie: {
269
- innerRadius: scope.panel.donut ? 0.45 : 0,
270
- tilt: scope.panel.tilt ? 0.45 : 1,
271
- radius: 1,
272
- show: true,
273
- combine: {
274
- color: '#999',
275
- label: 'The Rest'
276
- },
277
- label: label,
278
- stroke: {
279
- width: 0
280
- }
281
- }
282
- },
283
- //grid: { hoverable: true, clickable: true },
284
- grid: {
285
- backgroundColor: null,
286
- hoverable: true,
287
- clickable: true
288
- },
289
- legend: { show: false },
290
- colors: querySrv.colors
291
- };
292
-
293
- // Populate legend
294
- if(elem.is(":visible")){
295
- require(['jquery.flot.pie'], function(){
296
- scope.legend = $.plot(elem, scope.data, pie).getData();
297
- if(!scope.$$phase) {
298
- scope.$apply();
299
- }
300
- });
301
- }
302
-
303
- }
304
-
305
- elem.bind('plotclick', function (event, pos, object) {
306
- if (!object) {
307
- return;
308
- }
309
- if(scope.panel.mode === 'terms') {
310
- filterSrv.set({type:'terms',field:scope.panel.query.field,value:object.series.label});
311
- }
312
- });
313
-
314
- var $tooltip = $('<div>');
315
- elem.bind('plothover', function (event, pos, item) {
316
- if (item) {
317
- $tooltip
318
- .html([
319
- kbn.query_color_dot(item.series.color, 15),
320
- (item.series.label || ''),
321
- parseFloat(item.series.percent).toFixed(1) + '%'
322
- ].join(' '))
323
- .place_tt(pos.pageX, pos.pageY, {
324
- offset: 10
325
- });
326
- } else {
327
- $tooltip.remove();
328
- }
329
- });
330
-
331
- }
332
- };
333
- });
334
- });