Commit f7c0e428 by Rashid Khan

Merge pull request #479 from rashidkpc/master

Fix array value delimiting in table, improve nginx config, fix indenting
parents d72c72b3 7ab2a534
...@@ -32,18 +32,23 @@ angular.module('kibana.filters', []) ...@@ -32,18 +32,23 @@ angular.module('kibana.filters', [])
return arr.toString(); return arr.toString();
} }
}; };
}).filter('noXml', function() { }).filter('noXml', function() {
return function(text) { var noXml = function(text) {
if(!_.isString(text)) { return _.isString(text) ?
return text; text.
}
return text.
replace(/&/g, '&'). replace(/&/g, '&').
replace(/</g, '&lt;'). replace(/</g, '&lt;').
replace(/>/g, '&gt;'). replace(/>/g, '&gt;').
replace(/'/g, '&#39;'). replace(/'/g, '&#39;').
replace(/"/g, '&quot;'); replace(/"/g, '&quot;') :
text;
};
return function(text) {
return _.isArray(text) ?
_.map(text,function(t) {
return noXml(t);
}) :
noXml(text);
}; };
}).filter('urlLink', function() { }).filter('urlLink', function() {
var //URLs starting with http://, https://, or ftp:// var //URLs starting with http://, https://, or ftp://
...@@ -53,20 +58,35 @@ angular.module('kibana.filters', []) ...@@ -53,20 +58,35 @@ angular.module('kibana.filters', [])
//Change email addresses to mailto:: links. //Change email addresses to mailto:: links.
r3 = /(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6})/gim; 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)) { if(!_.isString(text)) {
return text; return text;
} else {
var i=1;
_.each(text.match(r1), function(url) {
t1 = text.replace(r1, "<a href=\"$1\" target=\"_blank\">$1</a>");
});
text = t1 || text;
_.each(text.match(r2), function(url) {
t2 = text.replace(r2, "$1<a href=\"http://$2\" target=\"_blank\">$2</a>");
});
text = t2 || text;
_.each(text.match(r3), function(url) {
t3 = text.replace(r3, "<a href=\"mailto:$1\">$1</a>");
});
text = t3 || text;
return text;
} }
_.each(text.match(r1), function(url) { };
text = text.replace(r1, "<a href=\"$1\" target=\"_blank\">$1</a>");
}); return function(text, target, otherProp) {
_.each(text.match(r2), function(url) {
text = text.replace(r2, "$1<a href=\"http://$2\" target=\"_blank\">$2</a>"); return _.isArray(text) ?
}); _.map(text,function(t) {
_.each(text.match(r3), function(url) { return urlLink(t);
text = text.replace(r3, "<a href=\"mailto:$1\">$1</a>"); }) :
}); urlLink(text);
return text;
}; };
}).filter('gistid', function() { }).filter('gistid', function() {
var gist_pattern = /(\d{5,})|([a-z0-9]{10,})|(gist.github.com(\/*.*)\/[a-z0-9]{5,}\/*$)/; var gist_pattern = /(\d{5,})|([a-z0-9]{10,})|(gist.github.com(\/*.*)\/[a-z0-9]{5,}\/*$)/;
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<i class='icon-ban-circle pointer' ng-click="build_search(key,value,true)"></i> <i class='icon-ban-circle pointer' ng-click="build_search(key,value,true)"></i>
</td> </td>
<!-- At some point we need to create a more efficient way of applying the filter pipeline --> <!-- At some point we need to create a more efficient way of applying the filter pipeline -->
<td style="white-space:pre-wrap" ng-bind-html-unsafe="value|noXml|urlLink"></td> <td style="white-space:pre-wrap" ng-bind-html-unsafe="value|noXml|urlLink|stringify"></td>
</tr> </tr>
</table> </table>
</td> </td>
......
...@@ -267,6 +267,7 @@ angular.module('kibana.table', []) ...@@ -267,6 +267,7 @@ angular.module('kibana.table', [])
}) })
// This also escapes some xml sequences
.filter('tableHighlight', function() { .filter('tableHighlight', function() {
return function(text) { return function(text) {
if (!_.isUndefined(text) && !_.isNull(text) && text.toString().length > 0) { if (!_.isUndefined(text) && !_.isNull(text) && text.toString().length > 0) {
......
...@@ -38,13 +38,19 @@ server { ...@@ -38,13 +38,19 @@ server {
location ~ ^/kibana-int/dashboard/.*$ { location ~ ^/kibana-int/dashboard/.*$ {
proxy_pass http://127.0.0.1:9200; proxy_pass http://127.0.0.1:9200;
proxy_read_timeout 90; proxy_read_timeout 90;
auth_basic "Restricted"; limit_except GET {
auth_basic_user_file /etc/nginx/conf.d/kibana.myhost.org.htpasswd; 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.*$ { location ~ ^/kibana-int/temp.*$ {
proxy_pass http://127.0.0.1:9200; proxy_pass http://127.0.0.1:9200;
proxy_read_timeout 90; proxy_read_timeout 90;
auth_basic "Restricted"; limit_except GET {
auth_basic_user_file /etc/nginx/conf.d/kibana.myhost.org.htpasswd; 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment