mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-08-24 16:05:07 +03:00
put join instead of replace
This commit is contained in:
parent
9e5ed66dbb
commit
369e878f57
2 changed files with 2 additions and 10 deletions
|
@ -381,15 +381,11 @@ ui.getSelfInfo = function () {
|
|||
});
|
||||
};
|
||||
|
||||
function replaceAll(string, search, replace) {
|
||||
return string.split(search).join(replace);
|
||||
}
|
||||
|
||||
ui.updateSelfInfo = function () {
|
||||
return ui.getSelfInfo().then(function (info) {
|
||||
$("ipv6").innerText = info.address;
|
||||
$("subnet").innerText = info.subnet;
|
||||
$("coordinates").innerText = replaceAll(JSON.stringify(info.coords), ',', ' ');
|
||||
$("coordinates").innerText = ''.concat('[',info.coords.join(' '),']');
|
||||
$("pub_key").innerText = info.key;
|
||||
$("priv_key").innerText = info.private_key;
|
||||
$("ipv6").innerText = info.address;
|
||||
|
|
|
@ -357,16 +357,12 @@ ui.getSelfInfo = () =>
|
|||
fetch('api/self')
|
||||
.then((response) => response.json())
|
||||
|
||||
function replaceAll(string, search, replace) {
|
||||
return string.split(search).join(replace);
|
||||
}
|
||||
|
||||
ui.updateSelfInfo = () =>
|
||||
ui.getSelfInfo()
|
||||
.then((info) => {
|
||||
$("ipv6").innerText = info.address;
|
||||
$("subnet").innerText = info.subnet;
|
||||
$("coordinates").innerText = "".concat('[',replaceAll(info.coords, ',', ' '),']');
|
||||
$("coordinates").innerText = ''.concat('[',info.coords.join(' '),']');
|
||||
$("pub_key").innerText = info.key;
|
||||
$("priv_key").innerText = info.private_key;
|
||||
$("ipv6").innerText = info.address;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue