diff --git a/README.md b/README.md index 63d0c0f..a5f1ee2 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,7 @@ Then download the webui, you can either do that by downloading this repository a Status =========== -Usable but some bugs here and there. A complete overhaul is underway in the angular.html but its completely broken currently and once it is completed then it would replace the old index.html - -TODO ------------ -* Implement all features of the old version into the new architecture in angular.html +A completely overhauled version is enabled by default. There are slight changes so if you still want to use the previous version then use the old.html instead of index.html. Dependencies diff --git a/angular.html b/angular.html deleted file mode 100644 index 474d440..0000000 --- a/angular.html +++ /dev/null @@ -1,738 +0,0 @@ - - - - - - - - - - - - aria2 web client - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
-
- - -
-
- - - -
-

Currently no downloads in line to display, use the Add download button to start downloading files!

-
- - - - -
-
- Download Filters - - -
-
- - - - - - - - - - - - - - - - - - -
- {{getName(download)}} - - -
- - - - - - - - - - - - -
- -
- -
    - -
  • - Status: {{download.status}} -
  • - -
  • - ETA: {{getEta(download) | time}} -
  • - -
  • - Size: {{download.totalLength | blength}} -
  • - -
  • - Downloaded: {{download.completedLength | blength}} -
  • - -
  • - Progress: {{getProgress(download)}}% -
  • - -
  • - Speed: {{download.downloadSpeed | bspeed}} -
  • - - - - - -
  • - Status: {{download.status}} -
  • - -
  • - Size: {{download.totalLength | blength}} -
  • - -
  • - Downloaded: {{download.completedLength | blength}} -
  • - -
  • - Path: {{download.dir}} -
  • - - - - -
  • - Status: {{download.status}} -
  • - -
  • - Path: {{download.dir}} -
  • - -
  • - Size: {{download.totalLength | blength}} -
  • - - - -
  • - Status: {{download.status}} -
  • - -
  • - Path: {{download.dir}} -
  • - -
  • - Size: {{download.totalLength | blength}} -
  • - - -
  • - Status: {{download.status}} -
  • - -
  • - Path: {{download.dir}} -
  • - -
  • - Size: {{download.totalLength | blength}} -
  • - -
- -
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
- -
    -
  • Status: {{download.status}}
  • -
  • GID: {{download.gid}}
  • -
  • Dir: {{download.dir}}
  • -
  • Size: {{download.totalLength | blength}}
  • -
  • Downloaded: {{download.completedLength | blength}}
  • -
  • Num of Pieces: {{download.numPieces}}
  • -
  • Piece Length: {{download.pieceLength | blength}}
  • -
  • ETA: {{getEta(download) | time}}
  • -
  • Down Speed: {{download.downloadSpeed | bspeed}}
  • - -
  • Upload Speed: {{download.uploadSpeed | bspeed}}
  • -
  • Upload Length: {{download.uploadLength | blength}}
  • - -
  • Connections: {{download.connections}}
  • -
- -

Download Files

-
    -
  • {{file.path | prelative:download.dir}} ({{file.length | blength}})
  • -
- -
-
-
-
-
- - - - - - - - -

Global Statistics

- -
- - -
- - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/index.html b/index.html index 399e9e7..abc2f46 100755 --- a/index.html +++ b/index.html @@ -1,728 +1,761 @@ - - - - - - - - - - - aria2 web client - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + aria2 web client + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+
+ + +
+
+ + + +
+

Currently no downloads in line to display, use the Add download button to start downloading files!

+
+ + +
+
+ + +
+ Found: {{totalDownloads}} / {{totalAria2Downloads()}} +
+
+ + + + + + + + + + + + + + + + + +
+ {{getName(download)}} + + +
+ + + + + + + + + + + + +
+ +
+ +
    + +
  • + Status: {{download.status}} +
  • + +
  • + ETA: {{getEta(download) | time}} +
  • + +
  • + Size: {{download.totalLength | blength}} +
  • + +
  • + Downloaded: {{download.completedLength | blength}} +
  • + +
  • + Progress: {{getProgress(download)}}% +
  • + +
  • + Speed: {{download.downloadSpeed | bspeed}} +
  • + + + + + +
  • + Status: {{download.status}} +
  • + +
  • + Size: {{download.totalLength | blength}} +
  • + +
  • + Downloaded: {{download.completedLength | blength}} +
  • + +
  • + Path: {{download.dir}} +
  • + + + + +
  • + Status: {{download.status}} +
  • + +
  • + Path: {{download.dir}} +
  • + +
  • + Size: {{download.totalLength | blength}} +
  • + + + +
  • + Status: {{download.status}} +
  • + +
  • + Path: {{download.dir}} +
  • + +
  • + Size: {{download.totalLength | blength}} +
  • + + +
  • + Status: {{download.status}} +
  • + +
  • + Path: {{download.dir}} +
  • + +
  • + Size: {{download.totalLength | blength}} +
  • + +
