diff --git a/README.md b/README.md index fdd2c6a..967a2b0 100755 --- a/README.md +++ b/README.md @@ -10,6 +10,17 @@ Status =========== Basic working prototype with minimal functionality. A lot more to features to come so stay tuned. +TODO +=========== +-> Set global aria2c configuration +-> Adding URIs to existing downloads +-> Add download and upload speed graphs and virtualizations +-> More global statistics +-> More specialized info for special download types like bit torrent and metalink +-> Changing configuration of downloads already started +-> More advance options for new download +-> Adding downloads by uploading torrent and metalink files + Dependencies =========== diff --git a/js/script.js b/js/script.js index 56076bb..501e369 100755 --- a/js/script.js +++ b/js/script.js @@ -111,6 +111,9 @@ function changeLength(len, pref) { else if(len <= 1000000) return Math.round(len/1000 * 100)/100 + " k" + pref; else if(len <= 1000000000) return Math.round(len/1000000 *100)/100 + " m" + pref; else if(len <= 1000000000000) return Math.round(len/1000000000 *100)/100 + " g" + pref; +} +function changeTime(time) { + } function updateActiveDownloads(data) { var down_template = $('#download_active_template').text(); @@ -120,10 +123,17 @@ function updateActiveDownloads(data) { } for(var i = 0; i < data.length; i++) { var percentage =(data[i].completedLength / data[i].totalLength)*100; - percentage = Math.round(percentage*1000)/1000; + percentage = Math.round(percentage*100)/100; if(!percentage) percentage = 0; + var name; + if(data[i].files[0].uris.length) { + name = data[i].files[0].uris[0].uri.replace(/^.*[\\\/]/, ''); + } + else { + name = data[i].files[0].path.replace(/^.*[\\\/\]]/, ''); + } ctx = { - name: data[i].files[0].uris[0].uri.replace(/^.*[\\\/]/, ''), + name: name, status: data[i].status, percentage:percentage, gid: data[i].gid, @@ -170,10 +180,17 @@ function updateWaitingDownloads(data) { } for(var i = 0; i < data.length; i++) { var percentage =(data[i].completedLength / data[i].totalLength)*100; - percentage = Math.round(percentage*1000)/1000; + percentage = Math.round(percentage*100)/100; if(!percentage) percentage = 0; + var name; + if(data[i].files[0].uris.length) { + name = data[i].files[0].uris[0].uri.replace(/^.*[\\\/]/, ''); + } + else { + name = data[i].files[0].path.replace(/^.*[\\\/\]]/, ''); + } ctx = { - name: data[i].files[0].uris[0].uri.replace(/^.*[\\\/]/, ''), + name: name, status: data[i].status, percentage:percentage, gid: data[i].gid, @@ -221,10 +238,17 @@ function updateStoppedDownloads(data) { } for(var i = 0; i < data.length; i++) { var percentage =(data[i].completedLength / data[i].totalLength)*100; - percentage = Math.round(percentage*1000)/1000; + percentage = Math.round(percentage*100)/100; if(!percentage) percentage = 0; + var name; + if(data[i].files[0].uris.length) { + name = data[i].files[0].uris[0].uri.replace(/^.*[\\\/]/, ''); + } + else { + name = data[i].files[0].path.replace(/^.*[\\\/\]]/, ''); + } ctx = { - name: data[i].files[0].uris[0].uri.replace(/^.*[\\\/]/, ''), + name: name, status: data[i].status, percentage:percentage, gid: data[i].gid,