From ad4d8d28ec89120bc804e4d45a1727062b16fd8f Mon Sep 17 00:00:00 2001 From: Thomas Piccirello Date: Sun, 3 May 2020 03:00:58 -0700 Subject: [PATCH] Add Trackers section to Web UI sidebar Closes #7601. --- src/webui/api/synccontroller.cpp | 9 +- src/webui/www/private/index.html | 5 + src/webui/www/private/scripts/client.js | 100 +++++++++++++++- src/webui/www/private/scripts/dynamicTable.js | 27 ++++- src/webui/www/private/scripts/mocha-init.js | 108 ++++++++++++++++-- src/webui/www/private/views/filters.html | 36 +++++- 6 files changed, 262 insertions(+), 23 deletions(-) diff --git a/src/webui/api/synccontroller.cpp b/src/webui/api/synccontroller.cpp index 5d1db5269..4965f365b 100644 --- a/src/webui/api/synccontroller.cpp +++ b/src/webui/api/synccontroller.cpp @@ -243,9 +243,10 @@ namespace processMap(prevData[i.key()].toMap(), i.value().toMap(), map); // existing list item found - remove it from prevData prevData.remove(i.key()); - if (!map.isEmpty()) + if (!map.isEmpty()) { // changed list item found - append its changes to syncData syncData[i.key()] = map; + } } break; case QVariant::StringList: @@ -259,9 +260,10 @@ namespace processList(prevData[i.key()].toList(), i.value().toList(), list, removedList); // existing list item found - remove it from prevData prevData.remove(i.key()); - if (!list.isEmpty() || !removedList.isEmpty()) + if (!list.isEmpty() || !removedList.isEmpty()) { // changed list item found - append entire list to syncData syncData[i.key()] = i.value(); + } } break; default: @@ -459,9 +461,8 @@ void SyncController::maindataAction() } } - for (const BitTorrent::TrackerEntry &tracker : asConst(torrent->trackers())) { + for (const BitTorrent::TrackerEntry &tracker : asConst(torrent->trackers())) trackers[tracker.url()] << torrentHash; - } torrents[torrentHash] = map; } diff --git a/src/webui/www/private/index.html b/src/webui/www/private/index.html index e131d8495..7142480e0 100644 --- a/src/webui/www/private/index.html +++ b/src/webui/www/private/index.html @@ -186,6 +186,11 @@
  • QBT_TR(Pause torrents)QBT_TR[CONTEXT=TagFilterWidget] QBT_TR(Pause torrents)QBT_TR[CONTEXT=TagFilterWidget]
  • QBT_TR(Delete torrents)QBT_TR[CONTEXT=TagFilterWidget] QBT_TR(Delete torrents)QBT_TR[CONTEXT=TagFilterWidget]
  • +