From ae12cf57d690d4890d3389557786899907ec4ea5 Mon Sep 17 00:00:00 2001 From: mDuo13 Date: Thu, 18 Jun 2015 00:11:06 -0700 Subject: [PATCH] [FEATURE] rippled apitool - better reporting of connection status --- js/apitool-websocket.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/js/apitool-websocket.js b/js/apitool-websocket.js index 9d6cf58509..36ee361990 100644 --- a/js/apitool-websocket.js +++ b/js/apitool-websocket.js @@ -61,7 +61,13 @@ var urlParams; }); remote.on('connect', function() { - set_online_state('connected'); + var msg = "connected"; + if (remote._servers.length === 1) { + msg = "connected to "+remote._servers[0].getHostID(); + } else if (remote._servers.length > 1) { + msg = "connected to "+remote._servers.length+" servers"; + } + set_online_state(msg); }); /* ---- ---- ---- ---- ---- */ @@ -699,11 +705,7 @@ var urlParams; }); } - try { - remote.connect(init); - } catch { - alert("Can't connect. Maybe blocked by cross-origin-scripting protections?"); - } + remote.connect(init); if (window.location.hash) { var cmd = window.location.hash.slice(1).toLowerCase();