WebUI: Change torrent model

Improvements:
- added functions, which may be used to reorder and hiding columns in torrents table
- new columns can be easily added to torrents table
This commit is contained in:
buinsky
2014-12-24 04:39:18 +03:00
parent 91ec84b317
commit 04f1c0c238
6 changed files with 593 additions and 341 deletions

View File

@@ -16,7 +16,8 @@ function friendlyUnit(value, isSpeed) {
while (value >= 1024. && i++ < 6)
value /= 1024.;
var ret;
ret = value.toFixed(1) + " " + units[i];
ret = (Math.floor(10 * value) / 10).toFixed(1) //Don't round up
+ " " + units[i];
if (isSpeed)
ret += "QBT_TR(/s)QBT_TR";
return ret;
@@ -73,3 +74,9 @@ if (!Date.prototype.toISOString) {
}());
}
function escapeHtml(str) {
var div = document.createElement('div');
div.appendChild(document.createTextNode(str));
return div.innerHTML;
};