diff --git a/src/webui/api/synccontroller.cpp b/src/webui/api/synccontroller.cpp index 35704c713..570e721e7 100644 --- a/src/webui/api/synccontroller.cpp +++ b/src/webui/api/synccontroller.cpp @@ -122,7 +122,7 @@ namespace map[KEY_TRANSFER_TOTAL_PEER_CONNECTIONS] = sessionStatus.peersCount; qreal readRatio = cacheStatus.readRatio; - map[KEY_TRANSFER_READ_CACHE_HITS] = (readRatio >= 0) ? Utils::String::fromDouble(100 * readRatio, 2) : "-"; + map[KEY_TRANSFER_READ_CACHE_HITS] = (readRatio > 0) ? Utils::String::fromDouble(100 * readRatio, 2) : "0"; map[KEY_TRANSFER_TOTAL_BUFFERS_SIZE] = cacheStatus.totalUsedBuffers * 16 * 1024; // num_peers is not reliable (adds up peers, which didn't even overcome tcp handshake) diff --git a/src/webui/www/private/css/style.css b/src/webui/www/private/css/style.css index f8c19ac85..f87fed980 100644 --- a/src/webui/www/private/css/style.css +++ b/src/webui/www/private/css/style.css @@ -479,3 +479,8 @@ td.statusBarSeparator { background-position: center 1px; background-size: 2px 18px; } + +/* Statistics window */ +.statisticsValue { + text-align: right; +} diff --git a/src/webui/www/private/scripts/client.js b/src/webui/www/private/scripts/client.js index 1ecbff5b9..06a80459e 100644 --- a/src/webui/www/private/scripts/client.js +++ b/src/webui/www/private/scripts/client.js @@ -401,7 +401,7 @@ window.addEvent('load', function () { $('TotalWastedSession').set('html', friendlyUnit(serverState.total_wasted_session, false)); $('GlobalRatio').set('html', serverState.global_ratio); $('TotalPeerConnections').set('html', serverState.total_peer_connections); - $('ReadCacheHits').set('html', serverState.read_cache_hits); + $('ReadCacheHits').set('html', serverState.read_cache_hits + "%"); $('TotalBuffersSize').set('html', friendlyUnit(serverState.total_buffers_size, false)); $('WriteCacheOverload').set('html', serverState.write_cache_overload + "%"); $('ReadCacheOverload').set('html', serverState.read_cache_overload + "%"); diff --git a/src/webui/www/private/scripts/mocha-init.js b/src/webui/www/private/scripts/mocha-init.js index 615adc45c..54bdcc2bf 100644 --- a/src/webui/www/private/scripts/mocha-init.js +++ b/src/webui/www/private/scripts/mocha-init.js @@ -236,17 +236,19 @@ initializeWindows = function() { }; StatisticsLinkFN = function() { + var id = 'statisticspage'; new MochaUI.Window({ - id: 'statisticspage', + id: id, title: 'QBT_TR(Statistics)QBT_TR[CONTEXT=StatsDialog]', loadMethod: 'xhr', contentURL: 'statistics.html', - scrollbars: false, - resizable: false, maximizable: false, - width: 275, - height: 370, padding: 10 + width: loadWindowWidth(id, 275), + height: loadWindowHeight(id, 370), + onResize: function() { + saveWindowSize(id); + } }); }; diff --git a/src/webui/www/private/statistics.html b/src/webui/www/private/statistics.html index c94763808..580ef495e 100644 --- a/src/webui/www/private/statistics.html +++ b/src/webui/www/private/statistics.html @@ -1,23 +1,23 @@

QBT_TR(User statistics)QBT_TR[CONTEXT=StatsDialog]

- - - - - + - - + + - + - + + + + +
QBT_TR(Alltime download:)QBT_TR[CONTEXT=StatsDialog]
QBT_TR(Alltime upload:)QBT_TR[CONTEXT=StatsDialog]QBT_TR(All-time upload:)QBT_TR[CONTEXT=StatsDialog]
QBT_TR(Total wasted (this session):)QBT_TR[CONTEXT=StatsDialog]QBT_TR(All-time download:)QBT_TR[CONTEXT=StatsDialog]
QBT_TR(Global ratio:)QBT_TR[CONTEXT=StatsDialog]QBT_TR(All-time share ratio:)QBT_TR[CONTEXT=StatsDialog]
QBT_TR(Total peer connections:)QBT_TR[CONTEXT=StatsDialog]QBT_TR(Session waste:)QBT_TR[CONTEXT=StatsDialog]
QBT_TR(Connected peers:)QBT_TR[CONTEXT=StatsDialog]
@@ -29,7 +29,7 @@ - QBT_TR(Total buffers size:)QBT_TR[CONTEXT=StatsDialog] + QBT_TR(Total buffer size:)QBT_TR[CONTEXT=StatsDialog]