mirror of
https://github.com/Carve/qbittorrent-webui-cjratliff.com.git
synced 2024-11-13 18:30:48 +01:00
Merge pull request #63 from itscooldani/show-size
Show Total Torrent Size
This commit is contained in:
commit
70f0b0e2c3
@ -242,6 +242,8 @@
|
||||
<span id="error_div"></span>
|
||||
<table style="position: absolute; right: 5px;">
|
||||
<tr>
|
||||
<td id="torrentsTotalSize"></td>
|
||||
<td class="statusBarSeparator"></td>
|
||||
<td id="freeSpaceOnDisk"></td>
|
||||
<td class="statusBarSeparator"></td>
|
||||
<td id="DHTNodes"></td>
|
||||
|
@ -842,6 +842,15 @@ window.addEvent('load', function() {
|
||||
}
|
||||
else
|
||||
document.title = ("qBittorrent " + qbtVersion() + " Web UI");
|
||||
|
||||
let totalSize = 0;
|
||||
for (const tr in torrentsTable.rows) {
|
||||
if (torrentsTable.rows[tr].full_data){
|
||||
totalSize += torrentsTable.rows[tr].full_data.size;
|
||||
}
|
||||
}
|
||||
|
||||
$('torrentsTotalSize').set('html', 'Total Downloads: %1 (%2\%)'.replace("%1", window.qBittorrent.Misc.friendlyUnit(totalSize)).replace("%2", ((totalSize/(totalSize + serverState.free_space_on_disk))*100).toFixed(2)));
|
||||
$('freeSpaceOnDisk').set('html', 'Free space: %1'.replace("%1", window.qBittorrent.Misc.friendlyUnit(serverState.free_space_on_disk)));
|
||||
$('DHTNodes').set('html', 'DHT: %1 nodes'.replace("%1", serverState.dht_nodes));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user