File tree Expand file tree Collapse file tree 3 files changed +24
-17
lines changed Expand file tree Collapse file tree 3 files changed +24
-17
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,15 @@ This will automatically download the latest version of elasticsearch-head from g
21
21
* is available at "http://localhost:9200/_plugin/head/":http://localhost:9200/_plugin/head/ (or whatever the address of your cluster is)
22
22
* Will not work with elasticsearch prior to version 0.17
23
23
24
+ h5. URL Parameters
25
+
26
+ Parameters may be appended to the url set some initial state eg. @head/index.html?base_uri=http://node-01.example.com:9200@
27
+
28
+ * @base_uri@ force elasticsearch-head to connect to a particular node.
29
+ * @auth_user@ adds basic auth credentials to http requests ( requires "elasticsearch-http-basic":https://github.com/karussell/elasticsearch-http-basic plugin)
30
+ * @auth_password@ basic auth password as above (note: without "additional security layers":http://security.stackexchange.com/questions/988/is-basic-auth-secure-if-done-over-https, passwords are sent over the network *in the clear* )
31
+
32
+
24
33
h4. Running as a standalone webapp
25
34
26
35
* @git clone git://github.com/mobz/elasticsearch-head.git@
Original file line number Diff line number Diff line change 38
38
var args = location . search . substring ( 1 ) . split ( "&" ) . reduce ( function ( r , p ) {
39
39
r [ decodeURIComponent ( p . split ( "=" ) [ 0 ] ) ] = decodeURIComponent ( p . split ( "=" ) [ 1 ] ) ; return r ;
40
40
} , { } ) ;
41
- new es . ElasticSearchHead ( "body" ,
42
- { id : "es" ,
43
- base_uri : args [ "base_uri" ] || base_uri ,
44
- login : args [ "auth_login " ] || "" ,
45
- password : args [ "auth_password" ]
46
- } ) ;
41
+ new es . ElasticSearchHead ( "body" , {
42
+ id : "es" ,
43
+ base_uri : args [ "base_uri" ] || base_uri ,
44
+ auth_user : args [ "auth_user " ] || "" ,
45
+ auth_password : args [ "auth_password" ]
46
+ } ) ;
47
47
} ) ;
48
48
</ script >
49
49
< link rel ="icon " href ="lib/es/images/favicon.png " type ="image/png ">
Original file line number Diff line number Diff line change 1348
1348
init : function ( parent ) {
1349
1349
this . _super ( ) ;
1350
1350
this . base_uri = this . config . base_uri ;
1351
- if ( this . base_uri . charAt ( this . base_uri . length - 1 ) !== "/" ) {
1351
+ if ( this . base_uri . charAt ( this . base_uri . length - 1 ) !== "/" ) {
1352
1352
// XHR request fails if the URL is not ending with a "/"
1353
1353
this . base_uri += "/" ;
1354
1354
}
1355
-
1356
- if ( this . config . login && this . config . login . length > 0 ) {
1357
- var userAndPw = this . config . login + ":" + this . config . password ;
1358
- var credentials = window . btoa ( userAndPw ) ;
1359
- $ . ajaxSetup ( {
1360
- headers : {
1361
- 'Authorization' : "Basic " + credentials
1362
- }
1363
- } ) ;
1364
- }
1355
+ if ( this . config . auth_user ) {
1356
+ var credentials = window . btoa ( this . config . auth_user + ":" + this . config . auth_password ) ;
1357
+ $ . ajaxSetup ( {
1358
+ headers : {
1359
+ "Authorization" : "Basic " + credentials
1360
+ }
1361
+ } ) ;
1362
+ }
1365
1363
this . cluster = new es . Cluster ( { base_uri : this . base_uri } ) ;
1366
1364
this . _initElements ( parent ) ;
1367
1365
this . instances = { } ;
You can’t perform that action at this time.
0 commit comments