From ead734cbf0c64e154321ac8cda22ee1d5890dfc4 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Fri, 18 Nov 2011 01:07:39 +0000 Subject: [PATCH] Fix #1960 : Web UI statusbar shows total_payload_download for upload --- .../ui/web/js/deluge-all/details/StatusTab.js | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/deluge/ui/web/js/deluge-all/details/StatusTab.js b/deluge/ui/web/js/deluge-all/details/StatusTab.js index 378b9dab8..7d0492f7f 100644 --- a/deluge/ui/web/js/deluge-all/details/StatusTab.js +++ b/deluge/ui/web/js/deluge-all/details/StatusTab.js @@ -1,6 +1,6 @@ /*! * Deluge.details.StatusTab.js - * + * * Copyright (c) Damien Churchill 2009-2010 * * This program is free software; you can redistribute it and/or modify @@ -38,19 +38,19 @@ Ext.ns('Deluge.details'); Deluge.details.StatusTab = Ext.extend(Ext.Panel, { title: _('Status'), autoScroll: true, - + onRender: function(ct, position) { Deluge.details.StatusTab.superclass.onRender.call(this, ct, position); - + this.progressBar = this.add({ xtype: 'progress', cls: 'x-deluge-status-progressbar' }); - + this.status = this.add({ cls: 'x-deluge-status', id: 'deluge-details-status', - + border: false, width: 1000, listeners: { @@ -67,14 +67,14 @@ Deluge.details.StatusTab = Ext.extend(Ext.Panel, { } }); }, - + clear: function() { this.progressBar.updateProgress(0, ' '); for (var k in this.fields) { this.fields[k].innerHTML = ''; } }, - + update: function(torrentId) { if (!this.fields) this.getFields(); deluge.client.web.get_torrent_status(torrentId, Deluge.Keys.Status, { @@ -82,14 +82,14 @@ Deluge.details.StatusTab = Ext.extend(Ext.Panel, { scope: this }); }, - + onPanelUpdate: function(el, response) { this.fields = {}; Ext.each(Ext.query('dd', this.status.body.dom), function(field) { this.fields[field.className] = field; }, this); }, - + onRequestComplete: function(status) { seeders = status.total_seeds > -1 ? status.num_seeds + ' (' + status.total_seeds + ')' : status.num_seeds; peers = status.total_peers > -1 ? status.num_peers + ' (' + status.total_peers + ')' : status.num_peers; @@ -116,8 +116,8 @@ Deluge.details.StatusTab = Ext.extend(Ext.Panel, { data.auto_managed = _((status.is_auto_managed) ? 'True' : 'False'); data.downloaded += ' (' + ((status.total_payload_download) ? fsize(status.total_payload_download) : '0.0 KiB') + ')'; - data.uploaded += ' (' + ((status.total_payload_download) ? fsize(status.total_payload_download): '0.0 KiB') + ')'; - + data.uploaded += ' (' + ((status.total_payload_upload) ? fsize(status.total_payload_upload): '0.0 KiB') + ')'; + for (var field in this.fields) { this.fields[field].innerHTML = data[field]; }