improve the statusbar css and add diskspace and incoming connections to

it
This commit is contained in:
Damien Churchill 2008-09-29 12:23:49 +00:00
parent ec1513a2c4
commit ccdb270b38
6 changed files with 30 additions and 19 deletions

View File

@ -53,7 +53,11 @@
<li id="connections" />
<li id="downspeed" />
<li id="upspeed" />
<li id="incoming_connections">
$_('No Incoming Connections!')
</li>
<li id="dht" />
<li id="free_space" />
</ul>
</div>
</div>

View File

@ -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 {

View File

@ -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');
}
}
});

View File

@ -216,7 +216,10 @@ Number.implement({
if (bytes < 1024) { return bytes.toFixed(1) + 'KiB'; }
else { bytes = bytes / 1024; }
return bytes.toFixed(1) + 'MiB'
if (bytes < 1024) { return bytes.toFixed(1) + 'MiB'; }
else { bytes = bytes / 1024; }
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)) {

View File

@ -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'); }

View File

@ -100,19 +100,11 @@ html, body {
}
#status #info li {
width: auto;
height: 20px;
line-height: 20px;
width: 30px;
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 {