From 272d2005e00be41d3b7fe9c34c1e20b9aa505bac Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Sun, 22 Jan 2012 02:00:03 +0000 Subject: [PATCH] Add missing columns to WebUI Added Download,Uploaded,Down Limit, Up Limit & Seeder/Peeds. Also selected columns start out hidden to match gtkui and the name column has a minimum width of 150. --- deluge/ui/web/js/deluge-all/Keys.js | 8 ++- deluge/ui/web/js/deluge-all/TorrentGrid.js | 80 ++++++++++++++++++---- 2 files changed, 72 insertions(+), 16 deletions(-) diff --git a/deluge/ui/web/js/deluge-all/Keys.js b/deluge/ui/web/js/deluge-all/Keys.js index cb74db3dd..1be58cf05 100644 --- a/deluge/ui/web/js/deluge-all/Keys.js +++ b/deluge/ui/web/js/deluge-all/Keys.js @@ -42,13 +42,17 @@ Deluge.Keys = { *
['queue', 'name', 'total_size', 'state', 'progress', 'num_seeds',
 	 * 'total_seeds', 'num_peers', 'total_peers', 'download_payload_rate',
 	 * 'upload_payload_rate', 'eta', 'ratio', 'distributed_copies',
-	 * 'is_auto_managed', 'time_added', 'tracker_host']
+ * 'is_auto_managed', 'time_added', 'tracker_host', 'save_path', + * 'total_done', 'total_uploaded', 'max_download_speed', 'max_upload_speed', + * 'seeds_peers_ratio'] */ Grid: [ 'queue', 'name', 'total_size', 'state', 'progress', 'num_seeds', 'total_seeds', 'num_peers', 'total_peers', 'download_payload_rate', 'upload_payload_rate', 'eta', 'ratio', 'distributed_copies', - 'is_auto_managed', 'time_added', 'tracker_host', 'save_path' + 'is_auto_managed', 'time_added', 'tracker_host', 'save_path', + 'total_done', 'total_uploaded', 'max_download_speed', 'max_upload_speed', + 'seeds_peers_ratio' ], /** diff --git a/deluge/ui/web/js/deluge-all/TorrentGrid.js b/deluge/ui/web/js/deluge-all/TorrentGrid.js index 60970757a..2c819a5f6 100644 --- a/deluge/ui/web/js/deluge-all/TorrentGrid.js +++ b/deluge/ui/web/js/deluge-all/TorrentGrid.js @@ -43,6 +43,10 @@ if (!value) return; return fspeed(value); } + function torrentLimitRenderer(value) { + if (value == -1) return ''; + return fspeed(value * 1024.0); + } function torrentProgressRenderer(value, p, r) { value = new Number(value); var progress = value; @@ -65,7 +69,7 @@ } } function availRenderer(value, p, r) { - return (value < 0) ? '∞' : new Number(value).toFixed(3); + return (value < 0) ? '∞' : parseFloat(new Number(value).toFixed(3)); } function trackerRenderer(value, p, r) { return String.format('
{0}
', value); @@ -117,18 +121,6 @@ sortable: true, renderer: torrentProgressRenderer, dataIndex: 'progress' - }, { - header: _('Seeders'), - width: 60, - sortable: true, - renderer: seedsRenderer, - dataIndex: 'num_seeds' - }, { - header: _('Peers'), - width: 60, - sortable: true, - renderer: peersRenderer, - dataIndex: 'num_peers' }, { header: _('Down Speed'), width: 80, @@ -147,36 +139,90 @@ sortable: true, renderer: ftime, dataIndex: 'eta' + }, { + header: _('Seeders'), + hidden: true, + width: 60, + sortable: true, + renderer: seedsRenderer, + dataIndex: 'num_seeds' + }, { + header: _('Peers'), + hidden: true, + width: 60, + sortable: true, + renderer: peersRenderer, + dataIndex: 'num_peers' }, { header: _('Ratio'), + hidden: true, width: 60, sortable: true, renderer: availRenderer, dataIndex: 'ratio' }, { header: _('Avail'), + hidden: true, width: 60, sortable: true, renderer: availRenderer, dataIndex: 'distributed_copies' }, { header: _('Added'), + hidden: true, width: 80, sortable: true, renderer: fdate, dataIndex: 'time_added' }, { header: _('Tracker'), + hidden: true, width: 120, sortable: true, renderer: trackerRenderer, dataIndex: 'tracker_host' }, { header: _('Save Path'), + hidden: true, width: 120, sortable: true, renderer: fplain, dataIndex: 'save_path' + }, { + header: _('Downloaded'), + hidden: true, + width: 75, + sortable: true, + renderer: fsize, + dataIndex: 'total_done' + }, { + header: _('Uploaded'), + hidden: true, + width: 75, + sortable: true, + renderer: fsize, + dataIndex: 'total_uploaded' + }, { + header: _('Down Limit'), + hidden: true, + width: 75, + sortable: true, + renderer: torrentLimitRenderer, + dataIndex: 'max_download_speed' + }, { + header: _('Up Limit'), + hidden: true, + width: 75, + sortable: true, + renderer: torrentLimitRenderer, + dataIndex: 'max_upload_speed' + }, { + header: _('Seeders') + '/' + _('Peers'), + hidden: true, + width: 75, + sortable: true, + renderer: availRenderer, + dataIndex: 'seeds_peers_ratio' }], meta: { @@ -199,7 +245,12 @@ {name: 'distributed_copies', type: 'float'}, {name: 'time_added', type: 'int'}, {name: 'tracker_host'}, - {name: 'save_path'} + {name: 'save_path'}, + {name: 'total_done', type: 'int'}, + {name: 'total_uploaded', type: 'int'}, + {name: 'max_download_speed', type: 'int'}, + {name: 'max_upload_speed', type: 'int'}, + {name: 'seeds_peers_ratio', type: 'float'} ] }, @@ -212,6 +263,7 @@ cls: 'deluge-torrents', stripeRows: true, autoExpandColumn: 'name', + autoExpandMin: 150, deferredRender:false, autoScroll:true, margins: '5 5 0 0',