mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 06:28:03 -06: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:
@@ -927,7 +927,17 @@ window.addEventListener("DOMContentLoaded", () => {
|
|||||||
+ window.qBittorrent.Client.mainTitle();
|
+ 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));
|
$("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
|
// Statistics dialog
|
||||||
if (document.getElementById("statisticsContent")) {
|
if (document.getElementById("statisticsContent")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user