diff --git a/js/controllers.js b/js/controllers.js index 8311fe5abb9..3615ee7b747 100644 --- a/js/controllers.js +++ b/js/controllers.js @@ -131,7 +131,6 @@ angular.module('kibana.controllers', []) $scope.reset_panel = function() { $scope.panel = { - loading : false, error : false, span : 3, editable: true, diff --git a/js/directives.js b/js/directives.js index 192e2078e80..89afafed536 100644 --- a/js/directives.js +++ b/js/directives.js @@ -7,7 +7,7 @@ angular.module('kibana.directives', []) return { restrict: 'E', link: function(scope, elem, attrs) { - var template = ''+ + var template = ''+ ' '+ '{{panel.type}} '+ diff --git a/panels/bettermap/module.js b/panels/bettermap/module.js index 478551c5ceb..25ec340a9ea 100644 --- a/panels/bettermap/module.js +++ b/panels/bettermap/module.js @@ -96,7 +96,7 @@ angular.module('kibana.bettermap', []) // Populate scope when we have results results.then(function(results) { - $scope.panel.loading = false; + $scope.panelMeta.loading = false; if(_segment === 0) { $scope.hits = 0; @@ -174,7 +174,7 @@ angular.module('kibana.bettermap', []) var map, markers, layerGroup, mcg; function render_panel() { - scope.panel.loading = false; + scope.panelMeta.loading = false; var scripts = $LAB.script("panels/bettermap/lib/leaflet.js").wait() .script("panels/bettermap/lib/plugins.js"); diff --git a/panels/derivequeries/module.js b/panels/derivequeries/module.js index 4d79ed0620b..527ae9584ee 100644 --- a/panels/derivequeries/module.js +++ b/panels/derivequeries/module.js @@ -57,7 +57,7 @@ angular.module('kibana.derivequeries', []) return; } - $scope.panel.loading = true; + $scope.panelMeta.loading = true; var request = $scope.ejs.Request().indices(dashboard.indices); // Terms mode @@ -78,7 +78,7 @@ angular.module('kibana.derivequeries', []) // Populate scope when we have results results.then(function(results) { - $scope.panel.loading = false; + $scope.panelMeta.loading = false; var suffix, data = []; if ($scope.panel.query === '' || $scope.panel.mode === 'terms only') { diff --git a/panels/fields/module.html b/panels/fields/module.html index 015c4541609..2d8080ce5e1 100644 --- a/panels/fields/module.html +++ b/panels/fields/module.html @@ -1,8 +1,3 @@ - +

The 'fields' panel is deprecated.

The table panel now integrates a field selector.
\ No newline at end of file diff --git a/panels/fields/module.js b/panels/fields/module.js index 99d1753bc92..b64d14c3a7a 100644 --- a/panels/fields/module.js +++ b/panels/fields/module.js @@ -3,7 +3,7 @@ /* - ## Fields + ## Fields (DEPRECATED) ### Parameters @@ -25,10 +25,9 @@ angular.module('kibana.fields', []) .controller('fields', function($scope, eventBus, $timeout, dashboard, filterSrv) { $scope.panelMeta = { - status : "Deprecating Soon", - description : "Allows for enabling and disabling of fields in the table panel as well as a "+ - "micro anaylsis panel for analyzing the events in the table panel. This panel will soon be"+ - "combined with the table panel" + status : "Deprecated", + description : "You should not use this table, it does not work anymore. The table panel now"+ + "integrates a field selector. This module will soon be removed." }; diff --git a/panels/histogram/module.js b/panels/histogram/module.js index 4f130d11542..88ba12b94eb 100644 --- a/panels/histogram/module.js +++ b/panels/histogram/module.js @@ -98,7 +98,7 @@ angular.module('kibana.histogram', []) kbn.calculate_interval(_range.from,_range.to,$scope.panel.resolution,0)/1000); } - $scope.panel.loading = true; + $scope.panelMeta.loading = true; var _segment = _.isUndefined(segment) ? 0 : segment; var request = $scope.ejs.Request().indices(dashboard.indices[_segment]); @@ -133,7 +133,7 @@ angular.module('kibana.histogram', []) // Populate scope when we have results results.then(function(results) { - $scope.panel.loading = false; + $scope.panelMeta.loading = false; if(_segment === 0) { $scope.hits = 0; $scope.data = []; diff --git a/panels/hits/module.js b/panels/hits/module.js index 425db5135e5..3938b927580 100644 --- a/panels/hits/module.js +++ b/panels/hits/module.js @@ -54,7 +54,7 @@ angular.module('kibana.hits', []) $scope.get_data = function(segment,query_id) { delete $scope.panel.error; - $scope.panel.loading = true; + $scope.panelMeta.loading = true; // Make sure we have everything for the request to complete if(dashboard.indices.length === 0) { @@ -85,7 +85,7 @@ angular.module('kibana.hits', []) // Populate scope when we have results results.then(function(results) { - $scope.panel.loading = false; + $scope.panelMeta.loading = false; if(_segment === 0) { $scope.hits = 0; $scope.data = []; diff --git a/panels/map/module.js b/panels/map/module.js index 49a23c00e9c..a95c1df1b41 100644 --- a/panels/map/module.js +++ b/panels/map/module.js @@ -55,7 +55,7 @@ angular.module('kibana.map', []) if(dashboard.indices.length === 0) { return; } - $scope.panel.loading = true; + $scope.panelMeta.loading = true; var request; @@ -86,7 +86,7 @@ angular.module('kibana.map', []) // Populate scope when we have results results.then(function(results) { - $scope.panel.loading = false; + $scope.panelMeta.loading = false; $scope.hits = results.hits.total; $scope.data = {}; _.each(results.facets.map.terms, function(v) { diff --git a/panels/pie/module.js b/panels/pie/module.js index e2d660c3282..6311ae16d0a 100644 --- a/panels/pie/module.js +++ b/panels/pie/module.js @@ -87,7 +87,7 @@ angular.module('kibana.pie', []) } - $scope.panel.loading = true; + $scope.panelMeta.loading = true; var request = $scope.ejs.Request().indices(dashboard.indices); $scope.panel.queries.ids = querySrv.idsByMode($scope.panel.queries); @@ -119,7 +119,7 @@ angular.module('kibana.pie', []) // Populate scope when we have results results.then(function(results) { - $scope.panel.loading = false; + $scope.panelMeta.loading = false; $scope.hits = results.hits.total; $scope.data = []; var k = 0; @@ -143,7 +143,7 @@ angular.module('kibana.pie', []) results = request.doSearch(); results.then(function(results) { - $scope.panel.loading = false; + $scope.panelMeta.loading = false; var complete = results.hits.total; var remaining = $scope.panel.query.goal - complete; $scope.data = [ diff --git a/panels/table/micropanel.html b/panels/table/micropanel.html new file mode 100644 index 00000000000..055fd809db2 --- /dev/null +++ b/panels/table/micropanel.html @@ -0,0 +1,25 @@ +× +

+ Micro Analysis of {{micropanel.field}} + + +
{{micropanel.count}} events in the table set +

+ + + + + + + + + + + + + +
{{micropanel.field}}ActionIn set
{{{true: "__blank__",false:field[0]}[field[0] == ""]}} + + + {{field[1]}}
+{{field}} ({{Math.round((count / micropanel.count) * 100)}}%), \ No newline at end of file diff --git a/panels/table/module.html b/panels/table/module.html index 3671b721b44..474b113b7ca 100644 --- a/panels/table/module.html +++ b/panels/table/module.html @@ -1,75 +1,97 @@ + -
-
-
- - -
-
- {{panel.offset}} to {{panel.offset + data.slice(panel.offset,panel.offset+panel.size).length}} - of {{data.length}} available for paging -
-
- +
+
+
-
No columns configured. You may want to add a fields panel, or click the edit button in the top right of this panel to add some columns
- - - - + + + + + + + + + + +
- +
+ +
+
+ + +
+
+ {{panel.offset}} to {{panel.offset + data.slice(panel.offset,panel.offset+panel.size).length}} + of {{data.length}} available for paging +
+
+ +
+
+
No columns configured. You may want to add a fields panel, or click the edit button in the top right of this panel to add some columns
+ + + + - - - - - - - - - - -
+ - - {{field}} - - - {{field}} - -
- - - - - - - - - - - -
FieldActionValue
{{key}} - - - {{value}}
-
-
-
- - -
-
- {{panel.offset}} to {{panel.offset + data.slice(panel.offset,panel.offset+panel.size).length}} - of {{data.length}} available for paging -
-
- + + {{field}} + + + {{field}} + +
+ + + + + + + + + + + +
FieldActionValue
{{key}} + + + {{value}}
+
+
+
+ + +
+
+ {{panel.offset}} to {{panel.offset + data.slice(panel.offset,panel.offset+panel.size).length}} + of {{data.length}} available for paging +
+
+ +
diff --git a/panels/table/module.js b/panels/table/module.js index eb19759ab5e..5416948536b 100644 --- a/panels/table/module.js +++ b/panels/table/module.js @@ -53,26 +53,28 @@ angular.module('kibana.table', []) highlight : [], sortable: true, header : true, - paging : true, - spyable: true + paging : true, + field_list: true, + spyable : true }; _.defaults($scope.panel,_d); $scope.init = function () { - $scope.set_listeners($scope.panel.group); + $scope.Math = Math; + + $scope.$on('refresh',function(){$scope.get_data();}); $scope.get_data(); }; - $scope.set_listeners = function(group) { - $scope.$on('refresh',function(){$scope.get_data();}); - eventBus.register($scope,'sort', function(event,sort){ - $scope.panel.sort = _.clone(sort); - $scope.get_data(); - }); - eventBus.register($scope,'selected_fields', function(event, fields) { - $scope.panel.fields = _.clone(fields); - }); + $scope.toggle_micropanel = function(field) { + var docs = _.pluck($scope.data,'_source'); + $scope.micropanel = { + field: field, + values : kbn.top_field_values(docs,field,10), + related : kbn.get_related_fields(docs,field), + count: _.countBy(docs,function(doc){return _.contains(_.keys(doc),field);})['true'] + }; }; $scope.set_sort = function(field) { @@ -90,7 +92,6 @@ angular.module('kibana.table', []) } else { $scope.panel.fields.push(field); } - broadcast_results(); }; $scope.toggle_highlight = function(field) { @@ -124,6 +125,11 @@ angular.module('kibana.table', []) dashboard.refresh(); }; + $scope.fieldExists = function(field,mandate) { + filterSrv.set({type:'exists',field:field,mandate:mandate}); + dashboard.refresh(); + }; + $scope.get_data = function(segment,query_id) { $scope.panel.error = false; @@ -132,7 +138,7 @@ angular.module('kibana.table', []) return; } - $scope.panel.loading = true; + $scope.panelMeta.loading = true; $scope.panel.queries.ids = querySrv.idsByMode($scope.panel.queries); @@ -166,7 +172,7 @@ angular.module('kibana.table', []) // Populate scope when we have results results.then(function(results) { - $scope.panel.loading = false; + $scope.panelMeta.loading = false; if(_segment === 0) { $scope.hits = 0; @@ -210,7 +216,6 @@ angular.module('kibana.table', []) // This breaks, use $scope.data for this $scope.all_fields = kbn.get_all_fields(_.pluck($scope.data,'_source')); - broadcast_results(); // If we're not sorting in reverse chrono order, query every index for // size*pages results @@ -242,23 +247,6 @@ angular.module('kibana.table', []) }; }; - // Broadcast a list of all fields. Note that receivers of field array - // events should be able to receive from multiple sources, merge, dedupe - // and sort on the fly if needed. - function broadcast_results() { - eventBus.broadcast($scope.$id,$scope.panel.group,"fields", { - all : $scope.all_fields, - sort : $scope.panel.sort, - active: $scope.panel.fields - }); - eventBus.broadcast($scope.$id,$scope.panel.group,"table_documents", - { - query: querySrv.list[querySrv.ids[0]].query, - docs : _.pluck($scope.data,'_source'), - index: $scope.index - }); - } - $scope.set_refresh = function (state) { $scope.refresh = state; }; diff --git a/panels/terms/module.js b/panels/terms/module.js index 2d791866e65..b70b71d3132 100644 --- a/panels/terms/module.js +++ b/panels/terms/module.js @@ -64,7 +64,7 @@ angular.module('kibana.terms', []) return; } - $scope.panel.loading = true; + $scope.panelMeta.loading = true; var request, results, boolQuery; @@ -97,7 +97,7 @@ angular.module('kibana.terms', []) // Populate scope when we have results results.then(function(results) { var k = 0; - $scope.panel.loading = false; + $scope.panelMeta.loading = false; $scope.hits = results.hits.total; $scope.data = []; _.each(results.facets.terms.terms, function(v) { diff --git a/panels/trends/module.js b/panels/trends/module.js index 97c5037efee..abf88a9c07b 100644 --- a/panels/trends/module.js +++ b/panels/trends/module.js @@ -47,7 +47,7 @@ angular.module('kibana.trends', []) $scope.get_data = function(segment,query_id) { delete $scope.panel.error; - $scope.panel.loading = true; + $scope.panelMeta.loading = true; // Make sure we have everything for the request to complete if(dashboard.indices.length === 0) { @@ -138,7 +138,7 @@ angular.module('kibana.trends', []) // Populate scope when we have results var process_results = function(results,_segment,query_id) { results.then(function(results) { - $scope.panel.loading = false; + $scope.panelMeta.loading = false; if(_segment === 0) { $scope.hits = {}; $scope.data = [];