mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-21 16:55:46 +03:00
WebUI: Display DHT information in the Status bar only when DHT is enabled
GUI completely hides DHT information when DHT is disabled - now WebUI does the same thing. Closes #18417. PR #21339.
This commit is contained in:
parent
1c43286616
commit
183c7c75b1
1 changed files with 11 additions and 1 deletions
|
@ -927,7 +927,17 @@ window.addEventListener("DOMContentLoaded", () => {
|
|||
+ window.qBittorrent.Client.mainTitle();
|
||||
|
||||
$("freeSpaceOnDisk").textContent = "QBT_TR(Free space: %1)QBT_TR[CONTEXT=HttpServer]".replace("%1", window.qBittorrent.Misc.friendlyUnit(serverState.free_space_on_disk));
|
||||
$("DHTNodes").textContent = "QBT_TR(DHT: %1 nodes)QBT_TR[CONTEXT=StatusBar]".replace("%1", serverState.dht_nodes);
|
||||
|
||||
const dhtElement = document.getElementById("DHTNodes");
|
||||
if (window.qBittorrent.Cache.preferences.get().dht) {
|
||||
dhtElement.textContent = "QBT_TR(DHT: %1 nodes)QBT_TR[CONTEXT=StatusBar]".replace("%1", serverState.dht_nodes);
|
||||
dhtElement.classList.remove("invisible");
|
||||
dhtElement.previousElementSibling.classList.remove("invisible");
|
||||
}
|
||||
else {
|
||||
dhtElement.classList.add("invisible");
|
||||
dhtElement.previousElementSibling.classList.add("invisible");
|
||||
}
|
||||
|
||||
// Statistics dialog
|
||||
if (document.getElementById("statisticsContent")) {
|
||||
|
|
Loading…
Reference in a new issue