mirror of
https://github.com/PurpleI2P/i2pd-tools.git
synced 2025-01-22 13:27:17 +01:00
fix
This commit is contained in:
parent
4eb0c42a7e
commit
04a20aff7b
|
@ -137,7 +137,7 @@ function logit(msg) {
|
||||||
function socketClosed() {
|
function socketClosed() {
|
||||||
var b = document.getElementById("connect-button");
|
var b = document.getElementById("connect-button");
|
||||||
b.onclick = startui
|
b.onclick = startui
|
||||||
b.value = "connect";
|
b.innerHTML = "connect";
|
||||||
}
|
}
|
||||||
|
|
||||||
function startui() {
|
function startui() {
|
||||||
|
@ -150,13 +150,21 @@ function startui() {
|
||||||
|
|
||||||
var ws = new WebSocket(url);
|
var ws = new WebSocket(url);
|
||||||
ws.onclose = function (ev) {
|
ws.onclose = function (ev) {
|
||||||
logit("failed to connect to "+url);
|
if (ev.code == 1000)
|
||||||
|
logit("connection closed");
|
||||||
|
else
|
||||||
|
logit("failed to connect to "+url);
|
||||||
nodes = { length: 0 };
|
nodes = { length: 0 };
|
||||||
tpeers = { length: 0 };
|
tpeers = { length: 0 };
|
||||||
socketClosed();
|
socketClosed();
|
||||||
}
|
}
|
||||||
ws.onopen = function(ev) {
|
ws.onopen = function(ev) {
|
||||||
logit("connected to "+url);
|
logit("connected to "+url);
|
||||||
|
var b = document.getElementById("connect-button");
|
||||||
|
b.onclick = function() {
|
||||||
|
ws.close();
|
||||||
|
}
|
||||||
|
b.innerHTML = "disconnect";
|
||||||
}
|
}
|
||||||
ws.onmessage = function(ev) {
|
ws.onmessage = function(ev) {
|
||||||
var j = JSON.parse(ev.data);
|
var j = JSON.parse(ev.data);
|
||||||
|
@ -185,11 +193,6 @@ function startui() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var b = document.getElementById("connect-button");
|
|
||||||
b.onclick = function() {
|
|
||||||
ws.close();
|
|
||||||
}
|
|
||||||
b.value = "disconnect";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPeer(h, us) {
|
function getPeer(h, us) {
|
||||||
|
|
Loading…
Reference in a new issue