mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-02 18:04:32 +00:00
WEBUI: Changed meaning of the value of the 'dl_limit', 'up_limit', 'alt_dl_limit' and 'alt_up_limit' tokens.
The value is expressed in bytes and not in KiB.
This commit is contained in:
parent
e440fc3d17
commit
05f4270d01
@ -912,7 +912,7 @@ loadPreferences = function() {
|
|||||||
|
|
||||||
// Speed tab
|
// Speed tab
|
||||||
// Global Rate Limits
|
// Global Rate Limits
|
||||||
var up_limit = pref.up_limit.toInt();
|
var up_limit = pref.up_limit.toInt() / 1024;
|
||||||
if(up_limit <= 0) {
|
if(up_limit <= 0) {
|
||||||
$('up_limit_checkbox').setProperty('checked', false);
|
$('up_limit_checkbox').setProperty('checked', false);
|
||||||
} else {
|
} else {
|
||||||
@ -920,7 +920,7 @@ loadPreferences = function() {
|
|||||||
$('up_limit_value').setProperty('value', up_limit);
|
$('up_limit_value').setProperty('value', up_limit);
|
||||||
}
|
}
|
||||||
updateUpLimitEnabled();
|
updateUpLimitEnabled();
|
||||||
var dl_limit = pref.dl_limit.toInt();
|
var dl_limit = pref.dl_limit.toInt() / 1024;
|
||||||
if(dl_limit <= 0) {
|
if(dl_limit <= 0) {
|
||||||
$('dl_limit_checkbox').setProperty('checked', false);
|
$('dl_limit_checkbox').setProperty('checked', false);
|
||||||
} else {
|
} else {
|
||||||
@ -934,7 +934,7 @@ loadPreferences = function() {
|
|||||||
updateUTPEnabled();
|
updateUTPEnabled();
|
||||||
|
|
||||||
// Alternative Global Rate Limits
|
// Alternative Global Rate Limits
|
||||||
var alt_up_limit = pref.alt_up_limit.toInt();
|
var alt_up_limit = pref.alt_up_limit.toInt() / 1024;
|
||||||
if(alt_up_limit <= 0) {
|
if(alt_up_limit <= 0) {
|
||||||
$('alt_up_limit_checkbox').setProperty('checked', false);
|
$('alt_up_limit_checkbox').setProperty('checked', false);
|
||||||
} else {
|
} else {
|
||||||
@ -942,7 +942,7 @@ loadPreferences = function() {
|
|||||||
$('alt_up_limit_value').setProperty('value', alt_up_limit);
|
$('alt_up_limit_value').setProperty('value', alt_up_limit);
|
||||||
}
|
}
|
||||||
updateAltUpLimitEnabled();
|
updateAltUpLimitEnabled();
|
||||||
var alt_dl_limit = pref.alt_dl_limit.toInt();
|
var alt_dl_limit = pref.alt_dl_limit.toInt() / 1024;
|
||||||
if(alt_dl_limit <= 0) {
|
if(alt_dl_limit <= 0) {
|
||||||
$('alt_dl_limit_checkbox').setProperty('checked', false);
|
$('alt_dl_limit_checkbox').setProperty('checked', false);
|
||||||
} else {
|
} else {
|
||||||
@ -1146,7 +1146,7 @@ applyPreferences = function() {
|
|||||||
// Global Rate Limits
|
// Global Rate Limits
|
||||||
var up_limit = -1;
|
var up_limit = -1;
|
||||||
if($('up_limit_checkbox').getProperty('checked')) {
|
if($('up_limit_checkbox').getProperty('checked')) {
|
||||||
up_limit = $('up_limit_value').getProperty('value').toInt();
|
up_limit = $('up_limit_value').getProperty('value').toInt() * 1024;
|
||||||
if(isNaN(up_limit) || up_limit <= 0) {
|
if(isNaN(up_limit) || up_limit <= 0) {
|
||||||
alert("QBT_TR(Global upload rate limit must be greater than 0 or disabled.)QBT_TR");
|
alert("QBT_TR(Global upload rate limit must be greater than 0 or disabled.)QBT_TR");
|
||||||
return;
|
return;
|
||||||
@ -1155,7 +1155,7 @@ applyPreferences = function() {
|
|||||||
settings.set('up_limit', up_limit);
|
settings.set('up_limit', up_limit);
|
||||||
var dl_limit = -1;
|
var dl_limit = -1;
|
||||||
if($('dl_limit_checkbox').getProperty('checked')) {
|
if($('dl_limit_checkbox').getProperty('checked')) {
|
||||||
dl_limit = $('dl_limit_value').getProperty('value').toInt();
|
dl_limit = $('dl_limit_value').getProperty('value').toInt() * 1024;
|
||||||
if(isNaN(dl_limit) || dl_limit <= 0) {
|
if(isNaN(dl_limit) || dl_limit <= 0) {
|
||||||
alert("QBT_TR(Global download rate limit must be greater than 0 or disabled.)QBT_TR");
|
alert("QBT_TR(Global download rate limit must be greater than 0 or disabled.)QBT_TR");
|
||||||
return;
|
return;
|
||||||
@ -1169,7 +1169,7 @@ applyPreferences = function() {
|
|||||||
// Alternative Global Rate Limits
|
// Alternative Global Rate Limits
|
||||||
var alt_up_limit = -1;
|
var alt_up_limit = -1;
|
||||||
if($('alt_up_limit_checkbox').getProperty('checked')) {
|
if($('alt_up_limit_checkbox').getProperty('checked')) {
|
||||||
alt_up_limit = $('alt_up_limit_value').getProperty('value').toInt();
|
alt_up_limit = $('alt_up_limit_value').getProperty('value').toInt() * 1024;
|
||||||
if(isNaN(alt_up_limit) || alt_up_limit <= 0) {
|
if(isNaN(alt_up_limit) || alt_up_limit <= 0) {
|
||||||
alert("QBT_TR(Alternative upload rate limit must be greater than 0 or disabled.)QBT_TR");
|
alert("QBT_TR(Alternative upload rate limit must be greater than 0 or disabled.)QBT_TR");
|
||||||
return;
|
return;
|
||||||
@ -1178,7 +1178,7 @@ applyPreferences = function() {
|
|||||||
settings.set('alt_up_limit', alt_up_limit);
|
settings.set('alt_up_limit', alt_up_limit);
|
||||||
var alt_dl_limit = -1;
|
var alt_dl_limit = -1;
|
||||||
if($('alt_dl_limit_checkbox').getProperty('checked')) {
|
if($('alt_dl_limit_checkbox').getProperty('checked')) {
|
||||||
alt_dl_limit = $('alt_dl_limit_value').getProperty('value').toInt();
|
alt_dl_limit = $('alt_dl_limit_value').getProperty('value').toInt() * 1024;
|
||||||
if(isNaN(alt_dl_limit) || alt_dl_limit <= 0) {
|
if(isNaN(alt_dl_limit) || alt_dl_limit <= 0) {
|
||||||
alert("QBT_TR(Alternative download rate limit must be greater than 0 or disabled.)QBT_TR");
|
alert("QBT_TR(Alternative download rate limit must be greater than 0 or disabled.)QBT_TR");
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user