mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-08-24 16:05:07 +03:00
Merge pull request #33 from RiV-chain/coords_info
Coords info (RIVM-34)
This commit is contained in:
commit
9750f368ff
3 changed files with 27 additions and 3 deletions
|
@ -300,6 +300,7 @@ ui.getConnectedPeers = function () {
|
|||
ui.updateConnectedPeersHandler = function (peers) {
|
||||
ui.updateStatus(peers);
|
||||
ui.updateSpeed(peers);
|
||||
ui.updateCoordsInfo();
|
||||
$("peers").innerText = "";
|
||||
if (peers) {
|
||||
var regexStrip = /%[^\]]*/gm;
|
||||
|
@ -380,6 +381,7 @@ ui.updateSelfInfo = function () {
|
|||
return ui.getSelfInfo().then(function (info) {
|
||||
$("ipv6").innerText = info.address;
|
||||
$("subnet").innerText = info.subnet;
|
||||
$("coordinates").innerText = ''.concat('[',info.coords.join(' '),']');
|
||||
$("pub_key").innerText = info.key;
|
||||
$("priv_key").innerText = info.private_key;
|
||||
$("ipv6").innerText = info.address;
|
||||
|
@ -389,6 +391,14 @@ ui.updateSelfInfo = function () {
|
|||
});
|
||||
};
|
||||
|
||||
ui.updateCoordsInfo = function () {
|
||||
return ui.getSelfInfo().then(function (info) {
|
||||
$("coordinates").innerText = ''.concat('[',info.coords.join(' '),']');
|
||||
}).catch(function (error) {
|
||||
$("ipv6").innerText = error.message;
|
||||
});
|
||||
};
|
||||
|
||||
ui.sse = new EventSource('/api/sse');
|
||||
|
||||
function main() {
|
||||
|
@ -401,7 +411,6 @@ function main() {
|
|||
});
|
||||
|
||||
ui.updateSelfInfo();
|
||||
//setInterval(ui.updateSelfInfo, 5000);
|
||||
|
||||
ui.sse.addEventListener("ping", function (e) {
|
||||
var data = JSON.parse(e.data);
|
||||
|
|
|
@ -287,6 +287,7 @@ ui.getConnectedPeers = () =>
|
|||
ui.updateConnectedPeersHandler = (peers) => {
|
||||
ui.updateStatus(peers);
|
||||
ui.updateSpeed(peers);
|
||||
ui.updateCoordsInfo();
|
||||
$("peers").innerText = "";
|
||||
if(peers) {
|
||||
const regexStrip = /%[^\]]*/gm;
|
||||
|
@ -358,6 +359,7 @@ ui.updateSelfInfo = () =>
|
|||
.then((info) => {
|
||||
$("ipv6").innerText = info.address;
|
||||
$("subnet").innerText = info.subnet;
|
||||
$("coordinates").innerText = ''.concat('[',info.coords.join(' '),']');
|
||||
$("pub_key").innerText = info.key;
|
||||
$("priv_key").innerText = info.private_key;
|
||||
$("ipv6").innerText = info.address;
|
||||
|
@ -366,6 +368,14 @@ ui.updateSelfInfo = () =>
|
|||
$("ipv6").innerText = error.message;
|
||||
});
|
||||
|
||||
ui.updateCoordsInfo = function () {
|
||||
return ui.getSelfInfo().then(function (info) {
|
||||
$("coordinates").innerText = ''.concat('[',info.coords.join(' '),']');
|
||||
}).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