added rtorrent_id column

This commit is contained in:
iou1name 2019-08-31 21:43:41 -04:00
parent 1b9c3d1835
commit d570a0c1ae
4 changed files with 7 additions and 3 deletions

View File

@ -15,7 +15,8 @@ sp = []
torrents = [[]] * NUM_INST
class Torrent:
def __init__(self, raw):
def __init__(self, raw, rt_id):
self.rtorrent_id = rt_id
self.hash = raw[0]
self.name = raw[1]
@ -140,7 +141,7 @@ def get_all(n):
'd.message=',
'd.hashing=',
)
return [Torrent(raw) for raw in res]
return [Torrent(raw, n) for raw in res]
def init():
"""Initializes the rTorrent interface."""

View File

@ -18,7 +18,7 @@ tr {
padding-left: 0.5em;
}
.totalSize, .state, .downrate, .downPercent, .eta, .uprate, .tracker {
.totalSize, .state, .downrate, .downPercent, .eta, .uprate, .tracker, .rt_id {
text-align: center;
width: 10%;
}

View File

@ -20,6 +20,7 @@ function get_active_torrents() {
html_str += '<td class="eta">' + torrents[i].eta_str + '</td>';
html_str += '<td class="uprate">' + torrents[i].uprate_str + '</td>';
html_str += '<td class="tracker">' + torrents[i].tracker + '</td>';
html_str += '<td class="rt_id">' + torrents[i].rtorrent_id + '</td>';
html_str += '</tr>';
}
document.getElementById('torrents').children[1].innerHTML = html_str;

View File

@ -21,6 +21,7 @@
<th class="eta">ETA</th>
<th class="uprate">UL</th>
<th class="tracker">Tracker</th>
<th class="rt_id">RT id</th>
</tr>
</thead>
<tbody>
@ -34,6 +35,7 @@
<td class="eta">{{ torrent.eta_str }}</td>
<td class="uprate">{{ torrent.uprate_str }}</td>
<td class="tracker">{{ torrent.tracker }}</td>
<td class="rt_id">{{ torrent.rtorrent_id }}</td>
</tr>
{% endfor %}
</tbody>