mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-08-25 08:25:07 +03:00
Added coords info foeld and update it with timer
This commit is contained in:
parent
7000bc3a10
commit
e0ff9c9994
3 changed files with 27 additions and 3 deletions
|
@ -363,6 +363,7 @@ ui.updateConnectedPeers = function () {
|
|||
$("peers").innerText = error.message;
|
||||
ui.updateStatus();
|
||||
ui.updateSpeed();
|
||||
ui.updateCoordsInfo();
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -384,6 +385,7 @@ ui.updateSelfInfo = function () {
|
|||
return ui.getSelfInfo().then(function (info) {
|
||||
$("ipv6").innerText = info.address;
|
||||
$("subnet").innerText = info.subnet;
|
||||
$("coordinates").innerText = info.coords;
|
||||
$("pub_key").innerText = info.key;
|
||||
$("priv_key").innerText = info.private_key;
|
||||
$("ipv6").innerText = info.address;
|
||||
|
@ -393,6 +395,14 @@ ui.updateSelfInfo = function () {
|
|||
});
|
||||
};
|
||||
|
||||
ui.updateCoordsInfo = function () {
|
||||
return ui.getSelfInfo().then(function (info) {
|
||||
$("coordinates").innerText = info.coords;
|
||||
}).catch(function (error) {
|
||||
$("ipv6").innerText = error.message;
|
||||
});
|
||||
};
|
||||
|
||||
ui.sse = new EventSource('/api/sse');
|
||||
|
||||
function main() {
|
||||
|
@ -406,7 +416,6 @@ function main() {
|
|||
setInterval(ui.updateConnectedPeers, 5000);
|
||||
|
||||
ui.updateSelfInfo();
|
||||
//setInterval(ui.updateSelfInfo, 5000);
|
||||
|
||||
ui.sse.addEventListener("ping", function (e) {
|
||||
var data = JSON.parse(e.data);
|
||||
|
|
|
@ -343,6 +343,7 @@ ui.updateConnectedPeers = () =>
|
|||
$("peers").innerText = error.message;
|
||||
ui.updateStatus();
|
||||
ui.updateSpeed();
|
||||
ui.updateCoordsInfo();
|
||||
});
|
||||
|
||||
ui.lookupCountryCodeByAddress = (address) => {
|
||||
|
@ -361,6 +362,7 @@ ui.updateSelfInfo = () =>
|
|||
.then((info) => {
|
||||
$("ipv6").innerText = info.address;
|
||||
$("subnet").innerText = info.subnet;
|
||||
$("coordinates").innerText = info.coords;
|
||||
$("pub_key").innerText = info.key;
|
||||
$("priv_key").innerText = info.private_key;
|
||||
$("ipv6").innerText = info.address;
|
||||
|
@ -369,6 +371,14 @@ ui.updateSelfInfo = () =>
|
|||
$("ipv6").innerText = error.message;
|
||||
});
|
||||
|
||||
ui.updateCoordsInfo = function () {
|
||||
return ui.getSelfInfo().then(function (info) {
|
||||
$("coordinates").innerText = info.coords;
|
||||
}).catch(function (error) {
|
||||
$("ipv6").innerText = error.message;
|
||||
});
|
||||
};
|
||||
|
||||
ui.sse = new EventSource('/api/sse');
|
||||
|
||||
function main() {
|
||||
|
|
|
@ -132,15 +132,20 @@
|
|||
</div>
|
||||
|
||||
<div class="container-ip">
|
||||
<div class="item">Coordinates</div>
|
||||
<div id="coordinates" class="item push-right">N/A</div>
|
||||
<div class="item">
|
||||
<a class="fas fa-copy" onclick="copy2clipboard(document.getElementById('coordinates').innerHTML);"></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-ip">
|
||||
<div class="item">Peers</div>
|
||||
<div id="peers" class="item over">
|
||||
|
||||
</div>
|
||||
<div class="item push-right">
|
||||
<a id="showAllPeersBtn" class="fas fa-edit"></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue