Merge pull request #8217 from Piccirello/webui-statusbar-freespace

Free disk space in WebUI status bar
This commit is contained in:
Vladimir Golovnev
2018-10-28 10:02:49 +03:00
committed by GitHub
9 changed files with 156 additions and 1 deletions

View File

@@ -421,6 +421,7 @@ window.addEvent('load', function() {
}
else
document.title = "qBittorrent ${VERSION} QBT_TR(Web UI)QBT_TR[CONTEXT=OptionsDialog]";
$('freeSpaceOnDisk').set('html', 'QBT_TR(Free space: %1)QBT_TR[CONTEXT=HttpServer]'.replace("%1", friendlyUnit(serverState.free_space_on_disk)));
$('DHTNodes').set('html', 'QBT_TR(DHT: %1 nodes)QBT_TR[CONTEXT=StatusBar]'.replace("%1", serverState.dht_nodes));
// Statistics dialog

View File

@@ -12,7 +12,7 @@ function friendlyUnit(value, isSpeed) {
"QBT_TR(EiB)QBT_TR[CONTEXT=misc]"
];
if (value < 0)
if ((value === undefined) || (value === null) || (value < 0))
return "QBT_TR(Unknown)QBT_TR[CONTEXT=misc]";
var i = 0;