diff --git a/index.html b/index.html index e1070174..ded662ab 100755 --- a/index.html +++ b/index.html @@ -571,6 +571,10 @@   {{download.fmtUploadLength}} +
  • + {{ 'Ratio' | translate }} {{getRatio(download)}} +
  • +
  •   {{getProgress(download)}}%
  • @@ -701,6 +705,10 @@   {{download.fmtUploadLength}} +
  • + {{ 'Ratio' | translate }} {{getRatio(download)}} +
  • +
  •   {{download.dir}}
  • @@ -763,6 +771,7 @@
  •   {{download.fmtUploadSpeed}}
  •   {{download.fmtUploadLength}}
  • +
  • {{ 'Ratio' | translate }} {{getRatio(download)}}
  •   {{download.connections}}{{download.numSeeders}}
  • diff --git a/js/ctrls/main.js b/js/ctrls/main.js index 30eae737..5a7441f8 100755 --- a/js/ctrls/main.js +++ b/js/ctrls/main.js @@ -567,6 +567,16 @@ function( return percentage; }; + // gets the upload ratio + scope.getRatio = function(d) { + var ratio = 0 + ratio = (d.uploadLength / d.completedLength) || 0; + ratio = ratio.toFixed(2); + if(!ratio) ratio = 0; + + return ratio; + }; + // gets the type for the download as classified by the aria2 rpc calls scope.getType = function(d) { var type = d.status;