Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flexible dep management #484

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .jshintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/*
dist/*
sample/*
src/vendor/*
src/app/panels/*/{lib,leaflet}/*
63 changes: 28 additions & 35 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -1,40 +1,33 @@
{
"jquery": true,
"browser": true,
"browser": true,

"bitwise":false,
"curly": true,
"eqnull": true,
"globalstrict": true,
"devel": true,
"eqeqeq": true,
"forin": false,
"immed": true,
"supernew": true,
"expr": true,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
"noempty": true,
"undef": true,
"boss": true,
"trailing": false,
"laxbreak": true,
"laxcomma": true,
"sub": true,
"bitwise":false,
"curly": true,
"eqnull": true,
"globalstrict": true,
"devel": true,
"eqeqeq": true,
"forin": false,
"immed": true,
"supernew": true,
"expr": true,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
"noempty": true,
"undef": true,
"boss": true,
"trailing": false,
"laxbreak": true,
"laxcomma": true,
"sub": true,
"unused": true,

"maxlen": 140,
"maxlen": 140,

"globals": {
"$LAB": false,
"_": false,
"$": false,
"kbn" : false,
"angular" : false,
"exports": true,
"module": false,
"config": false,
"moment": false
}
"globals": {
"define": true,
"require": true
}
}
259 changes: 259 additions & 0 deletions 58ccc2985b^...7ab2a5349a.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,259 @@
From a428f9e5deb100e0d7a1c6b210cb41127dfd24c8 Mon Sep 17 00:00:00 2001
From: Rashid Khan <[email protected]>
Date: Fri, 6 Sep 2013 14:38:01 -0700
Subject: [PATCH 1/5] 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 50a365a..3af4ea2 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
+}
--
1.8.4


From 6a9a2b95b13346c523351175bc5fac5d43b3a674 Mon Sep 17 00:00:00 2001
From: Stephen Wood <[email protected]>
Date: Fri, 6 Sep 2013 16:23:33 -0700
Subject: [PATCH 2/5] Clarify error message.

Elasticsearch will throw a 404 if there is no indexes added yet, resulting in
this unclear message -- even for people that are not using any sort of proxy.

This message update should make it easier to quickly troubleshoot why the
the dialogue is popping up.
---
js/services.js | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/js/services.js b/js/services.js
index 1d309f5..d694062 100644
--- a/js/services.js
+++ b/js/services.js
@@ -89,9 +89,10 @@ 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 {
- alertSrv.set('Error',"Could not find "+config.elasticsearch+"/"+indices.join(',')+"/_mapping. If you"+
- " are using a proxy, ensure it is configured correctly",'error');
+ } 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');
}
});

@@ -963,4 +964,4 @@ angular.module('kibana.services', [])
return false;
});
};
-});
\ No newline at end of file
+});
--
1.8.4


From e071366bbf9139fce45781a503f0f922d4db263d Mon Sep 17 00:00:00 2001
From: Rashid Khan <[email protected]>
Date: Tue, 10 Sep 2013 14:34:45 -0700
Subject: [PATCH 3/5] 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 d694062..f2c6add 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');
--
1.8.4


From d72c72b3dfea036cc2238f63a38625f0ac1b40ac Mon Sep 17 00:00:00 2001
From: Spencer Alger <[email protected]>
Date: Tue, 10 Sep 2013 23:25:09 -0700
Subject: [PATCH 4/5] fixing indent issue

---
js/services.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/js/services.js b/js/services.js
index d694062..f2c6add 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');
--
1.8.4


From 7ab2a5349a52a15695d2f8fca541f880f474f4a0 Mon Sep 17 00:00:00 2001
From: Rashid Khan <[email protected]>
Date: Wed, 11 Sep 2013 11:14:05 -0700
Subject: [PATCH 5/5] 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 fb60c24..7f25a12 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, '&amp;').
replace(/</g, '&lt;').
replace(/>/g, '&gt;').
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() {
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, "<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>");
- });
- _.each(text.match(r2), function(url) {
- text = text.replace(r2, "$1<a href=\"http://$2\" target=\"_blank\">$2</a>");
- });
- _.each(text.match(r3), function(url) {
- text = text.replace(r3, "<a href=\"mailto:$1\">$1</a>");
- });
- 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 c872549..92f3bdc 100644
--- a/panels/table/module.html
+++ b/panels/table/module.html
@@ -75,7 +75,7 @@
<i class='icon-ban-circle pointer' ng-click="build_search(key,value,true)"></i>
</td>
<!-- 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>
</table>
</td>
diff --git a/panels/table/module.js b/panels/table/module.js
index 52c7367..0b2f62b 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) {
--
1.8.4
Loading