diff --git a/Changelog b/Changelog index 81081d8c4..fac2a78da 100644 --- a/Changelog +++ b/Changelog @@ -15,6 +15,7 @@ - FEATURE: Rewrote folder scanning code (Now uses a filesystem watcher) - FEATURE: Added torrent deletion from hard drive function in Web UI - FEATURE: Added queueing priority actions in Web UI + - FEATURE: Display progress using progress bars in Web UI - BUGFIX: Made usage of fastresume data more reliable - BUGFIX: qBittorrent shutdown is now faster - BUGFIX: Fixed several memory leaks diff --git a/src/webui.qrc b/src/webui.qrc index 8ee2d1bb7..3c8493b33 100644 --- a/src/webui.qrc +++ b/src/webui.qrc @@ -17,5 +17,6 @@ webui/scripts/client.js webui/scripts/download.js webui/scripts/mootabs1.2.js + webui/scripts/progressbar.js diff --git a/src/webui/index.html b/src/webui/index.html index 58310a4e2..e620efb3a 100644 --- a/src/webui/index.html +++ b/src/webui/index.html @@ -15,6 +15,7 @@ + @@ -83,7 +84,7 @@ Name Size - Progress + Progress DL Speed UP Speed Priority diff --git a/src/webui/scripts/client.js b/src/webui/scripts/client.js index a588f1d88..17dc42f0c 100644 --- a/src/webui/scripts/client.js +++ b/src/webui/scripts/client.js @@ -37,8 +37,8 @@ window.addEvent('domready', function(){ width: '100%', height: '100%' }); - myTable.setup('myTable'); - myTableUP.setup('myTableUP'); + myTable.setup('myTable', 3); + myTableUP.setup('myTableUP', -1); var r=0; var waiting=false; var stateToImg = function(state){ @@ -120,7 +120,7 @@ window.addEvent('domready', function(){ row[0] = stateToImg(event.state); row[1] = event.name; row[2] = fsize(event.size); - row[3] = round1(event.progress*100) + ' %'; + row[3] = round1(event.progress*100); row[4] = fspeed(event.dlspeed); row[5] = fspeed(event.upspeed); row[6] = event.priority diff --git a/src/webui/scripts/dynamicTable.js b/src/webui/scripts/dynamicTable.js index 4bef8c8ed..36a7ad469 100644 --- a/src/webui/scripts/dynamicTable.js +++ b/src/webui/scripts/dynamicTable.js @@ -36,11 +36,12 @@ var dynamicTable = new Class ({ initialize: function(){ }, - setup: function(table){ + setup: function(table, progressIndex){ this.table = $(table); this.rows = new Object(); this.cur = new Array(); this.priority_hidden = false; + this.progressIndex = progressIndex; }, altRow: function() @@ -87,7 +88,11 @@ var dynamicTable = new Class ({ for(var i=0; i100)value=100; + if(value<0)value=0; + this.vals.value=value; + this.vals.dark.empty(); + this.vals.light.empty(); + this.vals.dark.appendText(value+'%'); + this.vals.light.appendText(value+'%'); + var r=parseInt(this.vals.width*(value/100)); + this.vals.dark.setStyle('clip','rect(0,'+r+'px,'+this.vals.height+'px,0)'); + this.vals.light.setStyle('clip','rect(0,'+this.vals.width+'px,'+this.vals.height+'px,'+r+'px)'); +} +function ProgressBar_checkForParent(id){ + var obj=$(id); + if(!obj)return; + if(!obj.parentNode)return setTimeout('ProgressBar_checkForParent("'+id+'")',1); + obj.setStyle('width','100%'); + var w=obj.offsetWidth; + obj.vals.dark.setStyle('width',w); + obj.vals.light.setStyle('width',w); + obj.vals.width=w; + obj.setValue(obj.vals.value); +} +var ProgressBars=0;