From ccdb270b3820dc7de38792b65911f2ba73818ec4 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Mon, 29 Sep 2008 12:23:49 +0000 Subject: [PATCH] improve the statusbar css and add diskspace and incoming connections to it --- deluge/ui/webui/templates/ajax/index.html | 4 ++++ .../webui/templates/ajax/static/css/mooui.css | 1 + .../templates/ajax/static/js/deluge-bars.js | 7 +++++++ .../webui/templates/ajax/static/js/mooui.js | 21 ++++++++++++------- .../ajax/static/themes/classic/style.css | 2 ++ .../webui/templates/ajax/template_style.css | 14 +++---------- 6 files changed, 30 insertions(+), 19 deletions(-) diff --git a/deluge/ui/webui/templates/ajax/index.html b/deluge/ui/webui/templates/ajax/index.html index daad6ae8b..b0f5d83c5 100644 --- a/deluge/ui/webui/templates/ajax/index.html +++ b/deluge/ui/webui/templates/ajax/index.html @@ -53,7 +53,11 @@
  • +
  • + $_('No Incoming Connections!') +
  • +
  • diff --git a/deluge/ui/webui/templates/ajax/static/css/mooui.css b/deluge/ui/webui/templates/ajax/static/css/mooui.css index 1055a0c3e..892d61607 100644 --- a/deluge/ui/webui/templates/ajax/static/css/mooui.css +++ b/deluge/ui/webui/templates/ajax/static/css/mooui.css @@ -27,6 +27,7 @@ ul.mooui-menu li.mooui-menu-icon { ul.mooui-menu li.mooui-menu-sep { height: 1px; + line-height: 1px; } ul.mooui-menu li.mooui-menu-toggle input { diff --git a/deluge/ui/webui/templates/ajax/static/js/deluge-bars.js b/deluge/ui/webui/templates/ajax/static/js/deluge-bars.js index 2f2f4e4b7..828360d8a 100644 --- a/deluge/ui/webui/templates/ajax/static/js/deluge-bars.js +++ b/deluge/ui/webui/templates/ajax/static/js/deluge-bars.js @@ -31,6 +31,7 @@ Deluge.Widgets.StatusBar = new Class({ this.element.getElements('li').each(function(el) { this[el.id] = el; }, this); + this.incoming_connections.setStyle('display', 'none'); }, update: function(stats) { @@ -38,6 +39,12 @@ Deluge.Widgets.StatusBar = new Class({ this.downspeed.set('text', stats.download_rate.toSpeed()); this.upspeed.set('text', stats.upload_rate.toSpeed()); this.dht.set('text', stats.dht_nodes); + this.free_space.set('text', stats.free_space.toBytes()); + if (stats.has_incoming_connections) { + this.incoming_connections.setStyle('display', 'none'); + } else { + this.incoming_connections.setStyle('display', 'inline'); + } } }); diff --git a/deluge/ui/webui/templates/ajax/static/js/mooui.js b/deluge/ui/webui/templates/ajax/static/js/mooui.js index 268ca0747..4e5968a2f 100644 --- a/deluge/ui/webui/templates/ajax/static/js/mooui.js +++ b/deluge/ui/webui/templates/ajax/static/js/mooui.js @@ -215,8 +215,11 @@ Number.implement({ if (bytes < 1024) { return bytes.toFixed(1) + 'KiB'; } else { bytes = bytes / 1024; } + + if (bytes < 1024) { return bytes.toFixed(1) + 'MiB'; } + else { bytes = bytes / 1024; } - return bytes.toFixed(1) + 'MiB' + return bytes.toFixed(1) + 'GiB' }, toSpeed: function() { var bits = this @@ -1357,11 +1360,13 @@ Widgets.DataGrid = new Class({ }, filter: function() { - this.filterer = (this.filterer) ? this.filterer : $lambda(true); - this.displayRows.empty(); - this.rows.each(function(row) { - if (this.filterer(row)) {this.displayRows.include(row)} - }.bind(this)); + if (!$chk(this.filterer)) { + this.filterer = $lambda(true) + } + this.displayRows.empty() + this.rows.each(function(r) { + if (this.filterer(r)) {this.displayRows.include(r)} + }.bind(this)) }, getById: function(id) { @@ -1388,8 +1393,8 @@ Widgets.DataGrid = new Class({ }, render: function() { - this.filter(); - this.resort(); + this.filter() + this.resort() var rows = [], rowIds = [] this.rows.each(function(row) { if (this.displayRows.contains(row)) { diff --git a/deluge/ui/webui/templates/ajax/static/themes/classic/style.css b/deluge/ui/webui/templates/ajax/static/themes/classic/style.css index 8df7689d8..74334a764 100644 --- a/deluge/ui/webui/templates/ajax/static/themes/classic/style.css +++ b/deluge/ui/webui/templates/ajax/static/themes/classic/style.css @@ -98,7 +98,9 @@ body { #status #info #connections {background-image:url(/static/images/tango/connections.png)} #status #info #downspeed {background-image:url(/pixmaps/downloading16.png)} #status #info #upspeed {background-image:url(/pixmaps/seeding16.png)} +#status #info #incoming_connections { background-image: url('/pixmaps/alert16.png'); } #status #info #dht {background-image:url(/pixmaps/dht16.png)} +#status #info #free_space {background-image:url(/static/images/tango/drive-harddisk.png)} #labels .all { background-image: url('/pixmaps/dht16.png'); } #labels .downloading { background-image: url('/pixmaps/downloading16.png'); } diff --git a/deluge/ui/webui/templates/ajax/template_style.css b/deluge/ui/webui/templates/ajax/template_style.css index 3a0c17287..d85572473 100644 --- a/deluge/ui/webui/templates/ajax/template_style.css +++ b/deluge/ui/webui/templates/ajax/template_style.css @@ -100,19 +100,11 @@ html, body { } #status #info li { + width: auto; height: 20px; - line-height: 20px; - width: 30px; + line-height: 20px; padding-left: 21px; -} - -#status #info #connections { - width: 15px; -} - -#status #info #downspeed, #status #info #upspeed { - background-position: 4px 2px; - margin-right: 25px; + margin-right: 10px; } .categories {