Skip to content

Commit fc46901

Browse files
committed
Add ability to specify host
Useful for proxies or situations where the cluster is not on localhost
1 parent b091986 commit fc46901

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

_site/index.html

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ <h2>Background Information</h2>
8383

8484
<div class="navbar navbar-inverse navbar-fixed-top">
8585
<div class="navbar-inner">
86-
<div class="container" style="margin-top:5px">
86+
<div class="container" style="margin-top:5px; width:1040px">
8787
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
8888
<span class="icon-bar"></span>
8989
<span class="icon-bar"></span>
@@ -92,7 +92,12 @@ <h2>Background Information</h2>
9292
<a class="brand" href="#/">SegmentSpy</a>
9393
<div class="nav-collapse collapse">
9494
<ul class="nav">
95-
95+
<li style="margin-left:30px">
96+
<form class="form-inline">
97+
<input type="text" class="input-small" id="host" value="http://localhost:9200" style="margin-top:4px; width:150px"/>
98+
<button class="btn" type="button" id="changeHost">Change Host</button>
99+
</form>
100+
</li>
96101
<li style="margin-left:30px">
97102
<div class="btn-group">
98103
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
@@ -103,13 +108,13 @@ <h2>Background Information</h2>
103108
</ul>
104109
</div>
105110
</li>
106-
<li style="margin-left:60px">
111+
<li style="margin-left:30px">
107112
<form class="form-inline">
108113
<input type="text" class="input-small" id="refreshInterval" value="500" style="margin-top:4px; width:50px"/>
109114
<button class="btn" type="button" id="changeRefresh">Change Refresh (ms)</button>
110115
</form>
111116
</li>
112-
<li style="margin-left:60px"><button class="btn btn-danger" type="button" id="pause">Pause</button></li>
117+
<li style="margin-left:30px"><button class="btn btn-danger" type="button" id="pause">Pause</button></li>
113118
</ul>
114119
</div><!--/.nav-collapse -->
115120
</div>

_site/js/app.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ $(document).ready(function () {
4242
context.loadIndices();
4343
context.jq_pauseButton();
4444
context.jq_refreshInterval();
45+
context.jq_changeHostButton();
46+
$("#host").val(global.host);
4547
global.loaded = true;
4648
}
4749
},
@@ -58,6 +60,13 @@ $(document).ready(function () {
5860
$(this).toggleClass('btn-danger btn-success');
5961
});
6062
},
63+
64+
jq_changeHostButton: function() {
65+
$("#changeHost").click(function(e) {
66+
global.host = $("#host").val().replace(/http:\/\//g,"");
67+
68+
});
69+
},
6170

6271
jq_refreshInterval: function() {
6372
$("#changeRefresh").click(function(e) {

0 commit comments

Comments
 (0)