|
|
@ -1,4 +1,4 @@ |
|
|
|
<div id="ConnectionTab" class="PrefTab"> |
|
|
|
<div id="ConnectionTab" class="PrefTab"> |
|
|
|
<fieldset class="settings"> |
|
|
|
<fieldset class="settings"> |
|
|
|
<legend>_(Listening Port)</legend> |
|
|
|
<legend>_(Listening Port)</legend> |
|
|
|
<label for="port_value">_(Port used for incoming connections:)</label> |
|
|
|
<label for="port_value">_(Port used for incoming connections:)</label> |
|
|
@ -60,6 +60,47 @@ |
|
|
|
<label for="limit_tcp_overhead_checkbox">_(Apply rate limit to transport overhead)</label><br/> |
|
|
|
<label for="limit_tcp_overhead_checkbox">_(Apply rate limit to transport overhead)</label><br/> |
|
|
|
</fieldset> |
|
|
|
</fieldset> |
|
|
|
</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> |
|
|
|
|
|
|
|
|
|
|
|
<div id="BittorrentTab" class="PrefTab invisible"> |
|
|
|
<div id="BittorrentTab" class="PrefTab invisible"> |
|
|
@ -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() { |
|
|
|
updateUpLimitEnabled = function() { |
|
|
|
if($('up_limit_checkbox').getProperty('checked')) { |
|
|
|
if($('up_limit_checkbox').getProperty('checked')) { |
|
|
|
$('up_limit_value').setProperty('disabled', false); |
|
|
|
$('up_limit_value').setProperty('disabled', false); |
|
|
@ -568,6 +625,13 @@ addWatchFolder = function() { |
|
|
|
$('new_watch_folder_dl').setProperty('checked', false); |
|
|
|
$('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() { |
|
|
|
loadPreferences = function() { |
|
|
|
var url = 'json/preferences'; |
|
|
|
var url = 'json/preferences'; |
|
|
|
var request = new Request.JSON({ |
|
|
|
var request = new Request.JSON({ |
|
|
@ -599,6 +663,18 @@ loadPreferences = function() { |
|
|
|
$('up_limit_value').setProperty('value', up_limit); |
|
|
|
$('up_limit_value').setProperty('value', up_limit); |
|
|
|
} |
|
|
|
} |
|
|
|
updateUpLimitEnabled(); |
|
|
|
updateUpLimitEnabled(); |
|
|
|
|
|
|
|
// 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 |
|
|
|
utp_supported = $defined(pref.enable_utp); |
|
|
|
utp_supported = $defined(pref.enable_utp); |
|
|
|
setuTPSettingsVisible(utp_supported); |
|
|
|
setuTPSettingsVisible(utp_supported); |
|
|
@ -819,6 +895,31 @@ applyPreferences = function() { |
|
|
|
} |
|
|
|
} |
|
|
|
settings.set('max_uploads_per_torrent', max_uploads_per_torrent); |
|
|
|
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 |
|
|
|
// Bittorrent |
|
|
|
settings.set('dht', $('dht_checkbox').getProperty('checked')); |
|
|
|
settings.set('dht', $('dht_checkbox').getProperty('checked')); |
|
|
|
settings.set('dhtSameAsBT', $('DHTPortDiffThanBT_checkbox').getProperty('checked')); |
|
|
|
settings.set('dhtSameAsBT', $('DHTPortDiffThanBT_checkbox').getProperty('checked')); |
|
|
|