diff --git a/README.md b/README.md index 97e1d69..429b7cb 100644 --- a/README.md +++ b/README.md @@ -65,8 +65,13 @@ Crawler * @d47081: [BTC](https://www.blockchain.com/explorer/addresses/btc/bc1qngdf2kwty6djjqpk0ynkpq9wmlrmtm7e0c534y) | [LTC](https://live.blockcypher.com/ltc/address/LUSiqzKsfB1vBLvpu515DZktG9ioKqLyj7) | [XMR](835gSR1Uvka19gnWPkU2pyRozZugRZSPHDuFL6YajaAqjEtMwSPr4jafM8idRuBWo7AWD3pwFQSYRMRW9XezqrK4BEXBgXE) | [ZEPH](ZEPHsADHXqnhfWhXrRcXnyBQMucE3NM7Ng5ZVB99XwA38PTnbjLKpCwcQVgoie8EJuWozKgBiTmDFW4iY7fNEgSEWyAy4dotqtX) | Support our server by order [Linux VPS](https://www.yourserver.se/portal/aff.php?aff=610) #### License + * Engine sources [MIT License](https://github.com/YGGverse/YGGstate/blob/main/LICENSE) +#### Components + +* [SVG icons](https://icons.getbootstrap.com/) + #### Feedback Feel free to [share](https://github.com/YGGverse/YGGstate/issues) your ideas and bug reports! diff --git a/src/config/app.php.example b/src/config/app.php.example index 54dbeca..e97e248 100644 --- a/src/config/app.php.example +++ b/src/config/app.php.example @@ -73,6 +73,18 @@ define('WEBSITE_PEER_REMOTE_PAGINATION_LIMIT', 20); define('WEBSITE_PEER_PORT_CHECK_TIMEOUT', 60 * 5); // API +define('API_PEER_FIELDS', (array) + [ + 'bytes_recvd', + 'bytes_sent', + 'coords', + 'key', + 'port', + 'uptime', + // ... + ] +); + define('API_PEERS', (object) [ 'tls://94.140.114.241:4708' => WEBSITE_URL, diff --git a/src/crontab/crawler.php b/src/crontab/crawler.php index 20020cb..2f108ea 100644 --- a/src/crontab/crawler.php +++ b/src/crontab/crawler.php @@ -134,29 +134,38 @@ try { @unlink(__DIR__ . '/../public/api/trackers.json'); // Update peers -if ($connectedPeers = Yggverse\Yggdrasilctl\Yggdrasil::getPeers()) { - - if ($handle = fopen(__DIR__ . '/../public/api/peers.json', 'w+')) { - fwrite($handle, json_encode($connectedPeers)); - fclose($handle); - } - -} else { - +if (!$connectedPeers = Yggverse\Yggdrasilctl\Yggdrasil::getPeers()) +{ exit; } -// Update trackers -if (API_PEERS) { +// Update peers - if ($handle = fopen(__DIR__ . '/../public/api/trackers.json', 'w+')) { - fwrite($handle, json_encode(API_PEERS)); - fclose($handle); +/// Remove remote addresses +$jsonPeers = []; +foreach ($connectedPeers as $connectedPeerAddress => $connectedPeerInfo) +{ + foreach ($connectedPeerInfo as $connectedPeerInfoKey => $connectedPeerInfoValue) + { + if (in_array($connectedPeerInfoKey, (array) API_PEER_FIELDS)) + { + $jsonPeers[$connectedPeerAddress][$connectedPeerInfoKey] = $connectedPeerInfoValue; + } } +} -} else { +/// Save dump +if ($handle = fopen(__DIR__ . '/../public/api/peers.json', 'w+')) +{ + fwrite($handle, json_encode($jsonPeers)); + fclose($handle); +} - exit; +// Update trackers +if ($handle = fopen(__DIR__ . '/../public/api/trackers.json', 'w+')) +{ + fwrite($handle, json_encode(API_PEERS)); + fclose($handle); } // @TODO merge peers data from remote trackers diff --git a/src/public/assets/theme/default/css/framework.css b/src/public/assets/theme/default/css/framework.css index a4e6553..0bb1afc 100644 --- a/src/public/assets/theme/default/css/framework.css +++ b/src/public/assets/theme/default/css/framework.css @@ -130,6 +130,10 @@ /* responsive rules */ +.width-13-px { + width: 13px; +} + .width-100 { width: 100%; } @@ -138,6 +142,10 @@ width: 50%; } +.no-wrap { + white-space: nowrap; +} + @media (max-width: 1220px) { .width-tablet-100 { diff --git a/src/public/peer.php b/src/public/peer.php index c6d57c9..4d1f55e 100644 --- a/src/public/peer.php +++ b/src/public/peer.php @@ -232,7 +232,6 @@ $peerPortStatuses = $db->findLastPeerPortStatusesByPeerId($requestPeerId); - @@ -246,12 +245,21 @@ $peerPortStatuses = $db->findLastPeerPortStatusesByPeerId($requestPeerId); - + - - - + address == $_SERVER['REMOTE_ADDR']) { ?> + + + + + + + + + + + @@ -269,8 +277,12 @@ $peerPortStatuses = $db->findLastPeerPortStatusesByPeerId($requestPeerId); $peerRemoteConnection) { ?> - timeAdded) ?> - remote ?> + timeAdded) ?> + address == $_SERVER['REMOTE_ADDR']) { ?> + + remote ?> + + connectionPort ?> route ?>