WebUI: add I2P peers to peer list

The WebUI part of the changes for #23061. Now qBittorrent will display I2P peers in WebUI peers tab.
Fixes the second part of #19794 ("i2p peer list does not show in GUI").

PR #23185.
This commit is contained in:
anikey
2025-09-05 12:40:25 +00:00
committed by GitHub
parent ac31fe52e9
commit 56277d5e2b
2 changed files with 8 additions and 10 deletions

View File

@@ -1829,7 +1829,7 @@ window.qBittorrent.DynamicTable ??= (() => {
class TorrentPeersTable extends DynamicTable {
initColumns() {
this.newColumn("country", "", "QBT_TR(Country/Region)QBT_TR[CONTEXT=PeerListWidget]", 22, true);
this.newColumn("ip", "", "QBT_TR(IP)QBT_TR[CONTEXT=PeerListWidget]", 80, true);
this.newColumn("ip", "", "QBT_TR(IP/Address)QBT_TR[CONTEXT=PeerListWidget]", 80, true);
this.newColumn("port", "", "QBT_TR(Port)QBT_TR[CONTEXT=PeerListWidget]", 35, true);
this.newColumn("connection", "", "QBT_TR(Connection)QBT_TR[CONTEXT=PeerListWidget]", 50, true);
this.newColumn("flags", "", "QBT_TR(Flags)QBT_TR[CONTEXT=PeerListWidget]", 50, true);
@@ -1871,15 +1871,7 @@ window.qBittorrent.DynamicTable ??= (() => {
const ip1 = this.getRowValue(row1);
const ip2 = this.getRowValue(row2);
const a = ip1.split(".");
const b = ip2.split(".");
for (let i = 0; i < 4; ++i) {
if (a[i] !== b[i])
return a[i] - b[i];
}
return 0;
return window.qBittorrent.Misc.naturalSortCollator.compare(ip1, ip2);
};
// flags