diff --git a/src/webui/api/torrentscontroller.cpp b/src/webui/api/torrentscontroller.cpp index bcd455f47..f7f3d6994 100644 --- a/src/webui/api/torrentscontroller.cpp +++ b/src/webui/api/torrentscontroller.cpp @@ -56,8 +56,12 @@ // Tracker keys const char KEY_TRACKER_URL[] = "url"; const char KEY_TRACKER_STATUS[] = "status"; +const char KEY_TRACKER_TIER[] = "tier"; const char KEY_TRACKER_MSG[] = "msg"; -const char KEY_TRACKER_PEERS[] = "num_peers"; +const char KEY_TRACKER_PEERS_COUNT[] = "num_peers"; +const char KEY_TRACKER_SEEDS_COUNT[] = "num_seeds"; +const char KEY_TRACKER_LEECHES_COUNT[] = "num_leeches"; +const char KEY_TRACKER_DOWNLOADED_COUNT[] = "num_downloaded"; // Web seed keys const char KEY_WEBSEED_URL[] = "url"; @@ -295,7 +299,11 @@ void TorrentsController::propertiesAction() // The dictionary keys are: // - "url": Tracker URL // - "status": Tracker status -// - "num_peers": Tracker peer count +// - "tier": Tracker tier +// - "num_peers": Number of peers this torrent is currently connected to +// - "num_seeds": Number of peers that have the whole file +// - "num_leeches": Number of peers that are still downloading +// - "num_downloaded": Tracker downloaded count // - "msg": Tracker message (last) void TorrentsController::trackersAction() { @@ -323,10 +331,15 @@ void TorrentsController::trackersAction() case BitTorrent::TrackerEntry::NotWorking: status = tr("Not working"); break; } + trackerDict[KEY_TRACKER_TIER] = tracker.tier(); trackerDict[KEY_TRACKER_STATUS] = status; - trackerDict[KEY_TRACKER_PEERS] = data.numPeers; + trackerDict[KEY_TRACKER_PEERS_COUNT] = data.numPeers; trackerDict[KEY_TRACKER_MSG] = data.lastMessage.trimmed(); + trackerDict[KEY_TRACKER_SEEDS_COUNT] = tracker.nativeEntry().scrape_complete; + trackerDict[KEY_TRACKER_LEECHES_COUNT] = tracker.nativeEntry().scrape_incomplete; + trackerDict[KEY_TRACKER_DOWNLOADED_COUNT] = tracker.nativeEntry().scrape_downloaded; + trackerList.append(trackerDict); } diff --git a/src/webui/www/private/properties_content.html b/src/webui/www/private/properties_content.html index ecd56f4d8..ad491994e 100644 --- a/src/webui/www/private/properties_content.html +++ b/src/webui/www/private/properties_content.html @@ -84,10 +84,14 @@ + - - + + + + + diff --git a/src/webui/www/private/scripts/prop-trackers.js b/src/webui/www/private/scripts/prop-trackers.js index ba1708468..d745d4d42 100644 --- a/src/webui/www/private/scripts/prop-trackers.js +++ b/src/webui/www/private/scripts/prop-trackers.js @@ -32,7 +32,7 @@ var trackersDynTable = new Class({ }, insertRow: function(row) { - var url = row[0]; + var url = row[1]; if (this.rows.has(url)) { var tableRow = this.rows.get(url); this.updateRow(tableRow, row); @@ -85,12 +85,17 @@ var loadTrackersData = function() { if (trackers) { // Update Trackers data trackers.each(function(tracker) { - var row = []; - row.length = 4; - row[0] = escapeHtml(tracker.url); - row[1] = tracker.status; - row[2] = tracker.num_peers; - row[3] = escapeHtml(tracker.msg); + var row = [ + tracker.tier, + escapeHtml(tracker.url), + tracker.status, + tracker.num_peers, + (tracker.num_seeds >= 0) ? tracker.num_seeds : "QBT_TR(N/A)QBT_TR[CONTEXT=TrackerListWidget]", + (tracker.num_leeches >= 0) ? tracker.num_leeches : "QBT_TR(N/A)QBT_TR[CONTEXT=TrackerListWidget]", + (tracker.num_downloaded >= 0) ? tracker.num_downloaded : "QBT_TR(N/A)QBT_TR[CONTEXT=TrackerListWidget]", + escapeHtml(tracker.msg) + ]; + tTable.insertRow(row); }); }
QBT_TR(#)QBT_TR[CONTEXT=TrackerListWidget] QBT_TR(URL)QBT_TR[CONTEXT=TrackerListWidget] Add Trackers QBT_TR(Status)QBT_TR[CONTEXT=TrackerListWidget]QBT_TR(Peers)QBT_TR[CONTEXT=TrackerListWidget]QBT_TR(Message)QBT_TR[CONTEXT=TrackerListWidget]QBT_TR(Peers)QBT_TR[CONTEXT=TrackerListWidget]QBT_TR(Seeds)QBT_TR[CONTEXT=TrackerListWidget]QBT_TR(Leeches)QBT_TR[CONTEXT=TrackerListWidget]QBT_TR(Downloaded)QBT_TR[CONTEXT=TrackerListWidget]QBT_TR(Message)QBT_TR[CONTEXT=TrackerListWidget]