From 4e57495348b5dfdd76bba54e499c573dca01aa0c Mon Sep 17 00:00:00 2001 From: James Muscat Date: Wed, 15 Apr 2015 17:08:18 +0100 Subject: [PATCH] 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. --- contrib/status/js/eddn.js | 21 +++++++++++++++------ contrib/status/status.html | 12 ++++++++++-- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/contrib/status/js/eddn.js b/contrib/status/js/eddn.js index 95d1d40..45806a3 100644 --- a/contrib/status/js/eddn.js +++ b/contrib/status/js/eddn.js @@ -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); \ No newline at end of file + +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); \ No newline at end of file diff --git a/contrib/status/status.html b/contrib/status/status.html index 20b403c..c8a14ca 100644 --- a/contrib/status/status.html +++ b/contrib/status/status.html @@ -31,7 +31,11 @@ - + @@ -62,7 +66,11 @@
eddn-gateway.elite-markets.net + + 1 min 5 min 60 min
- +
eddn-relay.elite-markets.net + + 1 min 5 min 60 min