[FEATURE] rippled apitool - better reporting of connection status

This commit is contained in:
mDuo13
2015-06-18 00:11:06 -07:00
parent a7efe01c02
commit ae12cf57d6

View File

@@ -61,7 +61,13 @@ var urlParams;
}); });
remote.on('connect', function() { 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);
remote.connect(init);
} catch {
alert("Can't connect. Maybe blocked by cross-origin-scripting protections?");
}
if (window.location.hash) { if (window.location.hash) {
var cmd = window.location.hash.slice(1).toLowerCase(); var cmd = window.location.hash.slice(1).toLowerCase();