mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-06 15:42:32 -06:00
Add "Remaining" and "Availability" columns to webui Content tab
This commit is contained in:
@@ -105,7 +105,9 @@
|
||||
<th>QBT_TR(Name)QBT_TR[CONTEXT=TorrentContentModel]</th>
|
||||
<th style="width: 150px;">QBT_TR(Size)QBT_TR[CONTEXT=TorrentContentModel]</th>
|
||||
<th style="width: 90px;">QBT_TR(Progress)QBT_TR[CONTEXT=TorrentContentModel]</th>
|
||||
<th style="width: 150px; border-right: 0">QBT_TR(Download Priority)QBT_TR[CONTEXT=TorrentContentModel]</th>
|
||||
<th style="width: 150px;">QBT_TR(Download Priority)QBT_TR[CONTEXT=TorrentContentModel]</th>
|
||||
<th style="width: 150px;">QBT_TR(Remaining)QBT_TR[CONTEXT=TorrentContentModel]</th>
|
||||
<th style="width: 150px; border-right: 0">QBT_TR(Availability)QBT_TR[CONTEXT=TorrentContentModel]</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="filesTable"></tbody>
|
||||
|
||||
@@ -64,6 +64,15 @@ function friendlyDuration(seconds) {
|
||||
return "∞";
|
||||
}
|
||||
|
||||
function friendlyPercentage(value) {
|
||||
var percentage = (value * 100).round(1);
|
||||
if (isNaN(percentage) || (percentage < 0))
|
||||
percentage = 0;
|
||||
if (percentage > 100)
|
||||
percentage = 100;
|
||||
return percentage + "%";
|
||||
}
|
||||
|
||||
/*
|
||||
* From: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
|
||||
*/
|
||||
|
||||
@@ -317,6 +317,9 @@ var loadTorrentFilesData = function() {
|
||||
if (row[3] == 100.0 && file.progress < 1.0)
|
||||
row[3] = 99.9;
|
||||
row[4] = file.priority;
|
||||
row[5] = friendlyUnit(file.size * (1.0 - file.progress));
|
||||
row[6] = friendlyPercentage(file.availability);
|
||||
|
||||
fTable.insertRow(i, row);
|
||||
i++;
|
||||
}.bind(this));
|
||||
|
||||
Reference in New Issue
Block a user