+ +
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+ +
    +
  • Status: {{download.status}}
  • +
  • GID: {{download.gid}}
  • +
  • Dir: {{download.dir}}
  • +
  • Size: {{download.totalLength | blength}}
  • +
  • Downloaded: {{download.completedLength | blength}}
  • +
  • Num of Pieces: {{download.numPieces}}
  • +
  • Piece Length: {{download.pieceLength | blength}}
  • +
  • ETA: {{getEta(download) | time}}
  • +
  • Down Speed: {{download.downloadSpeed | bspeed}}
  • + +
  • Upload Speed: {{download.uploadSpeed | bspeed}}
  • +
  • Upload Length: {{download.uploadLength | blength}}
  • + +
  • Connections: {{download.connections}}
  • +
+ +

Download Files

+
    +
  • {{file.path | prelative:download.dir}} ({{file.length | blength}})
  • +
+ +
+
+
+
+
+ + + + + + + + +

Global Statistics

+ +
+
+ +

Miscellaneous

+ Aria2 Version {{miscellaneous.version}} +

+ Features Enabled + +
+

+ To download the latest version of the project head on to + http://github.com/ziahamza/webui-aria2 +
+ Or you can open the latest version in browser through http://ziahamza.github.com/webui-aria2 +

+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/js/ctrls/download.js b/js/ctrls/download.js index 7c5c11f..60487c8 100644 --- a/js/ctrls/download.js +++ b/js/ctrls/download.js @@ -11,6 +11,7 @@ function( fsettings, activeInclude, waitingExclude ) { scope.active = [], scope.waiting = [], scope.stopped = []; + scope.gstats = scope.miscellaneous = {}; // pause the download // d: the download ctx @@ -83,6 +84,33 @@ function( utils.mergeMap(data[0], scope.stopped, scope.getCtx); }); + rpc.subscribe('getGlobalStat', [], function(data) { + scope.gstats = data[0]; + }); + + rpc.once('getVersion', [], function(data) { + scope.miscellaneous = data[0]; + }); + + // total number of downloads, updates dynamically as downloads are + // stored in scope + scope.totalDownloads = 0; + + // download search filter + scope.downloadFilter = ""; + + scope.filterDownloads = function(downloads) { + var filter = scope.downloadFilter; + if (!filter.length) return downloads; + return _.filter(downloads, function(d) { + if (!d.files.length) return true; + + return _.filter(d.files, function(f) { + return f.path.search(filter) != -1; + }).length; + }); + }; + // max downloads shown in one page scope.pageSize = 10; @@ -91,17 +119,23 @@ function( scope.pageControlRadius = 3; - // total number of downloads, updates dynamically as downloads are - // stored in scope - scope.totalDownloads = 0; - // total maximum pages scope.totalPages = 0; + // total amount of downloads returned by aria2 + scope.totalAria2Downloads = function() { + return scope.active.length + + scope.waiting.length + + scope.stopped.length; + } + // actual downloads used by the view scope.getDownloads = function() { - var downloads = scope.active - .concat( scope.waiting ).concat( scope.stopped ) + var downloads = + scope.filterDownloads( + scope.active.concat( scope.waiting ).concat( scope.stopped ) + ) + ; scope.totalDownloads = downloads.length; diff --git a/js/directives/dgraph.js b/js/directives/dgraph.js index 3811026..69305e1 100644 --- a/js/directives/dgraph.js +++ b/js/directives/dgraph.js @@ -69,11 +69,11 @@ angular }; scope.$watch(attrs.dspeed, function(val) { - dspeed = val; + dspeed = parseFloat(val) || 0; }); scope.$watch(attrs.useed, function(val) { - uspeed = val; + uspeed = parseFloat(val) || 0; }); if (attrs.draw) { diff --git a/old.html b/old.html new file mode 100644 index 0000000..fb98fa3 --- /dev/null +++ b/old.html @@ -0,0 +1,728 @@ + + + + + + + + + + + aria2 web client + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +