Allow selection from all our gateways and relays. We currently only have

one of each, but it makes the point that we can deal with more.
This commit is contained in:
James Muscat 2015-04-15 17:08:18 +01:00
parent cd4f1d69c6
commit 4e57495348
2 changed files with 25 additions and 8 deletions

View File

@ -1,6 +1,3 @@
gateway_status_url = "http://eddn-gateway.elite-markets.net:8080/stats/";
relay_status_url = "http://eddn-relay.elite-markets.net:9090/stats/";
displayGatewayStats = function(stats) {
$("#gateway_inbound_1min").html((stats["inbound"] || {})["1min"] || 0);
$("#gateway_inbound_5min").html((stats["inbound"] || {})["5min"] || 0);
@ -50,6 +47,18 @@ doUpdate = function(url, success, failure) {
failure: failure
});
}
doUpdate(gateway_status_url, displayGatewayStats);
doUpdate(relay_status_url, displayRelayStats);
setInterval(function() {doUpdate(gateway_status_url, displayGatewayStats); doUpdate(relay_status_url, displayRelayStats)}, 60000);
getGatewayUrl = function() {
return $("#gateway").val();
}
getRelayUrl = function() {
return $("#relay").val();
}
$("#gateway").change(function() {alert(); doUpdate(getGatewayUrl(), displayGatewayStats);})
$("#relay").change(function() {doUpdate(getRelayUrl(), displayRelayStats);})
doUpdate(getGatewayUrl(), displayGatewayStats);
doUpdate(getRelayUrl(), displayRelayStats);
setInterval(function() {doUpdate(getGatewayUrl(), displayGatewayStats); doUpdate(getRelayUrl(), displayRelayStats)}, 60000);

View File

@ -31,7 +31,11 @@
<table class="table">
<thead>
<tr>
<td>eddn-gateway.elite-markets.net</td>
<td class="form-inline">
<select id="gateway" class="form-control">
<option value="http://eddn-gateway.elite-markets.net:8080/stats/">eddn-gateway.elite-markets.net</option>
</select>
</td>
<th>1 min</th>
<th>5 min</th>
<th>60 min</th>
@ -62,7 +66,11 @@
<table class="table">
<thead>
<tr>
<td>eddn-relay.elite-markets.net</td>
<td class="form-inline">
<select id="relay" class="form-control">
<option value="http://eddn-relay.elite-markets.net:9090/stats/">eddn-relay.elite-markets.net</option>
</select>
</td>
<th>1 min</th>
<th>5 min</th>
<th>60 min</th>