Network peer updates

-Added a new port_filter setting to the 3 network_page tables which allows showing only results from peers on the selected port
-Added a new hide_protocols setting to the 3 network_page tables which allows hiding results from peers on the selected protocols
-Added a Port column to the data table on the Network page Connections tab
-The data table on the Network page Connections tab is now sortable
-The peer sync now refreshes data for peers that existed since last sync
-Adding and updating peers now displays the port # in the log output
-The /ext/getnetworkpeers api is now sorted by ip4/ip6, address and port which also means all data on the Network page is sorted this way by default as well
-The /ext/getnetworkpeers api no longer requires the internal argument for calls originating from the Network page
-The Network page now only makes a single call to the /ext/getnetworkpeers api instead of 3 calls
-The find_peer and drop_peer functions now requiresa port to distinguish between multiple connections to the same peer on different ports
This commit is contained in:
Joe Uhren
2022-07-01 21:11:57 -06:00
parent fb5ce795fa
commit 8fa337f6f9
6 changed files with 245 additions and 151 deletions
+5 -5
View File
@@ -1242,8 +1242,8 @@ module.exports = {
});
},
find_peer: function(address, cb) {
Peers.findOne({address: address}, function(err, peer) {
find_peer: function(address, port, cb) {
Peers.findOne({address: address, port: port}, function(err, peer) {
if (err)
return cb(null);
else {
@@ -1255,8 +1255,8 @@ module.exports = {
});
},
drop_peer: function(address, cb) {
Peers.deleteOne({address: address}, function(err) {
drop_peer: function(address, port, cb) {
Peers.deleteOne({address: address, port: port}, function(err) {
if (err) {
console.log(err);
return cb();
@@ -1276,7 +1276,7 @@ module.exports = {
},
get_peers: function(cb) {
Peers.find({}, function(err, peers) {
Peers.find().sort({address: 1, port: 1}).exec(function (err, peers) {
if (err)
return cb([]);
else
+24 -3
View File
@@ -618,7 +618,14 @@ exports.network_page = {
// page_length_options: An array of page length options that determine how many items/records to display in the table at any given time
"page_length_options": [ 10, 25, 50, 75, 100 ],
// items_per_page: The default amount of items/records to display in the table at any given time
"items_per_page": 10
"items_per_page": 10,
// port_filter: Specify a port number to only allow showing peers on the selected port.
// Set this value to 0 to show all peers on any port.
"port_filter": 0,
// hide_protocols: An array of protocol numbers that will be filtered out of the table results
// If a peer connects to the explorer wallet with one of these protocol numbers, that record will not be displayed in this table
// Add as many protocol values as necessary in the following format: [ 0, 70803, 70819 ]
"hide_protocols": [ ]
},
// addnodes_table: a collection of settings that pertain to the add nodes table on the network page
// Table data is populated via the /ext/getnetworkpeers api
@@ -626,7 +633,14 @@ exports.network_page = {
// page_length_options: An array of page length options that determine how many items/records to display in the table at any given time
"page_length_options": [ 10, 25, 50, 75, 100 ],
// items_per_page: The default amount of items/records to display in the table at any given time
"items_per_page": 10
"items_per_page": 10,
// port_filter: Specify a port number to only allow showing peers on the selected port.
// Set this value to 0 to show all peers on any port.
"port_filter": 0,
// hide_protocols: An array of protocol numbers that will be filtered out of the table results
// If a peer connects to the explorer wallet with one of these protocol numbers, that record will not be displayed in this table
// Add as many protocol values as necessary in the following format: [ 0, 70803, 70819 ]
"hide_protocols": [ ]
},
// onetry_table: a collection of settings that pertain to the one try table on the network page
// Table data is populated via the /ext/getnetworkpeers api
@@ -634,7 +648,14 @@ exports.network_page = {
// page_length_options: An array of page length options that determine how many items/records to display in the table at any given time
"page_length_options": [ 10, 25, 50, 75, 100 ],
// items_per_page: The default amount of items/records to display in the table at any given time
"items_per_page": 10
"items_per_page": 10,
// port_filter: Specify a port number to only allow showing peers on the selected port.
// Set this value to 0 to show all peers on any port.
"port_filter": 0,
// hide_protocols: An array of protocol numbers that will be filtered out of the table results
// If a peer connects to the explorer wallet with one of these protocol numbers, that record will not be displayed in this table
// Add as many protocol values as necessary in the following format: [ 0, 70803, 70819 ]
"hide_protocols": [ ]
}
};