mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 06:01:33 -06:00
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:
@@ -1829,7 +1829,7 @@ window.qBittorrent.DynamicTable ??= (() => {
|
|||||||
class TorrentPeersTable extends DynamicTable {
|
class TorrentPeersTable extends DynamicTable {
|
||||||
initColumns() {
|
initColumns() {
|
||||||
this.newColumn("country", "", "QBT_TR(Country/Region)QBT_TR[CONTEXT=PeerListWidget]", 22, true);
|
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("port", "", "QBT_TR(Port)QBT_TR[CONTEXT=PeerListWidget]", 35, true);
|
||||||
this.newColumn("connection", "", "QBT_TR(Connection)QBT_TR[CONTEXT=PeerListWidget]", 50, 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);
|
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 ip1 = this.getRowValue(row1);
|
||||||
const ip2 = this.getRowValue(row2);
|
const ip2 = this.getRowValue(row2);
|
||||||
|
|
||||||
const a = ip1.split(".");
|
return window.qBittorrent.Misc.naturalSortCollator.compare(ip1, ip2);
|
||||||
const b = ip2.split(".");
|
|
||||||
|
|
||||||
for (let i = 0; i < 4; ++i) {
|
|
||||||
if (a[i] !== b[i])
|
|
||||||
return a[i] - b[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// flags
|
// flags
|
||||||
|
|||||||
@@ -86,6 +86,12 @@ window.qBittorrent.PropPeers ??= (() => {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
responseJSON["peers"][key]["rowId"] = key;
|
responseJSON["peers"][key]["rowId"] = key;
|
||||||
|
|
||||||
|
if (Object.hasOwn(responseJSON["peers"][key], "i2p_dest")) {
|
||||||
|
responseJSON["peers"][key]["ip"] = responseJSON["peers"][key]["i2p_dest"];
|
||||||
|
responseJSON["peers"][key]["port"] = "N/A";
|
||||||
|
}
|
||||||
|
|
||||||
torrentPeersTable.updateRowData(responseJSON["peers"][key]);
|
torrentPeersTable.updateRowData(responseJSON["peers"][key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user