Skip to content

Commit

Permalink
add urls to status panel
Browse files Browse the repository at this point in the history
  • Loading branch information
binux committed Oct 15, 2017
1 parent d3a8346 commit 6ac3046
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ <h2>Settings</h2>

<script id="ib-status-tpl" type="text/mustache-template">
<ul>
{{#uris}}<li><strong>Url: </strong><a target=_blank href="{{.}}">{{.}}</a>{{/uris}}
{{#infoHash}}<li><strong>Infohash: </strong><a target=_blank href="magnet:?xt=urn:btih:{{infoHash}}">{{infoHash}}</a></li>{{/infoHash}}
<li><strong>Size: </strong>{{#_v.format_size}}{{totalLength}}{{/_v.format_size}} ({{numPieces}} @ {{#_v.format_size}}{{pieceLength}}{{/_v.format_size}})</li>
<li><strong>Status: </strong>{{status}} {{error_msg}}</li>
<li><strong>Dir: </strong>{{dir}}</li>
Expand Down
10 changes: 10 additions & 0 deletions js/aria2.js
Original file line number Diff line number Diff line change
Expand Up @@ -747,11 +747,21 @@ if (typeof ARIA2=="undefined"||!ARIA2) var ARIA2=(function(){
}

result = result.result;
result.uris = [];
for (var i=0; i<result.files.length; i++) {
var file = result.files[i];
file.title = file.path.replace(new RegExp("^"+result.dir.replace(/\\/g, "[\\/]")+"/?"), "");
file.selected = file.selected == "true" ? true : false;
if (file.uris && file.uris.length) {
for (var i=0; i<file.uris.length; i++) {
var uri = file.uris[i].uri;
if (result.uris.indexOf(uri) == -1) {
result.uris.push(uri);
}
}
}
};
console.log(result.uris);
$("#ib-status").empty().append(YAAW.tpl.ib_status(result));
$("#ib-files .file-list").empty().append(YAAW.tpl.files_tree(result.files));
if ($("#task-gid-"+gid).attr("data-status") == "active")
Expand Down
2 changes: 1 addition & 1 deletion offline.appcache
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CACHE MANIFEST
#2016-05-01 13:56
#2017-10-15 11:08

CACHE:
index.html
Expand Down

0 comments on commit 6ac3046

Please sign in to comment.