Browse Source

Merge pull request #2125 from buinsky/master

WEBUI: Some fixes
adaptive-webui-19844
sledgehammer999 10 years ago
parent
commit
8ce91e153d
  1. BIN
      src/Icons/oxygen/go-bottom.png
  2. BIN
      src/Icons/oxygen/go-down.png
  3. BIN
      src/Icons/oxygen/go-top.png
  4. BIN
      src/Icons/oxygen/go-up.png
  5. 2
      src/icons.qrc
  6. 3
      src/webui/btjson.cpp
  7. 2
      src/webui/www/public/css/style.css
  8. 5
      src/webui/www/public/scripts/client.js
  9. 5
      src/webui/www/public/scripts/misc.js
  10. 4
      src/webui/www/public/scripts/parametrics.js

BIN
src/Icons/oxygen/go-bottom.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
src/Icons/oxygen/go-down.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
src/Icons/oxygen/go-top.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
src/Icons/oxygen/go-up.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

2
src/icons.qrc

@ -363,5 +363,7 @@ @@ -363,5 +363,7 @@
<file>Icons/skin/toolbox-divider2.gif</file>
<file>Icons/skin/uploading.png</file>
<file>Icons/oxygen/system-log-out.png</file>
<file>Icons/oxygen/go-bottom.png</file>
<file>Icons/oxygen/go-top.png</file>
</qresource>
</RCC>

3
src/webui/btjson.cpp

@ -33,6 +33,7 @@ @@ -33,6 +33,7 @@
#include "qbtsession.h"
#include "torrentpersistentdata.h"
#include "jsonutils.h"
#include "preferences.h"
#include <QDebug>
#include <QVariant>
@ -131,6 +132,7 @@ static const char KEY_TRANSFER_DLSPEED[] = "dl_info_speed"; @@ -131,6 +132,7 @@ static const char KEY_TRANSFER_DLSPEED[] = "dl_info_speed";
static const char KEY_TRANSFER_DLDATA[] = "dl_info_data";
static const char KEY_TRANSFER_UPSPEED[] = "up_info_speed";
static const char KEY_TRANSFER_UPDATA[] = "up_info_data";
static const char KEY_SHOW_SPEED_IN_TITLE[] = "show_speed_in_title";
static QVariantMap toMap(const QTorrentHandle& h)
{
@ -394,5 +396,6 @@ QByteArray btjson::getTransferInfo() @@ -394,5 +396,6 @@ QByteArray btjson::getTransferInfo()
info[KEY_TRANSFER_DLDATA] = static_cast<qlonglong>(sessionStatus.total_payload_download);
info[KEY_TRANSFER_UPSPEED] = sessionStatus.payload_upload_rate;
info[KEY_TRANSFER_UPDATA] = static_cast<qlonglong>(sessionStatus.total_payload_upload);
info[KEY_SHOW_SPEED_IN_TITLE] = Preferences::instance()->speedInTitleBar();
return json::toJson(info);
}

2
src/webui/www/public/css/style.css

@ -136,6 +136,8 @@ hr { @@ -136,6 +136,8 @@ hr {
#Filters ul img {
padding: 2px 4px;
vertical-align: middle;
width: 16px;
height: 16px;
}
.selectedFilter {

5
src/webui/www/public/scripts/client.js

@ -112,6 +112,11 @@ window.addEvent('load', function(){ @@ -112,6 +112,11 @@ window.addEvent('load', function(){
.replace("%2", friendlyUnit(info.dl_info_data, false)));
$("UpInfos").set('html', "_(U: %1 - T: %2)".replace("%1", friendlyUnit(info.up_info_speed, true))
.replace("%2", friendlyUnit(info.up_info_data, false)));
if(info.show_speed_in_title) {
document.title = "_(D:%1 U:%2)".replace("%1", friendlyUnit(info.dl_info_speed, true)).replace("%2", friendlyUnit(info.up_info_speed, true));
} else {
document.title = "_(qBittorrent web User Interface)";
}
waitingTrInfo=false;
loadTransferInfo.delay(3000);
}

5
src/webui/www/public/scripts/misc.js

@ -16,10 +16,7 @@ function friendlyUnit(value, isSpeed) { @@ -16,10 +16,7 @@ function friendlyUnit(value, isSpeed) {
while (value >= 1024. && i++ < 6)
value /= 1024.;
var ret;
if (i == 0)
ret = value.toFixed(2) + " " + units[0];
else
ret = value.toFixed(2) + " " + units[i];
ret = value.toFixed(1) + " " + units[i];
if (isSpeed)
ret += "_(/s)";
return ret;

4
src/webui/www/public/scripts/parametrics.js

@ -31,7 +31,7 @@ MochaUI.extend({ @@ -31,7 +31,7 @@ MochaUI.extend({
if(tmp > 0) {
maximum = tmp / 1024.
} else {
maximum = 0
maximum = 1000
}
}
// Get torrent upload limit
@ -118,7 +118,7 @@ MochaUI.extend({ @@ -118,7 +118,7 @@ MochaUI.extend({
if(tmp > 0) {
maximum = tmp / 1024.
} else {
maximum = 0
maximum = 1000
}
}
// Get torrent download limit

Loading…
Cancel
Save