From a428f9e5deb100e0d7a1c6b210cb41127dfd24c8 Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Fri, 6 Sep 2013 14:38:01 -0700 Subject: [PATCH 1/3] Fix nginx.conf after switching dashboard load to GET --- sample/nginx.conf | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sample/nginx.conf b/sample/nginx.conf index 50a365ade84f4..3af4ea2d0b63e 100644 --- a/sample/nginx.conf +++ b/sample/nginx.conf @@ -38,13 +38,19 @@ server { location ~ ^/kibana-int/dashboard/.*$ { proxy_pass http://127.0.0.1:9200; proxy_read_timeout 90; - auth_basic "Restricted"; - auth_basic_user_file /etc/nginx/conf.d/kibana.myhost.org.htpasswd; + limit_except GET { + proxy_pass http://127.0.0.1:9200; + auth_basic "Restricted"; + auth_basic_user_file /etc/nginx/conf.d/kibana.myhost.org.htpasswd; + } } location ~ ^/kibana-int/temp.*$ { proxy_pass http://127.0.0.1:9200; proxy_read_timeout 90; - auth_basic "Restricted"; - auth_basic_user_file /etc/nginx/conf.d/kibana.myhost.org.htpasswd; + limit_except GET { + proxy_pass http://127.0.0.1:9200; + auth_basic "Restricted"; + auth_basic_user_file /etc/nginx/conf.d/kibana.myhost.org.htpasswd; + } } -} \ No newline at end of file +} From e071366bbf9139fce45781a503f0f922d4db263d Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Tue, 10 Sep 2013 14:34:45 -0700 Subject: [PATCH 2/3] fixed unlinted line --- js/services.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/services.js b/js/services.js index d694062f3fdc0..f2c6addd3d002 100644 --- a/js/services.js +++ b/js/services.js @@ -89,7 +89,7 @@ angular.module('kibana.services', []) if(status === 0) { alertSrv.set('Error',"Could not contact Elasticsearch at "+config.elasticsearch+ ". Please ensure that Elasticsearch is reachable from your system." ,'error'); - } else { + } else { alertSrv.set('Error',"No index found at "+config.elasticsearch+"/" + indices.join(',')+"/_mapping. Please create at least one index." + "If you're using a proxy ensure it is configured correctly.",'error'); From 7ab2a5349a52a15695d2f8fca541f880f474f4a0 Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Wed, 11 Sep 2013 11:14:05 -0700 Subject: [PATCH 3/3] Closes #477, closes #464. Also fixes urlLink and noXml filters on array fields --- js/filters.js | 56 +++++++++++++++++++++++++++------------- panels/table/module.html | 2 +- panels/table/module.js | 1 + 3 files changed, 40 insertions(+), 19 deletions(-) diff --git a/js/filters.js b/js/filters.js index fb60c2486488c..7f25a12f80cc1 100644 --- a/js/filters.js +++ b/js/filters.js @@ -32,18 +32,23 @@ angular.module('kibana.filters', []) return arr.toString(); } }; - }).filter('noXml', function() { - return function(text) { - if(!_.isString(text)) { - return text; - } - return text. + var noXml = function(text) { + return _.isString(text) ? + text. replace(/&/g, '&'). replace(//g, '>'). replace(/'/g, '''). - replace(/"/g, '"'); + replace(/"/g, '"') : + text; + }; + return function(text) { + return _.isArray(text) ? + _.map(text,function(t) { + return noXml(t); + }) : + noXml(text); }; }).filter('urlLink', function() { var //URLs starting with http://, https://, or ftp:// @@ -53,20 +58,35 @@ angular.module('kibana.filters', []) //Change email addresses to mailto:: links. r3 = /(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6})/gim; - return function(text, target, otherProp) { + var urlLink = function(text) { + var t1,t2,t3; if(!_.isString(text)) { return text; + } else { + var i=1; + _.each(text.match(r1), function(url) { + t1 = text.replace(r1, "$1"); + }); + text = t1 || text; + _.each(text.match(r2), function(url) { + t2 = text.replace(r2, "$1$2"); + }); + text = t2 || text; + _.each(text.match(r3), function(url) { + t3 = text.replace(r3, "$1"); + }); + text = t3 || 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; + }; + + return function(text, target, otherProp) { + + return _.isArray(text) ? + _.map(text,function(t) { + return urlLink(t); + }) : + urlLink(text); }; }).filter('gistid', function() { var gist_pattern = /(\d{5,})|([a-z0-9]{10,})|(gist.github.com(\/*.*)\/[a-z0-9]{5,}\/*$)/; diff --git a/panels/table/module.html b/panels/table/module.html index c872549f9cb8b..92f3bdce87d11 100644 --- a/panels/table/module.html +++ b/panels/table/module.html @@ -75,7 +75,7 @@
Fields - + diff --git a/panels/table/module.js b/panels/table/module.js index 52c7367548e62..0b2f62b3cdf3f 100644 --- a/panels/table/module.js +++ b/panels/table/module.js @@ -267,6 +267,7 @@ angular.module('kibana.table', []) }) +// This also escapes some xml sequences .filter('tableHighlight', function() { return function(text) { if (!_.isUndefined(text) && !_.isNull(text) && text.toString().length > 0) {