From 87f93a7a1d7e48239994e91f7767eb275be976bf Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Mon, 23 Nov 2009 10:40:16 +0000 Subject: [PATCH] - Display ratio in Web UI --- src/eventmanager.cpp | 1 + src/webui/index.html | 1 + src/webui/scripts/client.js | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/eventmanager.cpp b/src/eventmanager.cpp index b7fe90e4b..2e689044c 100644 --- a/src/eventmanager.cpp +++ b/src/eventmanager.cpp @@ -123,6 +123,7 @@ void EventManager::modifiedTorrent(QTorrentHandle h) leechs += " ("+QString::number(h.num_incomplete())+")"; event["num_leechs"] = QVariant(leechs); event["seed"] = QVariant(h.is_seed()); + event["ratio"] = QVariant(QString::number(BTSession->getRealRatio(hash), 'f', 1)); event["hash"] = QVariant(hash); event_list[hash] = event; } diff --git a/src/webui/index.html b/src/webui/index.html index a6669f4c5..355c7e39d 100644 --- a/src/webui/index.html +++ b/src/webui/index.html @@ -96,6 +96,7 @@ Down Speed Up Speed ETA + Ratio diff --git a/src/webui/scripts/client.js b/src/webui/scripts/client.js index 06c6a6f79..4000ee110 100644 --- a/src/webui/scripts/client.js +++ b/src/webui/scripts/client.js @@ -81,7 +81,7 @@ window.addEvent('domready', function(){ events.each(function(event){ events_hashes[events_hashes.length] = event.hash; var row = new Array(); - row.length = 9; + row.length = 10; row[0] = stateToImg(event.state); row[1] = event.name; row[2] = event.priority @@ -92,6 +92,7 @@ window.addEvent('domready', function(){ row[7] = event.dlspeed; row[8] = event.upspeed; row[9] = event.eta; + row[10] = event.ratio; if(row[2] != -1) queueing_enabled = true; if(!torrent_hashes.contains(event.hash)) {