|
|
|
@ -1,4 +1,4 @@
@@ -1,4 +1,4 @@
|
|
|
|
|
<div id="ConnectionTab" class="PrefTab"> |
|
|
|
|
<div id="ConnectionTab" class="PrefTab"> |
|
|
|
|
<fieldset class="settings"> |
|
|
|
|
<legend>_(Listening Port)</legend> |
|
|
|
|
<label for="port_value">_(Port used for incoming connections:)</label> |
|
|
|
@ -60,6 +60,47 @@
@@ -60,6 +60,47 @@
|
|
|
|
|
<label for="limit_tcp_overhead_checkbox">_(Apply rate limit to transport overhead)</label><br/> |
|
|
|
|
</fieldset> |
|
|
|
|
</fieldset> |
|
|
|
|
<fieldset class="settings"> |
|
|
|
|
<legend>_(Alternative Global Rate Limits)</legend> |
|
|
|
|
<table> |
|
|
|
|
<tr> |
|
|
|
|
<td> |
|
|
|
|
_(Upload:) |
|
|
|
|
</td> |
|
|
|
|
<td><input type="text" id="alt_up_limit_value" style="width: 4em;"/> _(KiB/s)</td> |
|
|
|
|
</tr> |
|
|
|
|
<tr> |
|
|
|
|
<td> |
|
|
|
|
_(Download:) |
|
|
|
|
</td> |
|
|
|
|
<td><input type="text" id="alt_dl_limit_value" style="width: 4em;"/> _(KiB/s)</td> |
|
|
|
|
</tr> |
|
|
|
|
</table> |
|
|
|
|
|
|
|
|
|
<fieldset class="settings"> |
|
|
|
|
<legend><input type="checkbox" id="limit_sheduling_checkbox" onClick="updateSchedulingEnabled();"/> |
|
|
|
|
<label for="limit_sheduling_checkbox">_(Schedule the use of alternative rate limits)</label></legend> |
|
|
|
|
_(from) |
|
|
|
|
<input type="text" id="schedule_from_hour" style="width: 1.5em;"/>:<input type="text" id="schedule_from_min" style="width: 1.5em;"/> |
|
|
|
|
_(to) |
|
|
|
|
<input type="text" id="schedule_to_hour" style="width: 1.5em;"/>:<input type="text" id="schedule_to_min" style="width: 1.5em;"/> |
|
|
|
|
<br/> |
|
|
|
|
_(When:) |
|
|
|
|
<select id="schedule_freq_select"> |
|
|
|
|
<option value="0">_(Every day)</option> |
|
|
|
|
<option value="1">_(Week days)</option> |
|
|
|
|
<option value="2">_(Week ends)</option> |
|
|
|
|
<option value="3">_(Monday)</option> |
|
|
|
|
<option value="4">_(Tuesday)</option> |
|
|
|
|
<option value="5">_(Wednesday)</option> |
|
|
|
|
<option value="6">_(Thursday)</option> |
|
|
|
|
<option value="7">_(Friday)</option> |
|
|
|
|
<option value="8">_(Saturday)</option> |
|
|
|
|
<option value="9">_(Sunday)</option> |
|
|
|
|
</select> |
|
|
|
|
</br/> |
|
|
|
|
</fieldset> |
|
|
|
|
</fieldset> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div id="BittorrentTab" class="PrefTab invisible"> |
|
|
|
@ -344,6 +385,22 @@ updateDlLimitEnabled = function() {
@@ -344,6 +385,22 @@ updateDlLimitEnabled = function() {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
updateSchedulingEnabled = function() { |
|
|
|
|
if($('limit_sheduling_checkbox').getProperty('checked')) { |
|
|
|
|
$('schedule_from_hour').setProperty('disabled', false); |
|
|
|
|
$('schedule_from_min').setProperty('disabled', false); |
|
|
|
|
$('schedule_to_hour').setProperty('disabled', false); |
|
|
|
|
$('schedule_to_min').setProperty('disabled', false); |
|
|
|
|
$('schedule_freq_select').setProperty('disabled', false); |
|
|
|
|
} else { |
|
|
|
|
$('schedule_from_hour').setProperty('disabled', true); |
|
|
|
|
$('schedule_from_min').setProperty('disabled', true); |
|
|
|
|
$('schedule_to_hour').setProperty('disabled', true); |
|
|
|
|
$('schedule_to_min').setProperty('disabled', true); |
|
|
|
|
$('schedule_freq_select').setProperty('disabled', true); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
updateUpLimitEnabled = function() { |
|
|
|
|
if($('up_limit_checkbox').getProperty('checked')) { |
|
|
|
|
$('up_limit_value').setProperty('disabled', false); |
|
|
|
@ -568,6 +625,13 @@ addWatchFolder = function() {
@@ -568,6 +625,13 @@ addWatchFolder = function() {
|
|
|
|
|
$('new_watch_folder_dl').setProperty('checked', false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
time_padding = function(val) { |
|
|
|
|
ret = val.toString(); |
|
|
|
|
if(ret.length == 1) |
|
|
|
|
ret = '0' + ret |
|
|
|
|
return ret; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
loadPreferences = function() { |
|
|
|
|
var url = 'json/preferences'; |
|
|
|
|
var request = new Request.JSON({ |
|
|
|
@ -599,14 +663,26 @@ loadPreferences = function() {
@@ -599,14 +663,26 @@ loadPreferences = function() {
|
|
|
|
|
$('up_limit_value').setProperty('value', up_limit); |
|
|
|
|
} |
|
|
|
|
updateUpLimitEnabled(); |
|
|
|
|
// uTP |
|
|
|
|
utp_supported = $defined(pref.enable_utp); |
|
|
|
|
setuTPSettingsVisible(utp_supported); |
|
|
|
|
if(utp_supported) { |
|
|
|
|
$('enable_utp_checkbox').setProperty('checked', pref.enable_utp); |
|
|
|
|
$('limit_utp_rate_checkbox').setProperty('checked', pref.limit_utp_rate); |
|
|
|
|
} |
|
|
|
|
$('limit_tcp_overhead_checkbox').setProperty('checked', pref.limit_tcp_overhead); |
|
|
|
|
// Alternative limits |
|
|
|
|
$('alt_dl_limit_value').setProperty('value', pref.alt_dl_limit.toInt()); |
|
|
|
|
$('alt_up_limit_value').setProperty('value', pref.alt_up_limit.toInt()); |
|
|
|
|
// Scheduling |
|
|
|
|
$('limit_sheduling_checkbox').setProperty('checked', pref.scheduler_enabled); |
|
|
|
|
$('schedule_from_hour').setProperty('value', time_padding(pref.schedule_from_hour)); |
|
|
|
|
$('schedule_from_min').setProperty('value', time_padding(pref.schedule_from_min)); |
|
|
|
|
$('schedule_to_hour').setProperty('value', time_padding(pref.schedule_to_hour)); |
|
|
|
|
$('schedule_to_min').setProperty('value', time_padding(pref.schedule_to_min)); |
|
|
|
|
$('schedule_freq_select').setProperty('value', pref.scheduler_days); |
|
|
|
|
updateSchedulingEnabled(); |
|
|
|
|
|
|
|
|
|
// uTP |
|
|
|
|
utp_supported = $defined(pref.enable_utp); |
|
|
|
|
setuTPSettingsVisible(utp_supported); |
|
|
|
|
if(utp_supported) { |
|
|
|
|
$('enable_utp_checkbox').setProperty('checked', pref.enable_utp); |
|
|
|
|
$('limit_utp_rate_checkbox').setProperty('checked', pref.limit_utp_rate); |
|
|
|
|
} |
|
|
|
|
$('limit_tcp_overhead_checkbox').setProperty('checked', pref.limit_tcp_overhead); |
|
|
|
|
var max_connec = pref.max_connec.toInt(); |
|
|
|
|
if(max_connec <= 0) { |
|
|
|
|
$('max_connec_checkbox').setProperty('checked', false); |
|
|
|
@ -737,13 +813,13 @@ loadPreferences = function() {
@@ -737,13 +813,13 @@ loadPreferences = function() {
|
|
|
|
|
$('ssl_key_textarea').setProperty('value', pref.ssl_key); |
|
|
|
|
$('ssl_cert_textarea').setProperty('value', pref.ssl_cert); |
|
|
|
|
$('locale_select').setProperty('value', pref.locale); |
|
|
|
|
// Dyndns |
|
|
|
|
$('use_dyndns_checkbox').setProperty('checked', pref.dyndns_enabled); |
|
|
|
|
updateDynDnsSettings(); |
|
|
|
|
$('dyndns_select').setProperty('value', pref.dyndns_service); |
|
|
|
|
$('dyndns_domain_text').setProperty('value', pref.dyndns_domain); |
|
|
|
|
$('dyndns_username_text').setProperty('value', pref.dyndns_username); |
|
|
|
|
$('dyndns_password_text').setProperty('value', pref.dyndns_password); |
|
|
|
|
// Dyndns |
|
|
|
|
$('use_dyndns_checkbox').setProperty('checked', pref.dyndns_enabled); |
|
|
|
|
updateDynDnsSettings(); |
|
|
|
|
$('dyndns_select').setProperty('value', pref.dyndns_service); |
|
|
|
|
$('dyndns_domain_text').setProperty('value', pref.dyndns_domain); |
|
|
|
|
$('dyndns_username_text').setProperty('value', pref.dyndns_username); |
|
|
|
|
$('dyndns_password_text').setProperty('value', pref.dyndns_password); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}).send(); |
|
|
|
@ -819,6 +895,31 @@ applyPreferences = function() {
@@ -819,6 +895,31 @@ applyPreferences = function() {
|
|
|
|
|
} |
|
|
|
|
settings.set('max_uploads_per_torrent', max_uploads_per_torrent); |
|
|
|
|
|
|
|
|
|
// Alternative speed limits |
|
|
|
|
var alt_dl_limit = $('alt_dl_limit_value').getProperty('value').toInt(); |
|
|
|
|
if(alt_dl_limit <= 0) { |
|
|
|
|
alert("_(Download rate limit must be greater than 0 or disabled.)"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
settings.set('alt_dl_limit', alt_dl_limit); |
|
|
|
|
|
|
|
|
|
var alt_up_limit = $('alt_up_limit_value').getProperty('value').toInt(); |
|
|
|
|
if(alt_up_limit <= 0) { |
|
|
|
|
alert("_(Upload rate limit must be greater than 0 or disabled.)"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
settings.set('alt_up_limit', alt_up_limit); |
|
|
|
|
|
|
|
|
|
// Scheduler |
|
|
|
|
var scheduling_enabled = $('limit_sheduling_checkbox').getProperty('checked'); |
|
|
|
|
settings.set('scheduler_enabled', scheduling_enabled); |
|
|
|
|
if (scheduling_enabled) { |
|
|
|
|
settings.set('schedule_from_hour', $('schedule_from_hour').getProperty('value').toInt()); |
|
|
|
|
settings.set('schedule_from_min', $('schedule_from_min').getProperty('value').toInt()); |
|
|
|
|
settings.set('schedule_to_hour', $('schedule_to_hour').getProperty('value').toInt()); |
|
|
|
|
settings.set('schedule_to_min', $('schedule_to_min').getProperty('value').toInt()); |
|
|
|
|
settings.set('scheduler_days', $('schedule_freq_select').getProperty('value').toInt()); |
|
|
|
|
} |
|
|
|
|
// Bittorrent |
|
|
|
|
settings.set('dht', $('dht_checkbox').getProperty('checked')); |
|
|
|
|
settings.set('dhtSameAsBT', $('DHTPortDiffThanBT_checkbox').getProperty('checked')); |
|
|
|
|