diff --git a/js/filters.js b/js/filters.js index d5dba67fa35..241497d8897 100644 --- a/js/filters.js +++ b/js/filters.js @@ -32,4 +32,40 @@ angular.module('kibana.filters', []) return arr.toString(); } }; + +}).filter('noXml', function() { + return function(text) { + if(!_.isString(text)) { + return text; + } + return text. + replace(/&/g, '&'). + replace(//g, '>'). + replace(/'/g, '''). + replace(/"/g, '"'); + }; +}).filter('urlLink', function() { + var //URLs starting with http://, https://, or ftp:// + r1 = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim, + //URLs starting with "www." (without // before it, or it'd re-link the ones done above). + r2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim, + //Change email addresses to mailto:: links. + r3 = /(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6})/gim; + + return function(text, target, otherProp) { + if(!_.isString(text)) { + return text; + } + _.each(text.match(r1), function(url) { + text = text.replace(r1, "$1"); + }); + _.each(text.match(r2), function(url) { + text = text.replace(r2, "$1$2"); + }); + _.each(text.match(r3), function(url) { + text = text.replace(r3, "$1"); + }); + return text; + }; }); \ No newline at end of file diff --git a/js/services.js b/js/services.js index 5d3b03e7de5..c2547358827 100644 --- a/js/services.js +++ b/js/services.js @@ -11,11 +11,21 @@ angular.module('kibana.services', []) this.list = []; this.set = function(title,text,severity,timeout) { - var _a = { - title: title || '', - text: text || '', - severity: severity || 'info', - }; + var + _a = { + title: title || '', + text: text || '', + severity: severity || 'info', + }, + _ca = angular.toJson(_a), + _clist = _.map(self.list,function(alert){return angular.toJson(alert);}); + + // If we already have this alert, remove it and add a new one + // Why do this instead of skipping the add because it resets the timer + if(_.contains(_clist,_ca)) { + _.remove(self.list,_.indexOf(_clist,_ca)); + } + self.list.push(_a); if (timeout > 0) { $timeout(function() { diff --git a/panels/histogram/editor.html b/panels/histogram/editor.html index 30be4aacbc7..8defd4a1db8 100644 --- a/panels/histogram/editor.html +++ b/panels/histogram/editor.html @@ -1,6 +1,6 @@
- +
@@ -15,47 +15,58 @@ In {{panel.mode}} mode the configured field must be a numeric type
+
Chart Settings
-
Chart Settings
- +
- +
- +
-
-
+
+
- +
-
+
-
+
-
+
-
+
-
+
-
+
+
Tooltip Settings
+
+
+ + +
+
+ + +
+
\ No newline at end of file diff --git a/panels/histogram/module.js b/panels/histogram/module.js index 84beb1d1b3b..7a410dd610f 100644 --- a/panels/histogram/module.js +++ b/panels/histogram/module.js @@ -72,6 +72,10 @@ angular.module('kibana.histogram', []) 'y-axis' : true, percentage : false, interactive : true, + tooltip : { + value_type: 'cumulative', + query_as_alias: false + } }; _.defaults($scope.panel,_d); @@ -426,21 +430,24 @@ angular.module('kibana.histogram', []) var $tooltip = $('
'); elem.bind("plothover", function (event, pos, item) { - var grouping; + var group, value; if (item) { - if (item.series.info.alias) { - grouping = '' + + if (item.series.info.alias || scope.panel.tooltip.query_as_alias) { + group = '' + '' + ' ' + - item.series.info.alias + + (item.series.info.alias || item.series.info.query)+ '
'; } else { - grouping = kbn.query_color_dot(item.series.color, 15) + ' '; + group = kbn.query_color_dot(item.series.color, 15) + ' '; + } + if (scope.panel.stack && scope.panel.tooltip.value_type === 'individual') { + value = item.datapoint[1] - item.datapoint[2]; + } else { + value = item.datapoint[1]; } $tooltip .html( - grouping + - item.datapoint[1].toFixed(0) + " @ " + - moment(item.datapoint[0]).format('MM/DD HH:mm:ss') + group + value + " @ " + moment(item.datapoint[0]).format('MM/DD HH:mm:ss') ) .place_tt(pos.pageX, pos.pageY); } else { diff --git a/panels/query/module.html b/panels/query/module.html index 2a965c38e77..2e2e8bc3903 100644 --- a/panels/query/module.html +++ b/panels/query/module.html @@ -45,9 +45,9 @@