Allow to use proxy per subsystem
[qBittorrent.git] / src / webui / www / private / views / preferences.html
blob5bf0ec1c2eed090717fe4a94a29c1f5fb930d3e8
1 <div id="BehaviorTab" class="PrefTab">
2 <fieldset class="settings">
3 <legend>QBT_TR(Language)QBT_TR[CONTEXT=OptionsDialog]</legend>
4 <label for="locale_select">QBT_TR(User Interface Language:)QBT_TR[CONTEXT=OptionsDialog]</label>
5 <select id="locale_select">
6 ${LANGUAGE_OPTIONS}
7 </select>
8 </fieldset>
10 <fieldset class="settings">
11 <legend>
12 <input type="checkbox" id="filelog_checkbox" onclick="qBittorrent.Preferences.updateFileLogEnabled();" />
13 <label for="filelog_checkbox">QBT_TR(Log file)QBT_TR[CONTEXT=OptionsDialog]</label>
14 </legend>
15 <div class="formRow">
16 <label for="filelog_save_path_input">QBT_TR(Save path:)QBT_TR[CONTEXT=OptionsDialog]</label>
17 <input type="text" id="filelog_save_path_input" />
18 </div>
19 <table>
20 <tr>
21 <td><input type="checkbox" id="filelog_backup_checkbox" onclick="qBittorrent.Preferences.updateFileLogBackupEnabled();" /></td>
22 <td><label for="filelog_backup_checkbox">QBT_TR(Backup the log file after:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
23 <td><input id="filelog_max_size_input" type=number min="1" max="1024000" value="65" onchange="qBittorrent.Preferences.numberInputLimiter(this);" />QBT_TR(KiB)QBT_TR[CONTEXT=OptionsDialog]</td>
24 </tr>
25 <tr>
26 <td><input type="checkbox" id="filelog_delete_old_checkbox" onclick="qBittorrent.Preferences.updateFileLogDeleteEnabled();" /></td>
27 <td><label for="filelog_delete_old_checkbox">QBT_TR(Delete backup logs older than:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
28 <td>
29 <input type=number min="1" max="365" value="6" id="filelog_age_input" onchange="qBittorrent.Preferences.numberInputLimiter(this);" />
30 <select id="filelog_age_type_select">
31 <option value="0">QBT_TR(days)QBT_TR[CONTEXT=OptionsDialog]</option>
32 <option value="1" selected>QBT_TR(months)QBT_TR[CONTEXT=OptionsDialog]</option>
33 <option value="2">QBT_TR(years)QBT_TR[CONTEXT=OptionsDialog]</option>
34 </select>
35 </td>
36 </tr>
37 </table>
38 </fieldset>
40 <div class="formRow">
41 <input type="checkbox" id="performanceWarning" />
42 <label for="performanceWarning">QBT_TR(Log performance warnings)QBT_TR[CONTEXT=OptionsDialog]</label>
43 </div>
44 </div>
46 <div id="DownloadsTab" class="PrefTab invisible">
47 <fieldset class="settings">
48 <legend>QBT_TR(When adding a torrent)QBT_TR[CONTEXT=OptionsDialog]</legend>
49 <div class="formRow">
50 <label for="contentlayout_select">QBT_TR(Torrent content layout:)QBT_TR[CONTEXT=OptionsDialog]</label>
51 <select id="contentlayout_select">
52 <option value="Original">QBT_TR(Original)QBT_TR[CONTEXT=OptionsDialog]</option>
53 <option value="Subfolder">QBT_TR(Create subfolder)QBT_TR[CONTEXT=OptionsDialog]</option>
54 <option value="NoSubfolder">QBT_TR(Don't create subfolder)QBT_TR[CONTEXT=OptionsDialog]</option>
55 </select>
56 </div>
57 <div class="formRow">
58 <input type="checkbox" id="dontstartdownloads_checkbox" />
59 <label for="dontstartdownloads_checkbox">QBT_TR(Do not start the download automatically)QBT_TR[CONTEXT=OptionsDialog]</label>
60 </div>
61 <div class="formRow">
62 <label for="stopConditionSelect">QBT_TR(Torrent stop condition:)QBT_TR[CONTEXT=OptionsDialog]</label>
63 <select id="stopConditionSelect">
64 <option value="None">QBT_TR(None)QBT_TR[CONTEXT=OptionsDialog]</option>
65 <option value="MetadataReceived">QBT_TR(Metadata received)QBT_TR[CONTEXT=OptionsDialog]</option>
66 <option value="FilesChecked">QBT_TR(Files checked)QBT_TR[CONTEXT=OptionsDialog]</option>
67 </select>
68 </div>
69 <div class="formRow">
70 <input type="checkbox" id="deletetorrentfileafter_checkbox" />
71 <label for="deletetorrentfileafter_checkbox">QBT_TR(Delete .torrent files afterwards)QBT_TR[CONTEXT=OptionsDialog]</label>
72 </div>
73 </fieldset>
75 <div class="formRow">
76 <input type="checkbox" id="preallocateall_checkbox" />
77 <label for="preallocateall_checkbox">QBT_TR(Pre-allocate disk space for all files)QBT_TR[CONTEXT=OptionsDialog]</label>
78 </div>
79 <div class="formRow">
80 <span id="appendexttr">
81 <input type="checkbox" id="appendext_checkbox" />
82 <label for="appendext_checkbox">QBT_TR(Append .!qB extension to incomplete files)QBT_TR[CONTEXT=OptionsDialog]</label>
83 </span>
84 </div>
86 <fieldset class="settings">
87 <legend>QBT_TR(Saving Management)QBT_TR[CONTEXT=HttpServer]</legend>
88 <table>
89 <tr>
90 <td>
91 <label>QBT_TR(Default Torrent Management Mode:)QBT_TR[CONTEXT=OptionsDialog]</label>
92 </td>
93 <td>
94 <select id="default_tmm_combobox">
95 <option value="false" selected>QBT_TR(Manual)QBT_TR[CONTEXT=OptionsDialog]</option>
96 <option value="true">QBT_TR(Automatic)QBT_TR[CONTEXT=OptionsDialog]</option>
97 </select>
98 </td>
99 </tr>
100 <tr>
101 <td>
102 <label>QBT_TR(When Torrent Category changed:)QBT_TR[CONTEXT=OptionsDialog]</label>
103 </td>
104 <td>
105 <select id="torrent_changed_tmm_combobox">
106 <option value="true">QBT_TR(Relocate torrent)QBT_TR[CONTEXT=OptionsDialog]</option>
107 <option value="false" selected>QBT_TR(Switch torrent to Manual Mode)QBT_TR[CONTEXT=OptionsDialog]</option>
108 </select>
109 </td>
110 </tr>
111 <tr>
112 <td>
113 <label>QBT_TR(When Default Save Path changed:)QBT_TR[CONTEXT=OptionsDialog]</label>
114 </td>
115 <td>
116 <select id="save_path_changed_tmm_combobox">
117 <option value="true">QBT_TR(Relocate affected torrents)QBT_TR[CONTEXT=OptionsDialog]</option>
118 <option value="false" selected>QBT_TR(Switch affected torrents to Manual Mode)QBT_TR[CONTEXT=OptionsDialog]</option>
119 </select>
120 </td>
121 </tr>
122 <tr>
123 <td>
124 <label>QBT_TR(When Category Save Path changed:)QBT_TR[CONTEXT=OptionsDialog]</label>
125 </td>
126 <td>
127 <select id="category_changed_tmm_combobox">
128 <option value="true">QBT_TR(Relocate affected torrents)QBT_TR[CONTEXT=OptionsDialog]</option>
129 <option value="false" selected>QBT_TR(Switch affected torrents to Manual Mode)QBT_TR[CONTEXT=OptionsDialog]</option>
130 </select>
131 </td>
132 </tr>
133 </table>
134 <table>
135 <tr>
136 <td>
137 <label for="savepath_text">QBT_TR(Default Save Path:)QBT_TR[CONTEXT=OptionsDialog]</label>
138 </td>
139 <td>
140 <input type="text" id="savepath_text" autocorrect="off" autocapitalize="none" />
141 </td>
142 </tr>
143 <tr>
144 <td>
145 <input type="checkbox" id="temppath_checkbox" onclick="qBittorrent.Preferences.updateTempDirEnabled();" />
146 <label for="temppath_checkbox">QBT_TR(Keep incomplete torrents in:)QBT_TR[CONTEXT=OptionsDialog]</label>
147 </td>
148 <td>
149 <input type="text" id="temppath_text" autocorrect="off" autocapitalize="none" />
150 </td>
151 </tr>
152 <tr>
153 <td>
154 <input type="checkbox" id="exportdir_checkbox" onclick="qBittorrent.Preferences.updateExportDirEnabled();" />
155 <label for="exportdir_checkbox">QBT_TR(Copy .torrent files to:)QBT_TR[CONTEXT=OptionsDialog]</label>
156 </td>
157 <td>
158 <input type="text" id="exportdir_text" autocorrect="off" autocapitalize="none" />
159 </td>
160 </tr>
161 <tr>
162 <td>
163 <input type="checkbox" id="exportdirfin_checkbox" onclick="qBittorrent.Preferences.updateExportDirFinEnabled();" />
164 <label for="exportdirfin_checkbox">QBT_TR(Copy .torrent files for finished downloads to:)QBT_TR[CONTEXT=OptionsDialog]</label>
165 </td>
166 <td>
167 <input type="text" id="exportdirfin_text" autocorrect="off" autocapitalize="none" />
168 </td>
169 </tr>
170 </table>
171 </fieldset>
173 <fieldset class="settings">
174 <legend>QBT_TR(Automatically add torrents from:)QBT_TR[CONTEXT=OptionsDialog]</legend>
175 <table id="watched_folders_tab" style="border: 1px solid black;">
176 <thead>
177 <tr>
178 <th>QBT_TR(Monitored Folder)QBT_TR[CONTEXT=ScanFoldersModel]</th>
179 <th>QBT_TR(Override Save Location)QBT_TR[CONTEXT=ScanFoldersModel]</th>
180 </tr>
181 </thead>
182 <tbody></tbody>
183 </table>
184 </fieldset>
186 <fieldset class="settings">
187 <legend>
188 <input type="checkbox" id="excludedFileNamesCheckbox" onclick="qBittorrent.Preferences.updateExcludedFileNamesEnabled();" />
189 <label for="excludedFileNamesCheckbox">QBT_TR(Excluded file names)QBT_TR[CONTEXT=OptionsDialog]</label>
190 </legend>
191 <textarea id="excludedFileNamesTextarea" rows="6" cols="70"></textarea>
192 </fieldset>
194 <fieldset class="settings">
195 <legend>
196 <input type="checkbox" id="mail_notification_checkbox" onclick="qBittorrent.Preferences.updateMailNotification();" />
197 <label for="mail_notification_checkbox">QBT_TR(Email notification upon download completion)QBT_TR[CONTEXT=OptionsDialog]</label>
198 </legend>
199 <table>
200 <tr>
201 <td>
202 <label for="src_email_txt">QBT_TR(From:)QBT_TR[CONTEXT=OptionsDialog]</label>
203 </td>
204 <td>
205 <input type="text" id="src_email_txt" />
206 </td>
207 </tr>
208 <tr>
209 <td>
210 <label for="dest_email_txt">QBT_TR(To:)QBT_TR[CONTEXT=OptionsDialog]</label>
211 </td>
212 <td>
213 <input type="text" id="dest_email_txt" />
214 </td>
215 </tr>
216 <tr>
217 <td>
218 <label for="smtp_server_txt">QBT_TR(SMTP server:)QBT_TR[CONTEXT=OptionsDialog]</label>
219 </td>
220 <td>
221 <input type="text" id="smtp_server_txt" />
222 </td>
223 </tr>
224 </table>
225 <div class="formRow">
226 <input type="checkbox" id="mail_ssl_checkbox" /><label for="mail_ssl_checkbox">QBT_TR(This server requires a secure connection (SSL))QBT_TR[CONTEXT=OptionsDialog]</label>
227 </div>
228 <fieldset class="settings">
229 <legend>
230 <input type="checkbox" id="mail_auth_checkbox" onclick="qBittorrent.Preferences.updateMailAuthSettings();" />
231 <label for="mail_auth_checkbox">QBT_TR(Authentication)QBT_TR[CONTEXT=OptionsDialog]</label>
232 </legend>
233 <table>
234 <tr>
235 <td>
236 <label for="mail_username_text">QBT_TR(Username:)QBT_TR[CONTEXT=OptionsDialog]</label>
237 </td>
238 <td>
239 <input type="text" id="mail_username_text" />
240 </td>
241 </tr>
242 <tr>
243 <td>
244 <label for="mail_password_text">QBT_TR(Password:)QBT_TR[CONTEXT=OptionsDialog]</label>
245 </td>
246 <td>
247 <input type="password" id="mail_password_text" />
248 </td>
249 </tr>
250 </table>
251 </fieldset>
252 </fieldset>
254 <fieldset class="settings">
255 <legend>
256 QBT_TR(Run external program)QBT_TR[CONTEXT=OptionsDialog]
257 </legend>
258 <div class="formRow">
259 <input type="checkbox" id="autorunOnTorrentAddedCheckbox" onclick="qBittorrent.Preferences.updateAutoRunOnTorrentAdded();" />
260 <label for="autorunOnTorrentAddedCheckbox">QBT_TR(Run external program on torrent added)QBT_TR[CONTEXT=OptionsDialog]</label>
261 <input type="text" id="autorunOnTorrentAddedProgram" style="width: 400px;" />
262 </div>
263 <div class="formRow">
264 <input type="checkbox" id="autorun_checkbox" onclick="qBittorrent.Preferences.updateAutoRun();" />
265 <label for="autorun_checkbox">QBT_TR(Run external program on torrent finished)QBT_TR[CONTEXT=OptionsDialog]</label>
266 <input type="text" id="autorunProg_txt" style="width: 400px;" />
267 </div>
268 <div style="font-style: italic;">QBT_TR(Supported parameters (case sensitive):)QBT_TR[CONTEXT=OptionsDialog]
269 <ul>
270 <li>QBT_TR(%N: Torrent name)QBT_TR[CONTEXT=OptionsDialog]</li>
271 <li>QBT_TR(%L: Category)QBT_TR[CONTEXT=OptionsDialog]</li>
272 <li>QBT_TR(%G: Tags (separated by comma))QBT_TR[CONTEXT=OptionsDialog]</li>
273 <li>QBT_TR(%F: Content path (same as root path for multifile torrent))QBT_TR[CONTEXT=OptionsDialog]</li>
274 <li>QBT_TR(%R: Root path (first torrent subdirectory path))QBT_TR[CONTEXT=OptionsDialog]</li>
275 <li>QBT_TR(%D: Save path)QBT_TR[CONTEXT=OptionsDialog]</li>
276 <li>QBT_TR(%C: Number of files)QBT_TR[CONTEXT=OptionsDialog]</li>
277 <li>QBT_TR(%Z: Torrent size (bytes))QBT_TR[CONTEXT=OptionsDialog]</li>
278 <li>QBT_TR(%T: Current tracker)QBT_TR[CONTEXT=OptionsDialog]</li>
279 <li>QBT_TR(%I: Info hash v1)QBT_TR[CONTEXT=OptionsDialog]</li>
280 <li>QBT_TR(%J: Info hash v2)QBT_TR[CONTEXT=OptionsDialog]</li>
281 <li>QBT_TR(%K: Torrent ID)QBT_TR[CONTEXT=OptionsDialog]</li>
282 </ul>
283 QBT_TR(Tip: Encapsulate parameter with quotation marks to avoid text being cut off at whitespace (e.g., "%N"))QBT_TR[CONTEXT=OptionsDialog]
284 </div>
285 </fieldset>
286 </div>
288 <div id="ConnectionTab" class="PrefTab invisible">
289 <div class="formRow">
290 <label>QBT_TR(Peer connection protocol:)QBT_TR[CONTEXT=OptionsDialog]</label>
291 <select id="enable_protocol_combobox">
292 <option value="0" selected>QBT_TR(TCP and μTP)QBT_TR[CONTEXT=OptionsDialog]</option>
293 <option value="1">TCP</option>
294 <option value="2">μTP</option>
295 </select>
296 </div>
297 <fieldset class="settings">
298 <legend>QBT_TR(Listening Port)QBT_TR[CONTEXT=OptionsDialog]</legend>
299 <div class="formRow">
300 <label for="port_value">QBT_TR(Port used for incoming connections:)QBT_TR[CONTEXT=OptionsDialog]</label>
301 <input type="text" id="port_value" style="width: 4em;" title="QBT_TR(Set to 0 to let your system pick an unused port)QBT_TR[CONTEXT=OptionsDialog]" />
302 <button style="margin-left: 1em;" onclick="qBittorrent.Preferences.generateRandomPort();">QBT_TR(Random)QBT_TR[CONTEXT=OptionsDialog]</button>
303 </div>
304 <div class="formRow">
305 <input type="checkbox" id="upnp_checkbox" />
306 <label for="upnp_checkbox">QBT_TR(Use UPnP / NAT-PMP port forwarding from my router)QBT_TR[CONTEXT=OptionsDialog]</label>
307 </div>
308 </fieldset>
310 <fieldset class="settings">
311 <legend>QBT_TR(Connections Limits)QBT_TR[CONTEXT=OptionsDialog]</legend>
312 <table>
313 <tr>
314 <td>
315 <input type="checkbox" id="max_connec_checkbox" onclick="qBittorrent.Preferences.updateMaxConnecEnabled();" />
316 <label for="max_connec_checkbox">QBT_TR(Global maximum number of connections:)QBT_TR[CONTEXT=OptionsDialog]</label>
317 </td>
318 <td><input type="text" id="max_connec_value" style="width: 4em;" /></td>
319 </tr>
320 <tr>
321 <td>
322 <input type="checkbox" id="max_connec_per_torrent_checkbox" onclick="qBittorrent.Preferences.updateMaxConnecPerTorrentEnabled();" />
323 <label for="max_connec_per_torrent_checkbox">QBT_TR(Maximum number of connections per torrent:)QBT_TR[CONTEXT=OptionsDialog]</label>
324 </td>
325 <td><input type="text" id="max_connec_per_torrent_value" style="width: 4em;" /></td>
326 </tr>
327 <tr>
328 <td>
329 <input type="checkbox" id="max_uploads_checkbox" onclick="qBittorrent.Preferences.updateMaxUploadsEnabled();" />
330 <label for="max_uploads_checkbox">QBT_TR(Global maximum number of upload slots:)QBT_TR[CONTEXT=OptionsDialog]</label>
331 </td>
332 <td><input type="text" id="max_uploads_value" style="width: 4em;" /></td>
333 </tr>
334 <tr>
335 <td>
336 <input type="checkbox" id="max_uploads_per_torrent_checkbox" onclick="qBittorrent.Preferences.updateMaxUploadsPerTorrentEnabled();" />
337 <label for="max_uploads_per_torrent_checkbox">QBT_TR(Maximum number of upload slots per torrent:)QBT_TR[CONTEXT=OptionsDialog]</label>
338 </td>
339 <td><input type="text" id="max_uploads_per_torrent_value" style="width: 4em;" /></td>
340 </tr>
341 </table>
342 </fieldset>
344 <fieldset class="settings">
345 <legend>QBT_TR(Proxy Server)QBT_TR[CONTEXT=OptionsDialog]</legend>
346 <table>
347 <tr>
348 <td>
349 <label for="peer_proxy_type_select">QBT_TR(Type:)QBT_TR[CONTEXT=OptionsDialog]</label>
350 </td>
351 <td>
352 <select id="peer_proxy_type_select" onchange="qBittorrent.Preferences.updatePeerProxySettings();">
353 <option value="SOCKS4">QBT_TR(SOCKS4)QBT_TR[CONTEXT=OptionsDialog]</option>
354 <option value="SOCKS5">QBT_TR(SOCKS5)QBT_TR[CONTEXT=OptionsDialog]</option>
355 <option value="HTTP">QBT_TR(HTTP)QBT_TR[CONTEXT=OptionsDialog]</option>
356 </select>
357 </td>
358 <td>
359 <label for="peer_proxy_host_text">QBT_TR(Host:)QBT_TR[CONTEXT=OptionsDialog]</label>
360 </td>
361 <td>
362 <input type="text" id="peer_proxy_host_text" />
363 </td>
364 <td>
365 <label for="peer_proxy_port_value">QBT_TR(Port:)QBT_TR[CONTEXT=OptionsDialog]</label>
366 </td>
367 <td>
368 <input type="text" id="peer_proxy_port_value" style="width: 4em;" />
369 </td>
370 </tr>
371 </table>
373 <fieldset class="settings">
374 <legend>
375 <input type="checkbox" id="peer_proxy_auth_checkbox" onclick="qBittorrent.Preferences.updatePeerProxyAuthSettings();" />
376 <label for="peer_proxy_auth_checkbox">QBT_TR(Authentication)QBT_TR[CONTEXT=OptionsDialog]</label>
377 </legend>
378 <table>
379 <tr>
380 <td>
381 <label for="peer_proxy_username_text">QBT_TR(Username:)QBT_TR[CONTEXT=OptionsDialog]</label>
382 </td>
383 <td>
384 <input type="text" id="peer_proxy_username_text" />
385 </td>
386 </tr>
387 <tr>
388 <td>
389 <label for="peer_proxy_password_text">QBT_TR(Password:)QBT_TR[CONTEXT=OptionsDialog]</label>
390 </td>
391 <td>
392 <input type="password" id="peer_proxy_password_text" />
393 </td>
394 </tr>
395 </table>
396 <div class="formRow">
397 <span>QBT_TR(Info: The password is saved unencrypted)QBT_TR[CONTEXT=OptionsDialog]</span>
398 </div>
399 </fieldset>
401 <fieldset class="settings">
402 <legend>
403 <input type="checkbox" id="proxy_bittorrent_checkbox" onclick="qBittorrent.Preferences.updatePeerProxySettings();" />
404 <label for="proxy_bittorrent_checkbox">QBT_TR(Use proxy for BitTorrent purposes)QBT_TR[CONTEXT=OptionsDialog]</label>
405 </legend>
406 <div class="formRow">
407 <input type="checkbox" id="use_peer_proxy_checkbox" />
408 <label for="use_peer_proxy_checkbox">QBT_TR(Use proxy for peer connections)QBT_TR[CONTEXT=OptionsDialog]</label>
409 </div>
410 <div class="formRow">
411 <input type="checkbox" id="proxyHostnameLookupCheckbox" title="QBT_TR(If checked, hostname lookups are done via the proxy.)QBT_TR[CONTEXT=OptionsDialog]" />
412 <label for="proxyHostnameLookupCheckbox">QBT_TR(Use proxy for hostname lookup)QBT_TR[CONTEXT=OptionsDialog]</label>
413 </div>
414 </fieldset>
415 <div class="formRow">
416 <input type="checkbox" id="proxy_rss_checkbox" />
417 <label for="proxy_rss_checkbox">QBT_TR(Use proxy for RSS purposes)QBT_TR[CONTEXT=OptionsDialog]</label>
418 </div>
419 <div class="formRow">
420 <input type="checkbox" id="proxy_misc_checkbox" />
421 <label for="proxy_misc_checkbox">QBT_TR(Use proxy for general purposes)QBT_TR[CONTEXT=OptionsDialog]</label>
422 </div>
423 </fieldset>
425 <fieldset class="settings">
426 <legend>
427 <label>QBT_TR(IP Filtering)QBT_TR[CONTEXT=OptionsDialog]</label>
428 </legend>
429 <div class="formRow">
430 <input type="checkbox" id="ipfilter_text_checkbox" onclick="qBittorrent.Preferences.updateFilterSettings();" />
431 <label for="ipfilter_text_checkbox">QBT_TR(Filter path (.dat, .p2p, .p2b):)QBT_TR[CONTEXT=OptionsDialog]</label>
432 <input type="text" id="ipfilter_text" />
433 </div>
434 <div class="formRow">
435 <input type="checkbox" id="ipfilter_trackers_checkbox" />
436 <label for="ipfilter_trackers_checkbox">QBT_TR(Apply to trackers)QBT_TR[CONTEXT=OptionsDialog]</label>
437 </div>
438 <div class="formRow">
439 <fieldset class="settings">
440 <legend>QBT_TR(Manually banned IP addresses...)QBT_TR[CONTEXT=OptionsDialog]</legend>
441 <textarea id="banned_IPs_textarea" rows="5" cols="70"></textarea>
442 </fieldset>
443 </div>
444 </fieldset>
445 </div>
447 <div id="SpeedTab" class="PrefTab invisible">
448 <fieldset class="settings">
449 <legend>QBT_TR(Global Rate Limits)QBT_TR[CONTEXT=OptionsDialog]</legend>
450 <table>
451 <tr>
452 <td rowspan="2">
453 <img src="images/slow_off.svg" style="height: 1.5em;" alt="QBT_TR(Alternative speed limits)QBT_TR[CONTEXT=MainWindow]">
454 </td>
455 <td><label for="up_limit_value">QBT_TR(Upload:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
456 <td><input type="number" id="up_limit_value" style="width: 4em;" min="0" />&nbsp;&nbsp;QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog]</td>
457 </tr>
458 <tr>
459 <td><label for="dl_limit_value">QBT_TR(Download:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
460 <td><input type="number" id="dl_limit_value" style="width: 4em;" min="0" />&nbsp;&nbsp;QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog]</td>
461 </tr>
462 </table>
463 <i>QBT_TR(0 means unlimited)QBT_TR[CONTEXT=OptionsDialog]</i>
464 </fieldset>
466 <fieldset class="settings">
467 <legend>QBT_TR(Alternative Rate Limits)QBT_TR[CONTEXT=OptionsDialog]</legend>
468 <table>
469 <tr>
470 <td rowspan="2">
471 <img src="images/slow.svg" style="height: 1.5em;" alt="QBT_TR(Alternative speed limits)QBT_TR[CONTEXT=MainWindow]">
472 </td>
473 <td><label for="alt_up_limit_value">QBT_TR(Upload:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
474 <td><input type="number" id="alt_up_limit_value" style="width: 4em;" min="0" />&nbsp;&nbsp;QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog]</td>
475 </tr>
476 <tr>
477 <td><label for="alt_dl_limit_value">QBT_TR(Download:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
478 <td><input type="number" id="alt_dl_limit_value" style="width: 4em;" min="0" />&nbsp;&nbsp;QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog]</td>
479 </tr>
480 </table>
481 <i>QBT_TR(0 means unlimited)QBT_TR[CONTEXT=OptionsDialog]</i>
483 <fieldset class="settings">
484 <legend>
485 <input type="checkbox" id="limitSchedulingCheckbox" onclick="qBittorrent.Preferences.updateSchedulingEnabled();" />
486 <label for="limitSchedulingCheckbox">QBT_TR(Schedule the use of alternative rate limits)QBT_TR[CONTEXT=OptionsDialog]</label>
487 </legend>
488 <div class="formRow">
489 QBT_TR(From:)QBT_TR[CONTEXT=OptionsDialog]
490 <input type="text" id="schedule_from_hour" style="width: 1.5em;" />:<input type="text" id="schedule_from_min" style="width: 1.5em;" />
491 QBT_TR(To:)QBT_TR[CONTEXT=OptionsDialog]
492 <input type="text" id="schedule_to_hour" style="width: 1.5em;" />:<input type="text" id="schedule_to_min" style="width: 1.5em;" />
493 </div>
494 <div class="formRow">
495 QBT_TR(When:)QBT_TR[CONTEXT=OptionsDialog]
496 <select id="schedule_freq_select">
497 <option value="0">QBT_TR(Every day)QBT_TR[CONTEXT=OptionsDialog]</option>
498 <option value="1">QBT_TR(Weekdays)QBT_TR[CONTEXT=OptionsDialog]</option>
499 <option value="2">QBT_TR(Weekends)QBT_TR[CONTEXT=OptionsDialog]</option>
500 <option value="3">QBT_TR(Monday)QBT_TR[CONTEXT=HttpServer]</option>
501 <option value="4">QBT_TR(Tuesday)QBT_TR[CONTEXT=HttpServer]</option>
502 <option value="5">QBT_TR(Wednesday)QBT_TR[CONTEXT=HttpServer]</option>
503 <option value="6">QBT_TR(Thursday)QBT_TR[CONTEXT=HttpServer]</option>
504 <option value="7">QBT_TR(Friday)QBT_TR[CONTEXT=HttpServer]</option>
505 <option value="8">QBT_TR(Saturday)QBT_TR[CONTEXT=HttpServer]</option>
506 <option value="9">QBT_TR(Sunday)QBT_TR[CONTEXT=HttpServer]</option>
507 </select>
508 </div>
509 </fieldset>
510 </fieldset>
512 <fieldset class="settings">
513 <legend>QBT_TR(Rate Limits Settings)QBT_TR[CONTEXT=OptionsDialog]</legend>
514 <div class="formRow">
515 <input type="checkbox" id="limit_utp_rate_checkbox" />
516 <label for="limit_utp_rate_checkbox">QBT_TR(Apply rate limit to µTP protocol)QBT_TR[CONTEXT=OptionsDialog]</label>
517 </div>
518 <div class="formRow">
519 <input type="checkbox" id="limit_tcp_overhead_checkbox" />
520 <label for="limit_tcp_overhead_checkbox">QBT_TR(Apply rate limit to transport overhead)QBT_TR[CONTEXT=OptionsDialog]</label>
521 </div>
522 <div class="formRow">
523 <input type="checkbox" id="limit_lan_peers_checkbox" />
524 <label for="limit_lan_peers_checkbox">QBT_TR(Apply rate limit to peers on LAN)QBT_TR[CONTEXT=OptionsDialog]</label>
525 </div>
526 </fieldset>
527 </div>
529 <div id="BittorrentTab" class="PrefTab invisible">
530 <fieldset class="settings">
531 <legend>QBT_TR(Privacy)QBT_TR[CONTEXT=OptionsDialog]</legend>
532 <div class="formRow">
533 <input type="checkbox" id="dht_checkbox" />
534 <label for="dht_checkbox">QBT_TR(Enable DHT (decentralized network) to find more peers)QBT_TR[CONTEXT=OptionsDialog]</label>
535 </div>
536 <div class="formRow">
537 <input type="checkbox" id="pex_checkbox" />
538 <label for="pex_checkbox">QBT_TR(Enable Peer Exchange (PeX) to find more peers)QBT_TR[CONTEXT=OptionsDialog]</label>
539 </div>
540 <div class="formRow">
541 <input type="checkbox" id="lsd_checkbox" />
542 <label for="lsd_checkbox">QBT_TR(Enable Local Peer Discovery to find more peers)QBT_TR[CONTEXT=OptionsDialog]</label>
543 </div>
544 <div class="formRow">
545 <label for="encryption_select">QBT_TR(Encryption mode:)QBT_TR[CONTEXT=OptionsDialog]</label>
546 <select id="encryption_select">
547 <option value="0">QBT_TR(Allow encryption)QBT_TR[CONTEXT=OptionsDialog]</option>
548 <option value="1">QBT_TR(Require encryption)QBT_TR[CONTEXT=OptionsDialog]</option>
549 <option value="2">QBT_TR(Disable encryption)QBT_TR[CONTEXT=OptionsDialog]</option>
550 </select>
551 </div>
552 <div class="formRow">
553 <input type="checkbox" id="anonymous_mode_checkbox" />
554 <label for="anonymous_mode_checkbox">QBT_TR(Enable anonymous mode)QBT_TR[CONTEXT=OptionsDialog] (<a target="_blank" href="https://github.com/qbittorrent/qBittorrent/wiki/Anonymous-Mode">QBT_TR(More information)QBT_TR[CONTEXT=HttpServer]</a>)</label>
555 </div>
556 </fieldset>
558 <div class="formRow">
559 <label for="maxActiveCheckingTorrents">QBT_TR(Max active checking torrents:)QBT_TR[CONTEXT=OptionsDialog]</label>
560 <input type="number" id="maxActiveCheckingTorrents" style="width: 4em;" min="-1" />
561 </div>
563 <fieldset class="settings">
564 <legend>
565 <input type="checkbox" id="queueing_checkbox" onclick="qBittorrent.Preferences.updateQueueingSystem();" />
566 <label for="queueing_checkbox">QBT_TR(Torrent Queueing)QBT_TR[CONTEXT=OptionsDialog]</label>
567 </legend>
568 <table>
569 <tr>
570 <td>
571 <label for="max_active_dl_value">QBT_TR(Maximum active downloads:)QBT_TR[CONTEXT=OptionsDialog]</label>
572 </td>
573 <td>
574 <input type="text" id="max_active_dl_value" style="width: 4em;" />
575 </td>
576 </tr>
577 <tr>
578 <td>
579 <label for="max_active_up_value">QBT_TR(Maximum active uploads:)QBT_TR[CONTEXT=OptionsDialog]</label>
580 </td>
581 <td>
582 <input type="text" id="max_active_up_value" style="width: 4em;" />
583 </td>
584 </tr>
585 <tr>
586 <td>
587 <label for="max_active_to_value">QBT_TR(Maximum active torrents:)QBT_TR[CONTEXT=OptionsDialog]</label>
588 </td>
589 <td>
590 <input type="text" id="max_active_to_value" style="width: 4em;" />
591 </td>
592 </tr>
593 </table>
594 <fieldset class="settings">
595 <legend>
596 <input type="checkbox" id="dont_count_slow_torrents_checkbox" onclick="qBittorrent.Preferences.updateSlowTorrentsSettings();" />
597 <label for="dont_count_slow_torrents_checkbox">QBT_TR(Do not count slow torrents in these limits)QBT_TR[CONTEXT=OptionsDialog]</label>
598 </legend>
599 <table>
600 <tr>
601 <td>
602 <label for="dl_rate_threshold">QBT_TR(Download rate threshold:)QBT_TR[CONTEXT=OptionsDialog]</label>
603 </td>
604 <td>
605 <input type="text" id="dl_rate_threshold" style="width: 4em;" />&nbsp;&nbsp;QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog]
606 </td>
607 </tr>
608 <tr>
609 <td>
610 <label for="ul_rate_threshold">QBT_TR(Upload rate threshold:)QBT_TR[CONTEXT=OptionsDialog]</label>
611 </td>
612 <td>
613 <input type="text" id="ul_rate_threshold" style="width: 4em;" />&nbsp;&nbsp;QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog]
614 </td>
615 </tr>
616 <tr>
617 <td>
618 <label for="torrent_inactive_timer">QBT_TR(Torrent inactivity timer:)QBT_TR[CONTEXT=OptionsDialog]</label>
619 </td>
620 <td>
621 <input type="text" id="torrent_inactive_timer" style="width: 4em;" />&nbsp;&nbsp;QBT_TR(seconds)QBT_TR[CONTEXT=OptionsDialog]
622 </td>
623 </tr>
624 </table>
625 </fieldset>
626 </fieldset>
628 <fieldset class="settings">
629 <legend>QBT_TR(Seeding Limits)QBT_TR[CONTEXT=OptionsDialog]</legend>
630 <table>
631 <tr>
632 <td>
633 <input type="checkbox" id="max_ratio_checkbox" onclick="qBittorrent.Preferences.updateMaxRatioTimeEnabled();" />
634 <label for="max_ratio_checkbox">QBT_TR(When ratio reaches)QBT_TR[CONTEXT=OptionsDialog]</label>
635 </td>
636 <td>
637 <input type="text" id="max_ratio_value" style="width: 4em;" />
638 </td>
639 </tr>
640 <tr>
641 <td>
642 <input type="checkbox" id="max_seeding_time_checkbox" onclick="qBittorrent.Preferences.updateMaxRatioTimeEnabled();" />
643 <label for="max_seeding_time_checkbox">QBT_TR(When seeding time reaches)QBT_TR[CONTEXT=OptionsDialog]</label>
644 </td>
645 <td>
646 <input type="text" id="max_seeding_time_value" style="width: 4em;" />QBT_TR(minutes)QBT_TR[CONTEXT=OptionsDialog]
647 </td>
648 </tr>
649 <tr>
650 <td style="text-align: right;"><label for="max_ratio_act">QBT_TR(then)QBT_TR[CONTEXT=OptionsDialog]</label></td>
651 <td>
652 <select id="max_ratio_act">
653 <option value="0">QBT_TR(Pause torrent)QBT_TR[CONTEXT=OptionsDialog]</option>
654 <option value="1">QBT_TR(Remove torrent)QBT_TR[CONTEXT=OptionsDialog]</option>
655 <option value="3">QBT_TR(Remove torrent and its files)QBT_TR[CONTEXT=OptionsDialog]</option>
656 <option value="2">QBT_TR(Enable super seeding for torrent)QBT_TR[CONTEXT=OptionsDialog]</option>
657 </select>
658 </td>
659 </tr>
660 </table>
661 </fieldset>
663 <fieldset class="settings">
664 <legend>
665 <input type="checkbox" id="add_trackers_checkbox" onclick="qBittorrent.Preferences.updateAddTrackersEnabled();" />
666 <label for="add_trackers_checkbox">QBT_TR(Automatically add these trackers to new downloads:)QBT_TR[CONTEXT=OptionsDialog]</label>
667 </legend>
668 <textarea id="add_trackers_textarea" rows="5" cols="70"></textarea>
669 </fieldset>
670 </div>
672 <div id="RSSTab" class="PrefTab invisible">
673 <fieldset class="settings">
674 <legend>QBT_TR(RSS Reader)QBT_TR[CONTEXT=OptionsDialog]</legend>
675 <div class="formRow">
676 <input type="checkbox" id="enable_fetching_rss_feeds_checkbox" />
677 <label for="enable_fetching_rss_feeds_checkbox">QBT_TR(Enable fetching RSS feeds)QBT_TR[CONTEXT=OptionsDialog]</label>
678 </div>
679 <table>
680 <tr>
681 <td>
682 <label for="feed_refresh_interval">QBT_TR(Feeds refresh interval:)QBT_TR[CONTEXT=OptionsDialog]</label>
683 </td>
684 <td>
685 <input type="text" id="feed_refresh_interval" style="width: 4em;" />&nbsp;&nbsp;QBT_TR( min)QBT_TR[CONTEXT=OptionsDialog]
686 </td>
687 </tr>
688 <tr>
689 <td>
690 <label for="maximum_article_number">QBT_TR(Maximum number of articles per feed:)QBT_TR[CONTEXT=OptionsDialog]</label>
691 </td>
692 <td>
693 <input type="text" id="maximum_article_number" style="width: 4em;" />
694 </td>
695 </tr>
696 </table>
697 </fieldset>
699 <fieldset class="settings">
700 <legend>QBT_TR(RSS Torrent Auto Downloader)QBT_TR[CONTEXT=OptionsDialog]</legend>
701 <div class="formRow">
702 <input type="checkbox" id="enable_auto_downloading_rss_torrents_checkbox" />
703 <label for="enable_auto_downloading_rss_torrents_checkbox">QBT_TR(Enable auto downloading of RSS torrents)QBT_TR[CONTEXT=OptionsDialog]</label>
704 </div>
705 <button style="margin: 0 1em; width: calc(100% - 2.2em)" onclick="window.qBittorrent.Rss.openRssDownloader();">QBT_TR(Edit auto downloading rules...)QBT_TR[CONTEXT=OptionsDialog]</button>
706 </fieldset>
708 <fieldset class="settings">
709 <legend>QBT_TR(RSS Smart Episode Filter)QBT_TR[CONTEXT=OptionsDialog]</legend>
710 <div class="formRow">
711 <input type="checkbox" id="downlock_repack_proper_episodes" />
713 <label for="downlock_repack_proper_episodes">QBT_TR(Download REPACK/PROPER episodes)QBT_TR[CONTEXT=OptionsDialog]</label>
714 </div>
715 <label for="rss_filter_textarea">QBT_TR(Filters:)QBT_TR[CONTEXT=OptionsDialog]</label><br>
716 <textarea id="rss_filter_textarea" rows="6" cols="70"></textarea>
717 </fieldset>
718 </div>
720 <div id="WebUITab" class="PrefTab invisible">
721 <fieldset class="settings">
722 <legend>QBT_TR(Web User Interface (Remote control))QBT_TR[CONTEXT=OptionsDialog]</legend>
723 <table>
724 <tr>
725 <td>
726 <label for="webui_address_value">QBT_TR(IP address:)QBT_TR[CONTEXT=OptionsDialog]</label>
727 </td>
728 <td>
729 <input type="text" id="webui_address_value" />
730 <label for="webui_port_value" style="margin-left: 10px;">QBT_TR(Port:)QBT_TR[CONTEXT=OptionsDialog]</label>
731 <input type="text" id="webui_port_value" style="width: 4em;" />
732 </td>
733 </tr>
734 </table>
735 <div class="formRow">
736 <input type="checkbox" id="webui_upnp_checkbox" />
737 <label for="webui_upnp_checkbox">QBT_TR(Use UPnP / NAT-PMP to forward the port from my router)QBT_TR[CONTEXT=OptionsDialog]</label>
738 </div>
739 <fieldset class="settings">
740 <legend>
741 <input type="checkbox" id="use_https_checkbox" onclick="qBittorrent.Preferences.updateHttpsSettings();" />
742 <label for="use_https_checkbox">QBT_TR(Use HTTPS instead of HTTP)QBT_TR[CONTEXT=OptionsDialog]</label>
743 </legend>
744 <table>
745 <tr>
746 <td>
747 <label for="ssl_cert_text">QBT_TR(Certificate:)QBT_TR[CONTEXT=OptionsDialog]</label>
748 </td>
749 <td>
750 <input type="text" id="ssl_cert_text" style="width: 30em;" />
751 </td>
752 </tr>
753 <tr>
754 <td>
755 <label for="ssl_key_text">QBT_TR(Key:)QBT_TR[CONTEXT=OptionsDialog]</label>
756 </td>
757 <td>
758 <input type="text" id="ssl_key_text" style="width: 30em;" />
759 </td>
760 </tr>
761 </table>
762 <div style="padding-left: 10px;"><a target="_blank" href="https://httpd.apache.org/docs/current/ssl/ssl_faq.html#aboutcerts">QBT_TR(Information about certificates)QBT_TR[CONTEXT=HttpServer]</a></div>
763 </fieldset>
765 <fieldset class="settings">
766 <legend>QBT_TR(Authentication)QBT_TR[CONTEXT=OptionsDialog]</legend>
767 <table>
768 <tr>
769 <td>
770 <label for="webui_username_text">QBT_TR(Username:)QBT_TR[CONTEXT=OptionsDialog]</label>
771 </td>
772 <td>
773 <input type="text" id="webui_username_text" />
774 </td>
775 </tr>
776 <tr>
777 <td>
778 <label for="webui_password_text">QBT_TR(Password:)QBT_TR[CONTEXT=OptionsDialog]</label>
779 </td>
780 <td>
781 <input type="password" id="webui_password_text" placeholder="QBT_TR(Change current password)QBT_TR[CONTEXT=OptionsDialog]" autocomplete="new-password" />
782 </td>
783 </tr>
784 </table>
785 <div class="formRow">
786 <input type="checkbox" id="bypass_local_auth_checkbox" />
787 <label for="bypass_local_auth_checkbox">QBT_TR(Bypass authentication for clients on localhost)QBT_TR[CONTEXT=OptionsDialog]</label>
788 </div>
789 <div class="formRow">
790 <input type="checkbox" id="bypass_auth_subnet_whitelist_checkbox" onclick="qBittorrent.Preferences.updateBypasssAuthSettings();" />
791 <label for="bypass_auth_subnet_whitelist_checkbox">QBT_TR(Bypass authentication for clients in whitelisted IP subnets)QBT_TR[CONTEXT=OptionsDialog]</label>
792 </div>
793 <div class="formRow" style="padding-left: 30px; padding-top: 5px;">
794 <textarea id="bypass_auth_subnet_whitelist_textarea" rows="5" cols="48" placeholder="QBT_TR(Example: 172.17.32.0/24, fdff:ffff:c8::/40)QBT_TR[CONTEXT=OptionsDialog]"></textarea>
795 </div>
796 <table>
797 <tr>
798 <td><label for="webUIMaxAuthFailCountInput">QBT_TR(Ban client after consecutive failures:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
799 <td><input type="number" id="webUIMaxAuthFailCountInput" style="width: 4em;" min="0" /></td>
800 </tr>
801 <tr>
802 <td style="text-align: right;"><label for="webUIBanDurationInput">QBT_TR(ban for:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
803 <td><input type="number" id="webUIBanDurationInput" style="width: 4em;" min="1" />QBT_TR(seconds)QBT_TR[CONTEXT=OptionsDialog]</td>
804 </tr>
805 </table>
806 <table>
807 <tr>
808 <td><label for="webUISessionTimeoutInput">QBT_TR(Session timeout:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
809 <td><input type="number" id="webUISessionTimeoutInput" style="width: 4em;" min="0" />&nbsp;&nbsp;QBT_TR(seconds)QBT_TR[CONTEXT=OptionsDialog]</td>
810 </tr>
811 </table>
812 </fieldset>
814 <fieldset class="settings">
815 <legend><input type="checkbox" id="use_alt_webui_checkbox" onclick="qBittorrent.Preferences.updateAlternativeWebUISettings();" />
816 <label for="use_alt_webui_checkbox">QBT_TR(Use alternative Web UI)QBT_TR[CONTEXT=OptionsDialog]</label>
817 </legend>
818 <div class="formRow">
819 <label for="webui_files_location_textarea">QBT_TR(Files location:)QBT_TR[CONTEXT=OptionsDialog]</label>
820 <input type="text" id="webui_files_location_textarea" />
821 </div>
822 </fieldset>
824 <fieldset class="settings">
825 <legend>QBT_TR(Security)QBT_TR[CONTEXT=OptionsDialog]</legend>
826 <div class="formRow">
827 <input type="checkbox" id="clickjacking_protection_checkbox" />
828 <label for="clickjacking_protection_checkbox">QBT_TR(Enable clickjacking protection)QBT_TR[CONTEXT=OptionsDialog]</label>
829 </div>
830 <div class="formRow">
831 <input type="checkbox" id="csrf_protection_checkbox" />
832 <label for="csrf_protection_checkbox">QBT_TR(Enable Cross-Site Request Forgery (CSRF) protection)QBT_TR[CONTEXT=OptionsDialog]</label>
833 </div>
834 <div class="formRow">
835 <input type="checkbox" id="secureCookieCheckbox" />
836 <label for="secureCookieCheckbox">QBT_TR(Enable cookie Secure flag (requires HTTPS))QBT_TR[CONTEXT=OptionsDialog]</label>
837 </div>
839 <fieldset class="settings">
840 <legend>
841 <input type="checkbox" id="host_header_validation_checkbox" onclick="qBittorrent.Preferences.updateHostHeaderValidationSettings();" />
842 <label for="host_header_validation_checkbox">QBT_TR(Enable Host header validation)QBT_TR[CONTEXT=OptionsDialog]</label>
843 </legend>
844 <table>
845 <tr>
846 <td>
847 <label for="webui_domain_textarea">QBT_TR(Server domains:)QBT_TR[CONTEXT=OptionsDialog]</label>
848 </td>
849 <td>
850 <textarea id="webui_domain_textarea" rows="1" cols="60" title="QBT_TR(Whitelist for filtering HTTP Host header values.
851 In order to defend against DNS rebinding attack,
852 you should put in domain names used by WebUI server.
854 Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsDialog]"></textarea>
855 </td>
856 </tr>
857 </table>
858 </fieldset>
859 </fieldset>
861 <fieldset class="settings">
862 <legend>
863 <input type="checkbox" id="webUIUseCustomHTTPHeadersCheckbox" onclick="qBittorrent.Preferences.updateWebUICustomHTTPHeadersSettings();" />
864 <label for="webUIUseCustomHTTPHeadersCheckbox">QBT_TR(Add custom HTTP headers)QBT_TR[CONTEXT=OptionsDialog]</label>
865 </legend>
866 <textarea id="webUICustomHTTPHeadersTextarea" placeholder="QBT_TR(Header: value pairs, one per line)QBT_TR[CONTEXT=OptionsDialog]" style="width: 90%;"></textarea>
867 </fieldset>
869 <fieldset class="settings">
870 <legend>
871 <input type="checkbox" id="webUIReverseProxySupportCheckbox" onclick="qBittorrent.Preferences.updateWebUIReverseProxySettings();" />
872 <label for="webUIReverseProxySupportCheckbox">QBT_TR(Enable reverse proxy support)QBT_TR[CONTEXT=OptionsDialog]</label>
873 </legend>
874 <div class="formRow">
875 <label for="webUIReverseProxiesListTextarea">QBT_TR(Trusted proxies list:)QBT_TR[CONTEXT=OptionsDialog]</label>
876 <input type="text" id="webUIReverseProxiesListTextarea" title="QBT_TR(Specify reverse proxy IPs (or subnets, e.g. 0.0.0.0/24) in order to use forwarded client address (X-Forwarded-For header). Use ';' to split multiple entries.)QBT_TR[CONTEXT=OptionsDialog]" />
877 </div>
878 </fieldset>
880 </fieldset>
882 <fieldset class="settings">
883 <legend>
884 <input type="checkbox" id="use_dyndns_checkbox" onclick="qBittorrent.Preferences.updateDynDnsSettings();" />
885 <label for="use_dyndns_checkbox">QBT_TR(Update my dynamic domain name)QBT_TR[CONTEXT=OptionsDialog]</label>
886 </legend>
887 <select id="dyndns_select">
888 <option value="0">DynDNS</option>
889 <option value="1">NO-IP</option>
890 </select>
891 <input type="button" value="QBT_TR(Register)QBT_TR[CONTEXT=OptionsDialog]" onclick="qBittorrent.Preferences.registerDynDns();" />
892 <table style="margin-top: 10px;">
893 <tr>
894 <td>
895 <label for="dyndns_domain_text">QBT_TR(Domain name:)QBT_TR[CONTEXT=OptionsDialog]</label>
896 </td>
897 <td>
898 <input type="text" id="dyndns_domain_text" />
899 </td>
900 </tr>
901 <tr>
902 <td>
903 <label for="dyndns_username_text">QBT_TR(Username:)QBT_TR[CONTEXT=OptionsDialog]</label>
904 </td>
905 <td>
906 <input type="text" id="dyndns_username_text" />
907 </td>
908 </tr>
909 <tr>
910 <td>
911 <label for="dyndns_password_text">QBT_TR(Password:)QBT_TR[CONTEXT=OptionsDialog]</label>
912 </td>
913 <td>
914 <input type="password" id="dyndns_password_text" />
915 </td>
916 </tr>
917 </table>
918 </fieldset>
919 </div>
921 <div id="AdvancedTab" class="PrefTab invisible">
922 <fieldset class="settings">
923 <legend>QBT_TR(qBittorrent Section)QBT_TR[CONTEXT=OptionsDialog]&nbsp;(<a href="https://github.com/qbittorrent/qBittorrent/wiki/Explanation-of-Options-in-qBittorrent#Advanced" target="_blank">QBT_TR(Open documentation)QBT_TR[CONTEXT=HttpServer]</a>)</legend>
924 <table>
925 <tr>
926 <td>
927 <label for="resumeDataStorageType">QBT_TR(Resume data storage type (requires restart):)QBT_TR[CONTEXT=OptionsDialog]</label>
928 </td>
929 <td>
930 <select id="resumeDataStorageType" style="width: 15em;">
931 <option value="Legacy">QBT_TR(Fastresume files)QBT_TR[CONTEXT=OptionsDialog]</option>
932 <option value="SQLite">QBT_TR(SQLite database (experimental))QBT_TR[CONTEXT=OptionsDialog]</option>
933 </select>
934 </td>
935 </tr>
936 <tr>
937 <td>
938 <label for="memoryWorkingSetLimit">QBT_TR(Physical memory (RAM) usage limit (applied if libtorrent >= 2.0):)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://wikipedia.org/wiki/Working_set" target="_blank">(?)</a></label>
939 </td>
940 <td>
941 <input type="text" id="memoryWorkingSetLimit" style="width: 15em;" title="QBT_TR(This option is less effective on Linux)QBT_TR[CONTEXT=OptionsDialog]">&nbsp;&nbsp;QBT_TR(MiB)QBT_TR[CONTEXT=OptionsDialog]
942 </td>
943 </tr>
944 <tr>
945 <td>
946 <label for="networkInterface">QBT_TR(Network interface:)QBT_TR[CONTEXT=OptionsDialog]</label>
947 </td>
948 <td>
949 <select id="networkInterface" style="width: 15em;">
950 </select>
951 </td>
952 </tr>
953 <tr>
954 <td>
955 <label for="optionalIPAddressToBind">QBT_TR(Optional IP address to bind to:)QBT_TR[CONTEXT=OptionsDialog]</label>
956 </td>
957 <td>
958 <select id="optionalIPAddressToBind" style="width: 15em;">
959 </select>
960 </td>
961 </tr>
962 <tr>
963 <td>
964 <label for="saveResumeDataInterval">QBT_TR(Save resume data interval:)QBT_TR[CONTEXT=OptionsDialog]</label>
965 </td>
966 <td>
967 <input type="text" id="saveResumeDataInterval" style="width: 15em;">&nbsp;&nbsp;QBT_TR(min)QBT_TR[CONTEXT=OptionsDialog]
968 </td>
969 </tr>
970 <tr>
971 <td>
972 <label for="recheckTorrentsOnCompletion">QBT_TR(Recheck torrents on completion:)QBT_TR[CONTEXT=OptionsDialog]</label>
973 </td>
974 <td>
975 <input type="checkbox" id="recheckTorrentsOnCompletion">
976 </td>
977 </tr>
978 <tr>
979 <td>
980 <label for="refreshInterval">QBT_TR(Refresh interval:)QBT_TR[CONTEXT=OptionsDialog]</label>
981 </td>
982 <td>
983 <input type="text" id="refreshInterval" style="width: 15em;" title="QBT_TR(It controls the internal state update interval which in turn will affect UI updates)QBT_TR[CONTEXT=OptionsDialog]">&nbsp;&nbsp;QBT_TR(ms)QBT_TR[CONTEXT=OptionsDialog]
984 </td>
985 </tr>
986 <tr>
987 <td>
988 <label for="resolvePeerCountries">QBT_TR(Resolve peer countries:)QBT_TR[CONTEXT=OptionsDialog]</label>
989 </td>
990 <td>
991 <input type="checkbox" id="resolvePeerCountries">
992 </td>
993 </tr>
994 <tr>
995 <td>
996 <label for="reannounceWhenAddressChanged">QBT_TR(Reannounce to all trackers when IP or port changed:)QBT_TR[CONTEXT=OptionsDialog]</label>
997 </td>
998 <td>
999 <input type="checkbox" id="reannounceWhenAddressChanged" />
1000 </td>
1001 </tr>
1002 <tr>
1003 <td>
1004 <label for="enableEmbeddedTracker">QBT_TR(Enable embedded tracker:)QBT_TR[CONTEXT=OptionsDialog]</label>
1005 </td>
1006 <td>
1007 <input type="checkbox" id="enableEmbeddedTracker" />
1008 </td>
1009 </tr>
1010 <tr>
1011 <td>
1012 <label for="embeddedTrackerPort">QBT_TR(Embedded tracker port:)QBT_TR[CONTEXT=OptionsDialog]</label>
1013 </td>
1014 <td>
1015 <input type="text" id="embeddedTrackerPort" style="width: 15em;" />
1016 </td>
1017 </tr>
1018 <tr>
1019 <td>
1020 <label for="embeddedTrackerPortForwarding">QBT_TR(Enable port forwarding for embedded tracker:)QBT_TR[CONTEXT=OptionsDialog]</label>
1021 </td>
1022 <td>
1023 <input type="checkbox" id="embeddedTrackerPortForwarding" />
1024 </td>
1025 </tr>
1026 </table>
1027 </fieldset>
1028 <fieldset class="settings">
1029 <legend>QBT_TR(libtorrent Section)QBT_TR[CONTEXT=OptionsDialog]&nbsp;(<a href="https://www.libtorrent.org/reference-Settings.html" target="_blank">QBT_TR(Open documentation)QBT_TR[CONTEXT=HttpServer]</a>)</legend>
1030 <table>
1031 <tr>
1032 <td>
1033 <label for="asyncIOThreads">QBT_TR(Asynchronous I/O threads:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#aio_threads" target="_blank">(?)</a></label>
1034 </td>
1035 <td>
1036 <input type="text" id="asyncIOThreads" style="width: 15em;" />
1037 </td>
1038 </tr>
1039 <tr>
1040 <td>
1041 <label for="hashingThreads">QBT_TR(Hashing threads (requires libtorrent >= 2.0):)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#hashing_threads" target="_blank">(?)</a></label>
1042 </td>
1043 <td>
1044 <input type="text" id="hashingThreads" style="width: 15em;" />
1045 </td>
1046 </tr>
1047 <tr>
1048 <td>
1049 <label for="filePoolSize">QBT_TR(File pool size:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#file_pool_size" target="_blank">(?)</a></label>
1050 </td>
1051 <td>
1052 <input type="text" id="filePoolSize" style="width: 15em;" />
1053 </td>
1054 </tr>
1055 <tr>
1056 <td>
1057 <label for="outstandMemoryWhenCheckingTorrents">QBT_TR(Outstanding memory when checking torrents:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#checking_mem_usage" target="_blank">(?)</a></label>
1058 </td>
1059 <td>
1060 <input type="text" id="outstandMemoryWhenCheckingTorrents" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(MiB)QBT_TR[CONTEXT=OptionsDialog]
1061 </td>
1062 </tr>
1063 <tr>
1064 <td>
1065 <label for="diskCache">QBT_TR(Disk cache (requires libtorrent < 2.0):)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#cache_size" target="_blank">(?)</a></label>
1066 </td>
1067 <td>
1068 <input type="text" id="diskCache" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(MiB)QBT_TR[CONTEXT=OptionsDialog]
1069 </td>
1070 </tr>
1071 <tr>
1072 <td>
1073 <label for="diskCacheExpiryInterval">QBT_TR(Disk cache expiry interval (requires libtorrent < 2.0):)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#cache_expiry" target="_blank">(?)</a></label>
1074 </td>
1075 <td>
1076 <input type="text" id="diskCacheExpiryInterval" style="width: 15em;">&nbsp;&nbsp;QBT_TR(s)QBT_TR[CONTEXT=OptionsDialog]
1077 </td>
1078 </tr>
1079 <tr>
1080 <td>
1081 <label for="diskQueueSize">QBT_TR(Disk queue size:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#max_queued_disk_bytes" target="_blank">(?)</a></label>
1082 </td>
1083 <td>
1084 <input type="text" id="diskQueueSize" style="width: 15em;">&nbsp;&nbsp;QBT_TR(KiB)QBT_TR[CONTEXT=OptionsDialog]
1085 </td>
1086 </tr>
1087 <tr>
1088 <td>
1089 <label for="diskIOType">QBT_TR(Disk IO type (libtorrent >= 2.0; requires restart):)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/single-page-ref.html#default-disk-io-constructor" target="_blank">(?)</a></label>
1090 </td>
1091 <td>
1092 <select id="diskIOType" style="width: 15em;">
1093 <option value="0">QBT_TR(Default)QBT_TR[CONTEXT=OptionsDialog]</option>
1094 <option value="1">QBT_TR(Memory mapped files)QBT_TR[CONTEXT=OptionsDialog]</option>
1095 <option value="2">QBT_TR(POSIX-compliant)QBT_TR[CONTEXT=OptionsDialog]</option>
1096 </select>
1097 </td>
1098 </tr>
1099 <tr>
1100 <td>
1101 <label for="diskIOReadMode">QBT_TR(Disk IO read mode:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#disk_io_read_mode" target="_blank">(?)</a></label>
1102 </td>
1103 <td>
1104 <select id="diskIOReadMode" style="width: 15em;">
1105 <option value="0">QBT_TR(Disable OS cache)QBT_TR[CONTEXT=OptionsDialog]</option>
1106 <option value="1">QBT_TR(Enable OS cache)QBT_TR[CONTEXT=OptionsDialog]</option>
1107 </select>
1108 </td>
1109 </tr>
1110 <tr>
1111 <td>
1112 <label for="diskIOWriteMode">QBT_TR(Disk IO write mode:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#disk_io_write_mode" target="_blank">(?)</a></label>
1113 </td>
1114 <td>
1115 <select id="diskIOWriteMode" style="width: 15em;">
1116 <option value="0">QBT_TR(Disable OS cache)QBT_TR[CONTEXT=OptionsDialog]</option>
1117 <option value="1">QBT_TR(Enable OS cache)QBT_TR[CONTEXT=OptionsDialog]</option>
1118 <option value="2">QBT_TR(Write-through (requires libtorrent >= 2.0.6))QBT_TR[CONTEXT=OptionsDialog]</option>
1119 </select>
1120 </td>
1121 </tr>
1122 <tr>
1123 <td>
1124 <label for="coalesceReadsAndWrites">QBT_TR(Coalesce reads & writes (requires libtorrent < 2.0):)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#coalesce_reads" target="_blank">(?)</a></label>
1125 </td>
1126 <td>
1127 <input type="checkbox" id="coalesceReadsAndWrites" />
1128 </td>
1129 </tr>
1130 <tr>
1131 <td>
1132 <label for="pieceExtentAffinity">QBT_TR(Use piece extent affinity:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://libtorrent.org/single-page-ref.html#piece_extent_affinity" target="_blank">(?)</a></label>
1133 </td>
1134 <td>
1135 <input type="checkbox" id="pieceExtentAffinity" />
1136 </td>
1137 </tr>
1138 <tr>
1139 <td>
1140 <label for="sendUploadPieceSuggestions">QBT_TR(Send upload piece suggestions:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#suggest_mode" target="_blank">(?)</a></label>
1141 </td>
1142 <td>
1143 <input type="checkbox" id="sendUploadPieceSuggestions" />
1144 </td>
1145 </tr>
1146 <tr>
1147 <td>
1148 <label for="sendBufferWatermark">QBT_TR(Send buffer watermark:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#send_buffer_watermark" target="_blank">(?)</a></label>
1149 </td>
1150 <td>
1151 <input type="text" id="sendBufferWatermark" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(KiB)QBT_TR[CONTEXT=OptionsDialog]
1152 </td>
1153 </tr>
1154 <tr>
1155 <td>
1156 <label for="sendBufferLowWatermark">QBT_TR(Send buffer low watermark:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#send_buffer_low_watermark" target="_blank">(?)</a></label>
1157 </td>
1158 <td>
1159 <input type="text" id="sendBufferLowWatermark" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(KiB)QBT_TR[CONTEXT=OptionsDialog]
1160 </td>
1161 </tr>
1162 <tr>
1163 <td>
1164 <label for="sendBufferWatermarkFactor">QBT_TR(Send buffer watermark factor:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#send_buffer_watermark_factor" target="_blank">(?)</a></label>
1165 </td>
1166 <td>
1167 <input type="text" id="sendBufferWatermarkFactor" style="width: 15em;" />&nbsp;&nbsp;%
1168 </td>
1169 </tr>
1170 <tr>
1171 <td>
1172 <label for="connectionSpeed">QBT_TR(Outgoing connections per second:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#connection_speed" target="_blank">(?)</a></label>
1173 </td>
1174 <td>
1175 <input type="text" id="connectionSpeed" style="width: 15em;" />
1176 </td>
1177 </tr>
1178 <tr>
1179 <td>
1180 <label for="socketBacklogSize">QBT_TR(Socket backlog size:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#listen_queue_size" target="_blank">(?)</a></label>
1181 </td>
1182 <td>
1183 <input type="text" id="socketBacklogSize" style="width: 15em;" />
1184 </td>
1185 </tr>
1186 <tr>
1187 <td>
1188 <label for="outgoingPortsMin">QBT_TR(Outgoing ports (Min) [0: Disabled]:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#outgoing_port" target="_blank">(?)</a></label>
1189 </td>
1190 <td>
1191 <input type="text" id="outgoingPortsMin" style="width: 15em;" />
1192 </td>
1193 </tr>
1194 <tr>
1195 <td>
1196 <label for="outgoingPortsMax">QBT_TR(Outgoing ports (Max) [0: Disabled]:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#outgoing_port" target="_blank">(?)</a></label>
1197 </td>
1198 <td>
1199 <input type="text" id="outgoingPortsMax" style="width: 15em;" />
1200 </td>
1201 </tr>
1202 <tr>
1203 <td>
1204 <label for="UPnPLeaseDuration">QBT_TR(UPnP lease duration [0: Permanent lease]:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#upnp_lease_duration" target="_blank">(?)</a></label>
1205 </td>
1206 <td>
1207 <input type="text" id="UPnPLeaseDuration" style="width: 15em;" />
1208 </td>
1209 </tr>
1210 <tr>
1211 <td>
1212 <label for="peerToS">QBT_TR(Type of service (ToS) for connections to peers)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#peer_tos" target="_blank">(?)</a></label>
1213 </td>
1214 <td>
1215 <input type="text" id="peerToS" style="width: 15em;" />
1216 </td>
1217 </tr>
1218 <tr>
1219 <td>
1220 <label for="utpTCPMixedModeAlgorithm">QBT_TR(μTP-TCP mixed mode algorithm:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#mixed_mode_algorithm" target="_blank">(?)</a></label>
1221 </td>
1222 <td>
1223 <select id="utpTCPMixedModeAlgorithm" style="width: 15em;">
1224 <option value="0">QBT_TR(Prefer TCP)QBT_TR[CONTEXT=OptionsDialog]</option>
1225 <option value="1">QBT_TR(Peer proportional (throttles TCP))QBT_TR[CONTEXT=OptionsDialog]</option>
1226 </select>
1227 </td>
1228 </tr>
1229 <tr>
1230 <td>
1231 <label for="IDNSupportCheckbox">QBT_TR(Support internationalized domain name (IDN):)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#allow_idna" target="_blank">(?)</a></label>
1232 </td>
1233 <td>
1234 <input type="checkbox" id="IDNSupportCheckbox" />
1235 </td>
1236 </tr>
1237 <tr>
1238 <td>
1239 <label for="allowMultipleConnectionsFromTheSameIPAddress">QBT_TR(Allow multiple connections from the same IP address:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#allow_multiple_connections_per_ip" target="_blank">(?)</a></label>
1240 </td>
1241 <td>
1242 <input type="checkbox" id="allowMultipleConnectionsFromTheSameIPAddress" />
1243 </td>
1244 </tr>
1245 <tr>
1246 <td>
1247 <label for="validateHTTPSTrackerCertificate">QBT_TR(Validate HTTPS tracker certificate:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#validate_https_trackers" target="_blank">(?)</a></label>
1248 </td>
1249 <td>
1250 <input type="checkbox" id="validateHTTPSTrackerCertificate" />
1251 </td>
1252 </tr>
1253 <tr>
1254 <td>
1255 <label for="mitigateSSRF">QBT_TR(Server-side request forgery (SSRF) mitigation:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#ssrf_mitigation" target="_blank">(?)</a></label>
1256 </td>
1257 <td>
1258 <input type="checkbox" id="mitigateSSRF" />
1259 </td>
1260 </tr>
1261 <tr>
1262 <td>
1263 <label for="blockPeersOnPrivilegedPorts">QBT_TR(Disallow connection to peers on privileged ports:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://libtorrent.org/single-page-ref.html#no_connect_privileged_ports" target="_blank">(?)</a></label>
1264 </td>
1265 <td>
1266 <input type="checkbox" id="blockPeersOnPrivilegedPorts" />
1267 </td>
1268 </tr>
1269 <tr>
1270 <td>
1271 <label for="uploadSlotsBehavior">QBT_TR(Upload slots behavior:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#choking_algorithm" target="_blank">(?)</a></label>
1272 </td>
1273 <td>
1274 <select id="uploadSlotsBehavior" style="width: 15em;">
1275 <option value="0">QBT_TR(Fixed slots)QBT_TR[CONTEXT=OptionsDialog]</option>
1276 <option value="1">QBT_TR(Upload rate based)QBT_TR[CONTEXT=OptionsDialog]</option>
1277 </select>
1278 </td>
1279 </tr>
1280 <tr>
1281 <td>
1282 <label for="uploadChokingAlgorithm">QBT_TR(Upload choking algorithm:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#seed_choking_algorithm" target="_blank">(?)</a></label>
1283 </td>
1284 <td>
1285 <select id="uploadChokingAlgorithm" style="width: 15em;">
1286 <option value="0">QBT_TR(Round-robin)QBT_TR[CONTEXT=OptionsDialog]</option>
1287 <option value="1">QBT_TR(Fastest upload)QBT_TR[CONTEXT=OptionsDialog]</option>
1288 <option value="2">QBT_TR(Anti-leech)QBT_TR[CONTEXT=OptionsDialog]</option>
1289 </select>
1290 </td>
1291 </tr>
1292 <tr>
1293 <td>
1294 <label for="announceAllTrackers">QBT_TR(Always announce to all trackers in a tier:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#announce_to_all_trackers" target="_blank">(?)</a></label>
1295 </td>
1296 <td>
1297 <input type="checkbox" id="announceAllTrackers" />
1298 </td>
1299 </tr>
1300 <tr>
1301 <td>
1302 <label for="announceAllTiers">QBT_TR(Always announce to all tiers:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#announce_to_all_tiers" target="_blank">(?)</a></label>
1303 </td>
1304 <td>
1305 <input type="checkbox" id="announceAllTiers" />
1306 </td>
1307 </tr>
1308 <tr>
1309 <td>
1310 <label for="announceIP">QBT_TR(IP address reported to trackers (requires restart):)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#announce_ip" target="_blank">(?)</a></label>
1311 </td>
1312 <td>
1313 <input type="text" id="announceIP" style="width: 15em;" />
1314 </td>
1315 </tr>
1316 <tr>
1317 <td>
1318 <label for="maxConcurrentHTTPAnnounces">QBT_TR(Max concurrent HTTP announces:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#max_concurrent_http_announces" target="_blank">(?)</a></label>
1319 </td>
1320 <td>
1321 <input type="text" id="maxConcurrentHTTPAnnounces" style="width: 15em;" />
1322 </td>
1323 </tr>
1324 <tr>
1325 <td>
1326 <label for="stopTrackerTimeout">QBT_TR(Stop tracker timeout:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#stop_tracker_timeout" target="_blank">(?)</a></label>
1327 </td>
1328 <td>
1329 <input type="text" id="stopTrackerTimeout" style="width: 15em;" />
1330 </td>
1331 </tr>
1332 <tr>
1333 <td>
1334 <label for="peerTurnover">QBT_TR(Peer turnover disconnect percentage:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#peer_turnover" target="_blank">(?)</a></label>
1335 </td>
1336 <td>
1337 <input type="text" id="peerTurnover" style="width: 15em;" />&nbsp;&nbsp;%
1338 </td>
1339 </tr>
1340 <tr>
1341 <td>
1342 <label for="peerTurnoverCutoff">QBT_TR(Peer turnover threshold percentage:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#peer_turnover" target="_blank">(?)</a></label>
1343 </td>
1344 <td>
1345 <input type="text" id="peerTurnoverCutoff" style="width: 15em;" />&nbsp;&nbsp;%
1346 </td>
1347 </tr>
1348 <tr>
1349 <td>
1350 <label for="peerTurnoverInterval">QBT_TR(Peer turnover disconnect interval:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#peer_turnover" target="_blank">(?)</a></label>
1351 </td>
1352 <td>
1353 <input type="text" id="peerTurnoverInterval" style="width: 15em;" />&nbsp;&nbsp;s
1354 </td>
1355 </tr>
1356 <tr>
1357 <td>
1358 <label for="requestQueueSize">QBT_TR(Maximum outstanding requests to a single peer:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#max_out_request_queue" target="_blank">(?)</a></label>
1359 </td>
1360 <td>
1361 <input type="text" id="requestQueueSize" style="width: 15em;" />
1362 </td>
1363 </tr>
1364 </table>
1365 </fieldset>
1366 </div>
1368 <div style="text-align: center; margin-top: 1em;"><input type="button" value="QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" onclick="qBittorrent.Preferences.applyPreferences();" /></div>
1370 <script>
1371 'use strict';
1373 if (window.qBittorrent === undefined) {
1374 window.qBittorrent = {};
1377 window.qBittorrent.Preferences = (function() {
1378 const exports = function() {
1379 return {
1380 numberInputLimiter: numberInputLimiter,
1381 updateFileLogEnabled: updateFileLogEnabled,
1382 updateFileLogBackupEnabled: updateFileLogBackupEnabled,
1383 updateFileLogDeleteEnabled: updateFileLogDeleteEnabled,
1384 updateTempDirEnabled: updateTempDirEnabled,
1385 updateExportDirEnabled: updateExportDirEnabled,
1386 updateExportDirFinEnabled: updateExportDirFinEnabled,
1387 addWatchFolder: addWatchFolder,
1388 updateExcludedFileNamesEnabled: updateExcludedFileNamesEnabled,
1389 changeWatchFolderSelect: changeWatchFolderSelect,
1390 updateMailNotification: updateMailNotification,
1391 updateMailAuthSettings: updateMailAuthSettings,
1392 updateAutoRun: updateAutoRun,
1393 updateAutoRunOnTorrentAdded: updateAutoRunOnTorrentAdded,
1394 generateRandomPort: generateRandomPort,
1395 updateMaxConnecEnabled: updateMaxConnecEnabled,
1396 updateMaxConnecPerTorrentEnabled: updateMaxConnecPerTorrentEnabled,
1397 updateMaxUploadsEnabled: updateMaxUploadsEnabled,
1398 updateMaxUploadsPerTorrentEnabled: updateMaxUploadsPerTorrentEnabled,
1399 updatePeerProxySettings: updatePeerProxySettings,
1400 updatePeerProxyAuthSettings: updatePeerProxyAuthSettings,
1401 updateFilterSettings: updateFilterSettings,
1402 updateSchedulingEnabled: updateSchedulingEnabled,
1403 updateQueueingSystem: updateQueueingSystem,
1404 updateSlowTorrentsSettings: updateSlowTorrentsSettings,
1405 updateMaxRatioTimeEnabled: updateMaxRatioTimeEnabled,
1406 updateAddTrackersEnabled: updateAddTrackersEnabled,
1407 updateHttpsSettings: updateHttpsSettings,
1408 updateBypasssAuthSettings: updateBypasssAuthSettings,
1409 updateAlternativeWebUISettings: updateAlternativeWebUISettings,
1410 updateHostHeaderValidationSettings: updateHostHeaderValidationSettings,
1411 updateWebUICustomHTTPHeadersSettings: updateWebUICustomHTTPHeadersSettings,
1412 updateWebUIReverseProxySettings: updateWebUIReverseProxySettings,
1413 updateDynDnsSettings: updateDynDnsSettings,
1414 updateWebuiLocaleSelect: updateWebuiLocaleSelect,
1415 registerDynDns: registerDynDns,
1416 applyPreferences: applyPreferences
1420 // Behavior tab
1421 const numberInputLimiter = (input) => {
1422 const min = input.getAttribute("min");
1423 const max = input.getAttribute("max");
1425 if (min && input.value.toInt() < min.toInt())
1426 input.value = min;
1428 if (max && input.value.toInt() > max.toInt())
1429 input.value = max;
1432 const updateFileLogEnabled = function() {
1433 const isFileLogEnabled = $('filelog_checkbox').getProperty('checked');
1434 $('filelog_save_path_input').setProperty('disabled', !isFileLogEnabled);
1435 $('filelog_backup_checkbox').setProperty('disabled', !isFileLogEnabled);
1436 $('filelog_delete_old_checkbox').setProperty('disabled', !isFileLogEnabled);
1438 updateFileLogBackupEnabled();
1439 updateFileLogDeleteEnabled();
1442 const updateFileLogBackupEnabled = function() {
1443 const pros = $('filelog_backup_checkbox').getProperties('disabled', 'checked');
1444 $('filelog_max_size_input').setProperty('disabled', pros.disabled || !pros.checked);
1447 const updateFileLogDeleteEnabled = function() {
1448 const pros = $('filelog_delete_old_checkbox').getProperties('disabled', 'checked');
1449 $('filelog_age_input').setProperty('disabled', pros.disabled || !pros.checked);
1450 $('filelog_age_type_select').setProperty('disabled', pros.disabled || !pros.checked);
1453 // Downloads tab
1454 const watchedFoldersTable = new HtmlTable($("watched_folders_tab"));
1456 const updateTempDirEnabled = function() {
1457 const isTempDirEnabled = $('temppath_checkbox').getProperty('checked');
1458 $('temppath_text').setProperty('disabled', !isTempDirEnabled);
1461 const changeWatchFolderSelect = (item) => {
1462 if (item.value === "other") {
1463 item.nextElementSibling.hidden = false;
1464 item.nextElementSibling.value = 'QBT_TR(Type folder here)QBT_TR[CONTEXT=ScanFoldersModel]';
1465 item.nextElementSibling.select();
1467 else {
1468 item.nextElementSibling.hidden = true;
1469 const text = item.options[item.selectedIndex].textContent;
1470 item.nextElementSibling.value = text;
1474 const addWatchFolder = (folder = "", sel = "default_folder", other = "") => {
1475 const pos = $('watched_folders_tab').getChildren('tbody')[0].getChildren('tr').length;
1476 const myinput = "<input id='text_watch_" + pos + "' type='text' value='" + folder + "'>";
1477 const disableInput = (sel !== "other");
1478 const mycb = "<div class='select-watched-folder-editable'>"
1479 + "<select id ='cb_watch_" + pos + "' onchange='qBittorrent.Preferences.changeWatchFolderSelect(this)'>"
1480 + "<option value='watch_folder'>QBT_TR(Monitored folder)QBT_TR[CONTEXT=ScanFoldersModel]</option>"
1481 + "<option value='default_folder'>QBT_TR(Default save location)QBT_TR[CONTEXT=ScanFoldersModel]</option>"
1482 + "<option value='other'>QBT_TR(Other...)QBT_TR[CONTEXT=ScanFoldersModel]</option>"
1483 + "</select>"
1484 + "<input id='cb_watch_txt_" + pos + "' type='text' " + (disableInput ? "hidden " : "") + "/>"
1485 + "<img src='images/list-add.svg' id='addFolderImg_" + pos + "' alt='Add' style='padding-left:170px;width:16px;cursor:pointer;' onclick='qBittorrent.Preferences.addWatchFolder();' />"
1486 + "</div>";
1488 watchedFoldersTable.push([myinput, mycb]);
1489 $('cb_watch_' + pos).setProperty('value', sel);
1490 if (disableInput) {
1491 const elt = $('cb_watch_' + pos);
1492 other = elt.options[elt.selectedIndex].textContent;
1494 $('cb_watch_txt_' + pos).setProperty('value', other);
1496 // hide previous img
1497 if (pos > 0)
1498 $('addFolderImg_' + (pos - 1)).style.display = "none";
1501 const getWatchedFolders = () => {
1502 const nb_folders = $("watched_folders_tab").getChildren("tbody")[0].getChildren("tr").length;
1503 const folders = new Hash();
1504 for (let i = 0; i < nb_folders; ++i) {
1505 const fpath = $('text_watch_' + i).getProperty('value').trim();
1506 if (fpath.length > 0) {
1507 const sel = $('cb_watch_' + i).getProperty('value').trim();
1509 let other;
1510 if (sel === "other")
1511 other = $('cb_watch_txt_' + i).getProperty('value').trim();
1512 else
1513 other = (sel === "watch_folder") ? 0 : 1;
1515 folders.set(fpath, other);
1518 return folders;
1521 const updateExcludedFileNamesEnabled = function() {
1522 const isAExcludedFileNamesEnabled = $('excludedFileNamesCheckbox').getProperty('checked');
1523 $('excludedFileNamesTextarea').setProperty('disabled', !isAExcludedFileNamesEnabled);
1526 const updateExportDirEnabled = function() {
1527 const isExportDirEnabled = $('exportdir_checkbox').getProperty('checked');
1528 $('exportdir_text').setProperty('disabled', !isExportDirEnabled);
1531 const updateExportDirFinEnabled = function() {
1532 const isExportDirFinEnabled = $('exportdirfin_checkbox').getProperty('checked');
1533 $('exportdirfin_text').setProperty('disabled', !isExportDirFinEnabled);
1536 const updateMailNotification = function() {
1537 const isMailNotificationEnabled = $('mail_notification_checkbox').getProperty('checked');
1538 $('src_email_txt').setProperty('disabled', !isMailNotificationEnabled);
1539 $('dest_email_txt').setProperty('disabled', !isMailNotificationEnabled);
1540 $('smtp_server_txt').setProperty('disabled', !isMailNotificationEnabled);
1541 $('mail_ssl_checkbox').setProperty('disabled', !isMailNotificationEnabled);
1542 $('mail_auth_checkbox').setProperty('disabled', !isMailNotificationEnabled);
1544 if (!isMailNotificationEnabled) {
1545 $('mail_auth_checkbox').setProperty('checked', !isMailNotificationEnabled);
1546 updateMailAuthSettings();
1550 const updateMailAuthSettings = function() {
1551 const isMailAuthEnabled = $('mail_auth_checkbox').getProperty('checked');
1552 $('mail_username_text').setProperty('disabled', !isMailAuthEnabled);
1553 $('mail_password_text').setProperty('disabled', !isMailAuthEnabled);
1556 const updateAutoRunOnTorrentAdded = function() {
1557 const isAutoRunOnTorrentAddedEnabled = $('autorunOnTorrentAddedCheckbox').getProperty('checked');
1558 $('autorunOnTorrentAddedProgram').setProperty('disabled', !isAutoRunOnTorrentAddedEnabled);
1561 const updateAutoRun = function() {
1562 const isAutoRunEnabled = $('autorun_checkbox').getProperty('checked');
1563 $('autorunProg_txt').setProperty('disabled', !isAutoRunEnabled);
1566 // Connection tab
1568 const updateMaxConnecEnabled = function() {
1569 const isMaxConnecEnabled = $('max_connec_checkbox').getProperty('checked');
1570 $('max_connec_value').setProperty('disabled', !isMaxConnecEnabled);
1573 const updateMaxConnecPerTorrentEnabled = function() {
1574 const isMaxConnecPerTorrentEnabled = $('max_connec_per_torrent_checkbox').getProperty('checked');
1575 $('max_connec_per_torrent_value').setProperty('disabled', !isMaxConnecPerTorrentEnabled);
1578 const updateMaxUploadsEnabled = function() {
1579 const isMaxUploadsEnabled = $('max_uploads_checkbox').getProperty('checked');
1580 $('max_uploads_value').setProperty('disabled', !isMaxUploadsEnabled);
1583 const updateMaxUploadsPerTorrentEnabled = function() {
1584 const isMaxUploadsPerTorrentEnabled = $('max_uploads_per_torrent_checkbox').getProperty('checked');
1585 $('max_uploads_per_torrent_value').setProperty('disabled', !isMaxUploadsPerTorrentEnabled);
1588 const updatePeerProxySettings = function() {
1589 const proxyType = $('peer_proxy_type_select').getProperty('value');
1590 const isProxySocks4 = (proxyType === "SOCKS4");
1592 $('peer_proxy_auth_checkbox').setProperty('disabled', isProxySocks4);
1593 $('use_peer_proxy_checkbox').setProperty('disabled', !$('proxy_bittorrent_checkbox').getProperty('checked'));
1594 $('proxyHostnameLookupCheckbox').setProperty('disabled', isProxySocks4 || !$('proxy_bittorrent_checkbox').getProperty('checked'));
1595 $('proxy_rss_checkbox').setProperty('disabled', isProxySocks4);
1596 $('proxy_misc_checkbox').setProperty('disabled', isProxySocks4);
1598 updatePeerProxyAuthSettings();
1601 const updatePeerProxyAuthSettings = function() {
1602 const isPeerProxyAuthEnabled = (!$('peer_proxy_auth_checkbox').getProperty('disabled') && $('peer_proxy_auth_checkbox').getProperty('checked'));
1603 $('peer_proxy_username_text').setProperty('disabled', !isPeerProxyAuthEnabled);
1604 $('peer_proxy_password_text').setProperty('disabled', !isPeerProxyAuthEnabled);
1607 const updateFilterSettings = function() {
1608 const isIPFilterEnabled = $('ipfilter_text_checkbox').getProperty('checked');
1609 $('ipfilter_text').setProperty('disabled', !isIPFilterEnabled);
1612 // Speed tab
1613 const updateSchedulingEnabled = function() {
1614 const isLimitSchedulingEnabled = $('limitSchedulingCheckbox').getProperty('checked');
1615 $('schedule_from_hour').setProperty('disabled', !isLimitSchedulingEnabled);
1616 $('schedule_from_min').setProperty('disabled', !isLimitSchedulingEnabled);
1617 $('schedule_to_hour').setProperty('disabled', !isLimitSchedulingEnabled);
1618 $('schedule_to_min').setProperty('disabled', !isLimitSchedulingEnabled);
1619 $('schedule_freq_select').setProperty('disabled', !isLimitSchedulingEnabled);
1622 // Bittorrent tab
1623 const updateQueueingSystem = function() {
1624 const isQueueingEnabled = $('queueing_checkbox').getProperty('checked');
1625 $('max_active_dl_value').setProperty('disabled', !isQueueingEnabled);
1626 $('max_active_up_value').setProperty('disabled', !isQueueingEnabled);
1627 $('max_active_to_value').setProperty('disabled', !isQueueingEnabled);
1628 $('dont_count_slow_torrents_checkbox').setProperty('disabled', !isQueueingEnabled);
1629 updateSlowTorrentsSettings();
1632 const updateSlowTorrentsSettings = function() {
1633 const isDontCountSlowTorrentsEnabled = (!$('dont_count_slow_torrents_checkbox').getProperty('disabled')) && $('dont_count_slow_torrents_checkbox').getProperty('checked');
1634 $('dl_rate_threshold').setProperty('disabled', !isDontCountSlowTorrentsEnabled);
1635 $('ul_rate_threshold').setProperty('disabled', !isDontCountSlowTorrentsEnabled);
1636 $('torrent_inactive_timer').setProperty('disabled', !isDontCountSlowTorrentsEnabled);
1639 const updateMaxRatioTimeEnabled = function() {
1640 const isMaxRatioEnabled = $('max_ratio_checkbox').getProperty('checked');
1641 $('max_ratio_value').setProperty('disabled', !isMaxRatioEnabled);
1643 const isMaxSeedingTimeEnabled = $('max_seeding_time_checkbox').getProperty('checked');
1644 $('max_seeding_time_value').setProperty('disabled', !isMaxSeedingTimeEnabled);
1646 $('max_ratio_act').setProperty('disabled', !(isMaxRatioEnabled || isMaxSeedingTimeEnabled));
1649 const updateAddTrackersEnabled = function() {
1650 const isAddTrackersEnabled = $('add_trackers_checkbox').getProperty('checked');
1651 $('add_trackers_textarea').setProperty('disabled', !isAddTrackersEnabled);
1654 // Web UI tab
1655 const updateHttpsSettings = function() {
1656 const isUseHttpsEnabled = $('use_https_checkbox').getProperty('checked');
1657 $('ssl_cert_text').setProperty('disabled', !isUseHttpsEnabled);
1658 $('ssl_key_text').setProperty('disabled', !isUseHttpsEnabled);
1659 $('secureCookieCheckbox').setProperty('disabled', !isUseHttpsEnabled);
1662 const updateBypasssAuthSettings = function() {
1663 const isBypassAuthSubnetWhitelistEnabled = $('bypass_auth_subnet_whitelist_checkbox').getProperty('checked');
1664 $('bypass_auth_subnet_whitelist_textarea').setProperty('disabled', !isBypassAuthSubnetWhitelistEnabled);
1667 const updateAlternativeWebUISettings = function() {
1668 const isUseAlternativeWebUIEnabled = $('use_alt_webui_checkbox').getProperty('checked');
1669 $('webui_files_location_textarea').setProperty('disabled', !isUseAlternativeWebUIEnabled);
1672 const updateHostHeaderValidationSettings = function() {
1673 const isHostHeaderValidationEnabled = $('host_header_validation_checkbox').getProperty('checked');
1674 $('webui_domain_textarea').setProperty('disabled', !isHostHeaderValidationEnabled);
1677 const updateWebUICustomHTTPHeadersSettings = function() {
1678 const isEnabled = $('webUIUseCustomHTTPHeadersCheckbox').getProperty('checked');
1679 $('webUICustomHTTPHeadersTextarea').setProperty('disabled', !isEnabled);
1682 const updateWebUIReverseProxySettings = function() {
1683 const isEnabled = $('webUIReverseProxySupportCheckbox').getProperty('checked');
1684 $('webUIReverseProxiesListTextarea').setProperty('disabled', !isEnabled);
1687 const updateDynDnsSettings = function() {
1688 const isDynDnsEnabled = $('use_dyndns_checkbox').getProperty('checked');
1689 $('dyndns_select').setProperty('disabled', !isDynDnsEnabled);
1690 $('dyndns_domain_text').setProperty('disabled', !isDynDnsEnabled);
1691 $('dyndns_username_text').setProperty('disabled', !isDynDnsEnabled);
1692 $('dyndns_password_text').setProperty('disabled', !isDynDnsEnabled);
1695 const registerDynDns = function() {
1696 if ($('dyndns_select').getProperty('value').toInt() == 1) {
1697 window.open("http://www.no-ip.com/services/managed_dns/free_dynamic_dns.html", "NO-IP Registration");
1699 else {
1700 window.open("https://www.dyndns.com/account/services/hosts/add.html", "DynDNS Registration");
1704 const generateRandomPort = function() {
1705 const min = 1024;
1706 const max = 65535;
1707 const port = Math.floor(Math.random() * (max - min + 1) + min);
1708 $('port_value').setProperty('value', port);
1711 const time_padding = function(val) {
1712 let ret = val.toString();
1713 if (ret.length == 1)
1714 ret = '0' + ret;
1715 return ret;
1718 // Advanced Tab
1719 const updateNetworkInterfaces = function(default_iface) {
1720 const url = 'api/v2/app/networkInterfaceList';
1721 $('networkInterface').empty();
1722 new Request.JSON({
1723 url: url,
1724 method: 'get',
1725 noCache: true,
1726 onFailure: function() {
1727 alert("Could not contact qBittorrent");
1729 onSuccess: function(ifaces) {
1730 if (!ifaces)
1731 return;
1733 $('networkInterface').options.add(new Option('QBT_TR(Any interface)QBT_TR[CONTEXT=OptionsDialog]', ''));
1734 ifaces.forEach(function(item, index) {
1735 $('networkInterface').options.add(new Option(item.name, item.value));
1737 $('networkInterface').setProperty('value', default_iface);
1739 }).send();
1742 const updateInterfaceAddresses = function(iface, default_addr) {
1743 const url = 'api/v2/app/networkInterfaceAddressList';
1744 $('optionalIPAddressToBind').empty();
1745 new Request.JSON({
1746 url: url,
1747 method: 'get',
1748 noCache: true,
1749 data: {
1750 'iface': iface
1752 onFailure: function() {
1753 alert("Could not contact qBittorrent");
1755 onSuccess: function(addresses) {
1756 if (!addresses)
1757 return;
1759 $('optionalIPAddressToBind').options.add(new Option('QBT_TR(All addresses)QBT_TR[CONTEXT=OptionDialog]', ''));
1760 $('optionalIPAddressToBind').options.add(new Option('QBT_TR(All IPv4 addresses)QBT_TR[CONTEXT=OptionDialog]', '0.0.0.0'));
1761 $('optionalIPAddressToBind').options.add(new Option('QBT_TR(All IPv6 addresses)QBT_TR[CONTEXT=OptionDialog]', '::'));
1762 addresses.forEach(function(item, index) {
1763 $('optionalIPAddressToBind').options.add(new Option(item, item));
1765 $('optionalIPAddressToBind').setProperty('value', default_addr);
1767 }).send();
1770 const updateWebuiLocaleSelect = (selected) => {
1771 let languages = [];
1772 for (let i = 0; i < $('locale_select').options.length; i++)
1773 languages.push($('locale_select').options[i].value);
1775 if (!languages.includes(selected)) {
1776 const lang = selected.slice(0, selected.indexOf('_'));
1777 selected = languages.includes(lang) ? lang : 'en';
1779 $('locale_select').setProperty('value', selected);
1782 const loadPreferences = function() {
1783 const url = 'api/v2/app/preferences';
1784 new Request.JSON({
1785 url: url,
1786 method: 'get',
1787 noCache: true,
1788 onFailure: function() {
1789 alert("Could not contact qBittorrent");
1791 onSuccess: function(pref) {
1792 if (pref) {
1793 // Behavior tab
1794 $('filelog_checkbox').setProperty('checked', pref.file_log_enabled);
1795 $('filelog_save_path_input').setProperty('value', pref.file_log_path);
1796 $('filelog_backup_checkbox').setProperty('checked', pref.file_log_backup_enabled);
1797 $('filelog_max_size_input').setProperty('value', pref.file_log_max_size);
1798 $('filelog_delete_old_checkbox').setProperty('checked', pref.file_log_delete_old);
1799 $('filelog_age_input').setProperty('value', pref.file_log_age);
1800 $('filelog_age_type_select').setProperty('value', pref.file_log_age_type);
1801 updateFileLogEnabled();
1803 // Downloads tab
1804 // When adding a torrent
1805 let index = 0;
1806 switch (pref.torrent_content_layout) {
1807 case "Original":
1808 index = 0;
1809 break;
1810 case "Subfolder":
1811 index = 1;
1812 break;
1813 case "NoSubfolder":
1814 index = 2;
1815 break;
1817 $('contentlayout_select').getChildren('option')[index].setAttribute('selected', '');
1818 $('dontstartdownloads_checkbox').setProperty('checked', pref.start_paused_enabled);
1819 switch (pref.torrent_stop_condition) {
1820 case "None":
1821 index = 0;
1822 break;
1823 case "MetadataReceived":
1824 index = 1;
1825 break;
1826 case "FilesChecked":
1827 index = 2;
1828 break;
1830 $('stopConditionSelect').getChildren('option')[index].setAttribute('selected', '');
1831 $('deletetorrentfileafter_checkbox').setProperty('checked', pref.auto_delete_mode);
1833 $('preallocateall_checkbox').setProperty('checked', pref.preallocate_all);
1834 $('appendext_checkbox').setProperty('checked', pref.incomplete_files_ext);
1836 // Saving Management
1837 $('default_tmm_combobox').setProperty('value', pref.auto_tmm_enabled);
1838 $('torrent_changed_tmm_combobox').setProperty('value', pref.torrent_changed_tmm_enabled);
1839 $('save_path_changed_tmm_combobox').setProperty('value', pref.save_path_changed_tmm_enabled);
1840 $('category_changed_tmm_combobox').setProperty('value', pref.category_changed_tmm_enabled);
1841 $('savepath_text').setProperty('value', pref.save_path);
1842 $('temppath_checkbox').setProperty('checked', pref.temp_path_enabled);
1843 $('temppath_text').setProperty('value', pref.temp_path);
1844 updateTempDirEnabled();
1845 if (pref.export_dir != '') {
1846 $('exportdir_checkbox').setProperty('checked', true);
1847 $('exportdir_text').setProperty('value', pref.export_dir);
1849 else {
1850 $('exportdir_checkbox').setProperty('checked', false);
1851 $('exportdir_text').setProperty('value', '');
1853 updateExportDirEnabled();
1854 if (pref.export_dir_fin != '') {
1855 $('exportdirfin_checkbox').setProperty('checked', true);
1856 $('exportdirfin_text').setProperty('value', pref.export_dir_fin);
1858 else {
1859 $('exportdirfin_checkbox').setProperty('checked', false);
1860 $('exportdirfin_text').setProperty('value', '');
1862 updateExportDirFinEnabled();
1864 // Automatically add torrents from
1865 for (const [folder, folderType] of Object.entries(pref.scan_dirs)) {
1866 let sel = "";
1867 let other = "";
1868 if (typeof folderType === "number") {
1869 sel = (folderType === 0) ? "watch_folder" : "default_folder";
1871 else {
1872 sel = "other";
1873 other = folderType;
1875 addWatchFolder(folder, sel, other);
1877 addWatchFolder();
1879 // Excluded file names
1880 $('excludedFileNamesCheckbox').setProperty('checked', pref.excluded_file_names_enabled);
1881 $('excludedFileNamesTextarea').setProperty('value', pref.excluded_file_names);
1883 // Email notification upon download completion
1884 $('mail_notification_checkbox').setProperty('checked', pref.mail_notification_enabled);
1885 $('src_email_txt').setProperty('value', pref.mail_notification_sender);
1886 $('dest_email_txt').setProperty('value', pref.mail_notification_email);
1887 $('smtp_server_txt').setProperty('value', pref.mail_notification_smtp);
1888 $('mail_ssl_checkbox').setProperty('checked', pref.mail_notification_ssl_enabled);
1889 $('mail_auth_checkbox').setProperty('checked', pref.mail_notification_auth_enabled);
1890 $('mail_username_text').setProperty('value', pref.mail_notification_username);
1891 $('mail_password_text').setProperty('value', pref.mail_notification_password);
1892 updateMailNotification();
1893 updateMailAuthSettings();
1895 // Run an external program on torrent added
1896 $('autorunOnTorrentAddedCheckbox').setProperty('checked', pref.autorun_on_torrent_added_enabled);
1897 $('autorunOnTorrentAddedProgram').setProperty('value', pref.autorun_on_torrent_added_program);
1898 updateAutoRunOnTorrentAdded();
1899 // Run an external program on torrent finished
1900 $('autorun_checkbox').setProperty('checked', pref.autorun_enabled);
1901 $('autorunProg_txt').setProperty('value', pref.autorun_program);
1902 updateAutoRun();
1904 // Connection tab
1905 // Listening Port
1906 $('port_value').setProperty('value', pref.listen_port.toInt());
1907 $('upnp_checkbox').setProperty('checked', pref.upnp);
1909 // Connections Limits
1910 const max_connec = pref.max_connec.toInt();
1911 if (max_connec <= 0) {
1912 $('max_connec_checkbox').setProperty('checked', false);
1913 $('max_connec_value').setProperty('value', 500);
1915 else {
1916 $('max_connec_checkbox').setProperty('checked', true);
1917 $('max_connec_value').setProperty('value', max_connec);
1919 updateMaxConnecEnabled();
1920 const max_connec_per_torrent = pref.max_connec_per_torrent.toInt();
1921 if (max_connec_per_torrent <= 0) {
1922 $('max_connec_per_torrent_checkbox').setProperty('checked', false);
1923 $('max_connec_per_torrent_value').setProperty('value', 100);
1925 else {
1926 $('max_connec_per_torrent_checkbox').setProperty('checked', true);
1927 $('max_connec_per_torrent_value').setProperty('value', max_connec_per_torrent);
1929 updateMaxConnecPerTorrentEnabled();
1930 const max_uploads = pref.max_uploads.toInt();
1931 if (max_uploads <= 0) {
1932 $('max_uploads_checkbox').setProperty('checked', false);
1933 $('max_uploads_value').setProperty('value', 8);
1935 else {
1936 $('max_uploads_checkbox').setProperty('checked', true);
1937 $('max_uploads_value').setProperty('value', max_uploads);
1939 updateMaxUploadsEnabled();
1940 const max_uploads_per_torrent = pref.max_uploads_per_torrent.toInt();
1941 if (max_uploads_per_torrent <= 0) {
1942 $('max_uploads_per_torrent_checkbox').setProperty('checked', false);
1943 $('max_uploads_per_torrent_value').setProperty('value', 4);
1945 else {
1946 $('max_uploads_per_torrent_checkbox').setProperty('checked', true);
1947 $('max_uploads_per_torrent_value').setProperty('value', max_uploads_per_torrent);
1949 updateMaxUploadsPerTorrentEnabled();
1951 // Proxy Server
1952 $('peer_proxy_type_select').setProperty('value', pref.proxy_type);
1953 $('peer_proxy_host_text').setProperty('value', pref.proxy_ip);
1954 $('peer_proxy_port_value').setProperty('value', pref.proxy_port);
1955 $('use_peer_proxy_checkbox').setProperty('checked', pref.proxy_peer_connections);
1956 $('proxyHostnameLookupCheckbox').setProperty('checked', pref.proxy_hostname_lookup);
1957 $('proxy_bittorrent_checkbox').setProperty('checked', pref.proxy_bittorrent);
1958 $('proxy_rss_checkbox').setProperty('checked', pref.proxy_rss);
1959 $('proxy_misc_checkbox').setProperty('checked', pref.proxy_misc);
1960 $('peer_proxy_auth_checkbox').setProperty('checked', pref.proxy_auth_enabled);
1961 $('peer_proxy_username_text').setProperty('value', pref.proxy_username);
1962 $('peer_proxy_password_text').setProperty('value', pref.proxy_password);
1963 updatePeerProxySettings();
1965 // IP Filtering
1966 $('ipfilter_text_checkbox').setProperty('checked', pref.ip_filter_enabled);
1967 $('ipfilter_text').setProperty('value', pref.ip_filter_path);
1968 $('ipfilter_trackers_checkbox').setProperty('checked', pref.ip_filter_trackers);
1969 $('banned_IPs_textarea').setProperty('value', pref.banned_IPs);
1970 updateFilterSettings();
1972 // Speed tab
1973 // Global Rate Limits
1974 $('up_limit_value').setProperty('value', (pref.up_limit.toInt() / 1024));
1975 $('dl_limit_value').setProperty('value', (pref.dl_limit.toInt() / 1024));
1976 // Alternative Global Rate Limits
1977 $('alt_up_limit_value').setProperty('value', (pref.alt_up_limit.toInt() / 1024));
1978 $('alt_dl_limit_value').setProperty('value', (pref.alt_dl_limit.toInt() / 1024));
1980 $('enable_protocol_combobox').setProperty('value', pref.bittorrent_protocol);
1981 $('limit_utp_rate_checkbox').setProperty('checked', pref.limit_utp_rate);
1982 $('limit_tcp_overhead_checkbox').setProperty('checked', pref.limit_tcp_overhead);
1983 $('limit_lan_peers_checkbox').setProperty('checked', pref.limit_lan_peers);
1985 // Scheduling
1986 $('limitSchedulingCheckbox').setProperty('checked', pref.scheduler_enabled);
1987 $('schedule_from_hour').setProperty('value', time_padding(pref.schedule_from_hour));
1988 $('schedule_from_min').setProperty('value', time_padding(pref.schedule_from_min));
1989 $('schedule_to_hour').setProperty('value', time_padding(pref.schedule_to_hour));
1990 $('schedule_to_min').setProperty('value', time_padding(pref.schedule_to_min));
1991 $('schedule_freq_select').setProperty('value', pref.scheduler_days);
1992 updateSchedulingEnabled();
1994 // Bittorrent tab
1995 // Privacy
1996 $('dht_checkbox').setProperty('checked', pref.dht);
1997 $('pex_checkbox').setProperty('checked', pref.pex);
1998 $('lsd_checkbox').setProperty('checked', pref.lsd);
1999 const encryption = pref.encryption.toInt();
2000 $('encryption_select').getChildren('option')[encryption].setAttribute('selected', '');
2001 $('anonymous_mode_checkbox').setProperty('checked', pref.anonymous_mode);
2003 $('maxActiveCheckingTorrents').setProperty('value', pref.max_active_checking_torrents);
2005 // Torrent Queueing
2006 $('queueing_checkbox').setProperty('checked', pref.queueing_enabled);
2007 $('max_active_dl_value').setProperty('value', pref.max_active_downloads.toInt());
2008 $('max_active_up_value').setProperty('value', pref.max_active_uploads.toInt());
2009 $('max_active_to_value').setProperty('value', pref.max_active_torrents.toInt());
2010 $('dont_count_slow_torrents_checkbox').setProperty('checked', pref.dont_count_slow_torrents);
2011 $('dl_rate_threshold').setProperty('value', pref.slow_torrent_dl_rate_threshold.toInt());
2012 $('ul_rate_threshold').setProperty('value', pref.slow_torrent_ul_rate_threshold.toInt());
2013 $('torrent_inactive_timer').setProperty('value', pref.slow_torrent_inactive_timer.toInt());
2014 updateQueueingSystem();
2016 // Share Limiting
2017 $('max_ratio_checkbox').setProperty('checked', pref.max_ratio_enabled);
2018 $('max_ratio_value').setProperty('value', (pref.max_ratio_enabled ? pref.max_ratio : 1));
2019 $('max_seeding_time_checkbox').setProperty('checked', pref.max_seeding_time_enabled);
2020 $('max_seeding_time_value').setProperty('value', (pref.max_seeding_time_enabled ? pref.max_seeding_time.toInt() : 1440));
2021 let maxRatioAct = 0;
2022 switch (pref.max_ratio_act.toInt()) {
2023 case 0: // Pause
2024 default:
2025 maxRatioAct = 0;
2026 break;
2027 case 1: // Remove
2028 maxRatioAct = 1;
2029 break;
2030 case 2: // Enable super seeding
2031 maxRatioAct = 3;
2032 break;
2033 case 3: // Remove torrent and files
2034 maxRatioAct = 2;
2035 break;
2037 $('max_ratio_act').getChildren('option')[maxRatioAct].setAttribute('selected', '');
2038 updateMaxRatioTimeEnabled();
2040 // Add trackers
2041 $('add_trackers_checkbox').setProperty('checked', pref.add_trackers_enabled);
2042 $('add_trackers_textarea').setProperty('value', pref.add_trackers);
2043 updateAddTrackersEnabled();
2045 // RSS Tab
2046 $('enable_fetching_rss_feeds_checkbox').setProperty('checked', pref.rss_processing_enabled);
2047 $('feed_refresh_interval').setProperty('value', pref.rss_refresh_interval);
2048 $('maximum_article_number').setProperty('value', pref.rss_max_articles_per_feed);
2049 $('enable_auto_downloading_rss_torrents_checkbox').setProperty('checked', pref.rss_auto_downloading_enabled);
2050 $('downlock_repack_proper_episodes').setProperty('checked', pref.rss_download_repack_proper_episodes);
2051 $('rss_filter_textarea').setProperty('value', pref.rss_smart_episode_filters);
2053 // Web UI tab
2054 // Language
2055 updateWebuiLocaleSelect(pref.locale);
2056 $('performanceWarning').setProperty('checked', pref.performance_warning);
2058 // HTTP Server
2059 $('webui_domain_textarea').setProperty('value', pref.web_ui_domain_list);
2060 $('webui_address_value').setProperty('value', pref.web_ui_address);
2061 $('webui_port_value').setProperty('value', pref.web_ui_port);
2062 $('webui_upnp_checkbox').setProperty('checked', pref.web_ui_upnp);
2063 $('use_https_checkbox').setProperty('checked', pref.use_https);
2064 $('ssl_cert_text').setProperty('value', pref.web_ui_https_cert_path);
2065 $('ssl_key_text').setProperty('value', pref.web_ui_https_key_path);
2066 updateHttpsSettings();
2068 // Authentication
2069 $('webui_username_text').setProperty('value', pref.web_ui_username);
2070 $('bypass_local_auth_checkbox').setProperty('checked', pref.bypass_local_auth);
2071 $('bypass_auth_subnet_whitelist_checkbox').setProperty('checked', pref.bypass_auth_subnet_whitelist_enabled);
2072 $('bypass_auth_subnet_whitelist_textarea').setProperty('value', pref.bypass_auth_subnet_whitelist);
2073 updateBypasssAuthSettings();
2074 $('webUIMaxAuthFailCountInput').setProperty('value', pref.web_ui_max_auth_fail_count.toInt());
2075 $('webUIBanDurationInput').setProperty('value', pref.web_ui_ban_duration.toInt());
2076 $('webUISessionTimeoutInput').setProperty('value', pref.web_ui_session_timeout.toInt());
2078 // Use alternative Web UI
2079 $('use_alt_webui_checkbox').setProperty('checked', pref.alternative_webui_enabled);
2080 $('webui_files_location_textarea').setProperty('value', pref.alternative_webui_path);
2081 updateAlternativeWebUISettings();
2083 // Security
2084 $('clickjacking_protection_checkbox').setProperty('checked', pref.web_ui_clickjacking_protection_enabled);
2085 $('csrf_protection_checkbox').setProperty('checked', pref.web_ui_csrf_protection_enabled);
2086 $('secureCookieCheckbox').setProperty('checked', pref.web_ui_secure_cookie_enabled);
2087 $('host_header_validation_checkbox').setProperty('checked', pref.web_ui_host_header_validation_enabled);
2088 updateHostHeaderValidationSettings();
2090 // Custom HTTP headers
2091 $('webUIUseCustomHTTPHeadersCheckbox').setProperty('checked', pref.web_ui_use_custom_http_headers_enabled);
2092 $('webUICustomHTTPHeadersTextarea').setProperty('value', pref.web_ui_custom_http_headers);
2093 updateWebUICustomHTTPHeadersSettings();
2095 // Reverse Proxy
2096 $('webUIReverseProxySupportCheckbox').setProperty('checked', pref.web_ui_reverse_proxy_enabled);
2097 $('webUIReverseProxiesListTextarea').setProperty('value', pref.web_ui_reverse_proxies_list);
2098 updateWebUIReverseProxySettings();
2100 // Update my dynamic domain name
2101 $('use_dyndns_checkbox').setProperty('checked', pref.dyndns_enabled);
2102 $('dyndns_select').setProperty('value', pref.dyndns_service);
2103 $('dyndns_domain_text').setProperty('value', pref.dyndns_domain);
2104 $('dyndns_username_text').setProperty('value', pref.dyndns_username);
2105 $('dyndns_password_text').setProperty('value', pref.dyndns_password);
2106 updateDynDnsSettings();
2108 // Advanced settings
2109 // qBittorrent section
2110 $('resumeDataStorageType').setProperty('value', pref.resume_data_storage_type);
2111 $('memoryWorkingSetLimit').setProperty('value', pref.memory_working_set_limit);
2112 updateNetworkInterfaces(pref.current_network_interface);
2113 updateInterfaceAddresses(pref.current_network_interface, pref.current_interface_address);
2114 $('saveResumeDataInterval').setProperty('value', pref.save_resume_data_interval);
2115 $('recheckTorrentsOnCompletion').setProperty('checked', pref.recheck_completed_torrents);
2116 $('refreshInterval').setProperty('value', pref.refresh_interval);
2117 $('resolvePeerCountries').setProperty('checked', pref.resolve_peer_countries);
2118 $('reannounceWhenAddressChanged').setProperty('checked', pref.reannounce_when_address_changed);
2119 // libtorrent section
2120 $('asyncIOThreads').setProperty('value', pref.async_io_threads);
2121 $('hashingThreads').setProperty('value', pref.hashing_threads);
2122 $('filePoolSize').setProperty('value', pref.file_pool_size);
2123 $('outstandMemoryWhenCheckingTorrents').setProperty('value', pref.checking_memory_use);
2124 $('diskCache').setProperty('value', pref.disk_cache);
2125 $('diskCacheExpiryInterval').setProperty('value', pref.disk_cache_ttl);
2126 $('diskQueueSize').setProperty('value', (pref.disk_queue_size / 1024));
2127 $('diskIOType').setProperty('value', pref.disk_io_type);
2128 $('diskIOReadMode').setProperty('value', pref.disk_io_read_mode);
2129 $('diskIOWriteMode').setProperty('value', pref.disk_io_write_mode);
2130 $('coalesceReadsAndWrites').setProperty('checked', pref.enable_coalesce_read_write);
2131 $('pieceExtentAffinity').setProperty('checked', pref.enable_piece_extent_affinity);
2132 $('sendUploadPieceSuggestions').setProperty('checked', pref.enable_upload_suggestions);
2133 $('sendBufferWatermark').setProperty('value', pref.send_buffer_watermark);
2134 $('sendBufferLowWatermark').setProperty('value', pref.send_buffer_low_watermark);
2135 $('sendBufferWatermarkFactor').setProperty('value', pref.send_buffer_watermark_factor);
2136 $('connectionSpeed').setProperty('value', pref.connection_speed);
2137 $('socketBacklogSize').setProperty('value', pref.socket_backlog_size);
2138 $('outgoingPortsMin').setProperty('value', pref.outgoing_ports_min);
2139 $('outgoingPortsMax').setProperty('value', pref.outgoing_ports_max);
2140 $('UPnPLeaseDuration').setProperty('value', pref.upnp_lease_duration);
2141 $('peerToS').setProperty('value', pref.peer_tos);
2142 $('utpTCPMixedModeAlgorithm').setProperty('value', pref.utp_tcp_mixed_mode);
2143 $('IDNSupportCheckbox').setProperty('checked', pref.idn_support_enabled);
2144 $('allowMultipleConnectionsFromTheSameIPAddress').setProperty('checked', pref.enable_multi_connections_from_same_ip);
2145 $('validateHTTPSTrackerCertificate').setProperty('checked', pref.validate_https_tracker_certificate);
2146 $('mitigateSSRF').setProperty('checked', pref.ssrf_mitigation);
2147 $('blockPeersOnPrivilegedPorts').setProperty('checked', pref.block_peers_on_privileged_ports);
2148 $('enableEmbeddedTracker').setProperty('checked', pref.enable_embedded_tracker);
2149 $('embeddedTrackerPort').setProperty('value', pref.embedded_tracker_port);
2150 $('embeddedTrackerPortForwarding').setProperty('checked', pref.embedded_tracker_port_forwarding);
2151 $('uploadSlotsBehavior').setProperty('value', pref.upload_slots_behavior);
2152 $('uploadChokingAlgorithm').setProperty('value', pref.upload_choking_algorithm);
2153 $('announceAllTrackers').setProperty('checked', pref.announce_to_all_trackers);
2154 $('announceAllTiers').setProperty('checked', pref.announce_to_all_tiers);
2155 $('announceIP').setProperty('value', pref.announce_ip);
2156 $('maxConcurrentHTTPAnnounces').setProperty('value', pref.max_concurrent_http_announces);
2157 $('stopTrackerTimeout').setProperty('value', pref.stop_tracker_timeout);
2158 $('peerTurnover').setProperty('value', pref.peer_turnover);
2159 $('peerTurnoverCutoff').setProperty('value', pref.peer_turnover_cutoff);
2160 $('peerTurnoverInterval').setProperty('value', pref.peer_turnover_interval);
2161 $('requestQueueSize').setProperty('value', pref.request_queue_size);
2164 }).send();
2167 const applyPreferences = function() {
2168 const settings = new Hash();
2169 // Validate form data
2171 // Behavior tab
2172 settings.set('file_log_enabled', $('filelog_checkbox').getProperty('checked'));
2173 settings.set('file_log_path', $('filelog_save_path_input').getProperty('value'));
2174 settings.set('file_log_backup_enabled', $('filelog_backup_checkbox').getProperty('checked'));
2175 settings.set('file_log_max_size', $('filelog_max_size_input').getProperty('value'));
2176 settings.set('file_log_delete_old', $('filelog_delete_old_checkbox').getProperty('checked'));
2177 settings.set('file_log_age', $('filelog_age_input').getProperty('value'));
2178 settings.set('file_log_age_type', $('filelog_age_type_select').getProperty('value'));
2180 // Downloads tab
2181 // When adding a torrent
2182 settings.set('torrent_content_layout', $('contentlayout_select').getSelected()[0].getProperty('value'));
2183 settings.set('start_paused_enabled', $('dontstartdownloads_checkbox').getProperty('checked'));
2184 settings.set('torrent_stop_condition', $('stopConditionSelect').getSelected()[0].getProperty('value'));
2185 settings.set('auto_delete_mode', $('deletetorrentfileafter_checkbox').getProperty('checked'));
2187 settings.set('preallocate_all', $('preallocateall_checkbox').getProperty('checked'));
2188 settings.set('incomplete_files_ext', $('appendext_checkbox').getProperty('checked'));
2190 // Saving Management
2191 settings.set('auto_tmm_enabled', $('default_tmm_combobox').getProperty('value'));
2192 settings.set('torrent_changed_tmm_enabled', $('torrent_changed_tmm_combobox').getProperty('value'));
2193 settings.set('save_path_changed_tmm_enabled', $('save_path_changed_tmm_combobox').getProperty('value'));
2194 settings.set('category_changed_tmm_enabled', $('category_changed_tmm_combobox').getProperty('value'));
2195 settings.set('save_path', $('savepath_text').getProperty('value'));
2196 settings.set('temp_path_enabled', $('temppath_checkbox').getProperty('checked'));
2197 settings.set('temp_path', $('temppath_text').getProperty('value'));
2198 if ($('exportdir_checkbox').getProperty('checked'))
2199 settings.set('export_dir', $('exportdir_text').getProperty('value'));
2200 else
2201 settings.set('export_dir', '');
2202 if ($('exportdirfin_checkbox').getProperty('checked'))
2203 settings.set('export_dir_fin', $('exportdirfin_text').getProperty('value'));
2204 else
2205 settings.set('export_dir_fin', '');
2207 // Automatically add torrents from
2208 settings.set('scan_dirs', getWatchedFolders());
2210 // Excluded file names
2211 settings.set('excluded_file_names_enabled', $('excludedFileNamesCheckbox').getProperty('checked'));
2212 settings.set('excluded_file_names', $('excludedFileNamesTextarea').getProperty('value'));
2214 // Email notification upon download completion
2215 settings.set('mail_notification_enabled', $('mail_notification_checkbox').getProperty('checked'));
2216 settings.set('mail_notification_sender', $('src_email_txt').getProperty('value'));
2217 settings.set('mail_notification_email', $('dest_email_txt').getProperty('value'));
2218 settings.set('mail_notification_smtp', $('smtp_server_txt').getProperty('value'));
2219 settings.set('mail_notification_ssl_enabled', $('mail_ssl_checkbox').getProperty('checked'));
2220 settings.set('mail_notification_auth_enabled', $('mail_auth_checkbox').getProperty('checked'));
2221 settings.set('mail_notification_username', $('mail_username_text').getProperty('value'));
2222 settings.set('mail_notification_password', $('mail_password_text').getProperty('value'));
2224 // Run an external program on torrent added
2225 settings.set('autorun_on_torrent_added_enabled', $('autorunOnTorrentAddedCheckbox').getProperty('checked'));
2226 settings.set('autorun_on_torrent_added_program', $('autorunOnTorrentAddedProgram').getProperty('value'));
2227 // Run an external program on torrent finished
2228 settings.set('autorun_enabled', $('autorun_checkbox').getProperty('checked'));
2229 settings.set('autorun_program', $('autorunProg_txt').getProperty('value'));
2231 // Connection tab
2232 // Listening Port
2233 const listen_port = $('port_value').getProperty('value').toInt();
2234 if (isNaN(listen_port) || (listen_port < 0) || (listen_port > 65535)) {
2235 alert("QBT_TR(The port used for incoming connections must be between 0 and 65535.)QBT_TR[CONTEXT=HttpServer]");
2236 return;
2238 settings.set('listen_port', listen_port);
2239 settings.set('upnp', $('upnp_checkbox').getProperty('checked'));
2241 // Connections Limits
2242 let max_connec = -1;
2243 if ($('max_connec_checkbox').getProperty('checked')) {
2244 max_connec = $('max_connec_value').getProperty('value').toInt();
2245 if (isNaN(max_connec) || max_connec <= 0) {
2246 alert("QBT_TR(Maximum number of connections limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2247 return;
2250 settings.set('max_connec', max_connec);
2251 let max_connec_per_torrent = -1;
2252 if ($('max_connec_per_torrent_checkbox').getProperty('checked')) {
2253 max_connec_per_torrent = $('max_connec_per_torrent_value').getProperty('value').toInt();
2254 if (isNaN(max_connec_per_torrent) || max_connec_per_torrent <= 0) {
2255 alert("QBT_TR(Maximum number of connections per torrent limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2256 return;
2259 settings.set('max_connec_per_torrent', max_connec_per_torrent);
2260 let max_uploads = -1;
2261 if ($('max_uploads_checkbox').getProperty('checked')) {
2262 max_uploads = $('max_uploads_value').getProperty('value').toInt();
2263 if (isNaN(max_uploads) || max_uploads <= 0) {
2264 alert("QBT_TR(Global number of upload slots limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2265 return;
2268 settings.set('max_uploads', max_uploads);
2269 let max_uploads_per_torrent = -1;
2270 if ($('max_uploads_per_torrent_checkbox').getProperty('checked')) {
2271 max_uploads_per_torrent = $('max_uploads_per_torrent_value').getProperty('value').toInt();
2272 if (isNaN(max_uploads_per_torrent) || max_uploads_per_torrent <= 0) {
2273 alert("QBT_TR(Maximum number of upload slots per torrent limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2274 return;
2277 settings.set('max_uploads_per_torrent', max_uploads_per_torrent);
2279 // Proxy Server
2280 settings.set('proxy_type', $('peer_proxy_type_select').getProperty('value'));
2281 settings.set('proxy_ip', $('peer_proxy_host_text').getProperty('value'));
2282 settings.set('proxy_port', $('peer_proxy_port_value').getProperty('value').toInt());
2283 settings.set('proxy_auth_enabled', $('peer_proxy_auth_checkbox').getProperty('checked'));
2284 settings.set('proxy_username', $('peer_proxy_username_text').getProperty('value'));
2285 settings.set('proxy_password', $('peer_proxy_password_text').getProperty('value'));
2286 settings.set('proxy_bittorrent', $('proxy_bittorrent_checkbox').getProperty('checked'));
2287 settings.set('proxy_peer_connections', $('use_peer_proxy_checkbox').getProperty('checked'));
2288 settings.set('proxy_hostname_lookup', $('proxyHostnameLookupCheckbox').getProperty('checked'));
2289 settings.set('proxy_rss', $('proxy_rss_checkbox').getProperty('checked'));
2290 settings.set('proxy_misc', $('proxy_misc_checkbox').getProperty('checked'));
2292 // IP Filtering
2293 settings.set('ip_filter_enabled', $('ipfilter_text_checkbox').getProperty('checked'));
2294 settings.set('ip_filter_path', $('ipfilter_text').getProperty('value'));
2295 settings.set('ip_filter_trackers', $('ipfilter_trackers_checkbox').getProperty('checked'));
2296 settings.set('banned_IPs', $('banned_IPs_textarea').getProperty('value'));
2298 // Speed tab
2299 // Global Rate Limits
2300 const up_limit = $('up_limit_value').getProperty('value').toInt() * 1024;
2301 if (isNaN(up_limit) || up_limit < 0) {
2302 alert("QBT_TR(Global upload rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2303 return;
2305 settings.set('up_limit', up_limit);
2307 const dl_limit = $('dl_limit_value').getProperty('value').toInt() * 1024;
2308 if (isNaN(dl_limit) || dl_limit < 0) {
2309 alert("QBT_TR(Global download rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2310 return;
2312 settings.set('dl_limit', dl_limit);
2314 // Alternative Global Rate Limits
2315 const alt_up_limit = $('alt_up_limit_value').getProperty('value').toInt() * 1024;
2316 if (isNaN(alt_up_limit) || alt_up_limit < 0) {
2317 alert("QBT_TR(Alternative upload rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2318 return;
2320 settings.set('alt_up_limit', alt_up_limit);
2322 const alt_dl_limit = $('alt_dl_limit_value').getProperty('value').toInt() * 1024;
2323 if (isNaN(alt_dl_limit) || alt_dl_limit < 0) {
2324 alert("QBT_TR(Alternative download rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2325 return;
2327 settings.set('alt_dl_limit', alt_dl_limit);
2329 settings.set('bittorrent_protocol', $('enable_protocol_combobox').getProperty('value'));
2330 settings.set('limit_utp_rate', $('limit_utp_rate_checkbox').getProperty('checked'));
2331 settings.set('limit_tcp_overhead', $('limit_tcp_overhead_checkbox').getProperty('checked'));
2332 settings.set('limit_lan_peers', $('limit_lan_peers_checkbox').getProperty('checked'));
2334 // Scheduler
2335 const scheduling_enabled = $('limitSchedulingCheckbox').getProperty('checked');
2336 settings.set('scheduler_enabled', scheduling_enabled);
2337 if (scheduling_enabled) {
2338 settings.set('schedule_from_hour', $('schedule_from_hour').getProperty('value').toInt());
2339 settings.set('schedule_from_min', $('schedule_from_min').getProperty('value').toInt());
2340 settings.set('schedule_to_hour', $('schedule_to_hour').getProperty('value').toInt());
2341 settings.set('schedule_to_min', $('schedule_to_min').getProperty('value').toInt());
2342 settings.set('scheduler_days', $('schedule_freq_select').getProperty('value').toInt());
2345 // Bittorrent tab
2346 // Privacy
2347 settings.set('dht', $('dht_checkbox').getProperty('checked'));
2348 settings.set('pex', $('pex_checkbox').getProperty('checked'));
2349 settings.set('lsd', $('lsd_checkbox').getProperty('checked'));
2350 settings.set('encryption', $('encryption_select').getSelected()[0].getProperty('value'));
2351 settings.set('anonymous_mode', $('anonymous_mode_checkbox').getProperty('checked'));
2353 settings.set('max_active_checking_torrents', $('maxActiveCheckingTorrents').getProperty('value'));
2355 // Torrent Queueing
2356 settings.set('queueing_enabled', $('queueing_checkbox').getProperty('checked'));
2357 if ($('queueing_checkbox').getProperty('checked')) {
2358 const max_active_downloads = $('max_active_dl_value').getProperty('value').toInt();
2359 if (isNaN(max_active_downloads) || max_active_downloads < -1) {
2360 alert("QBT_TR(Maximum active downloads must be greater than -1.)QBT_TR[CONTEXT=HttpServer]");
2361 return;
2363 settings.set('max_active_downloads', max_active_downloads);
2364 const max_active_uploads = $('max_active_up_value').getProperty('value').toInt();
2365 if (isNaN(max_active_uploads) || max_active_uploads < -1) {
2366 alert("QBT_TR(Maximum active uploads must be greater than -1.)QBT_TR[CONTEXT=HttpServer]");
2367 return;
2369 settings.set('max_active_uploads', max_active_uploads);
2370 const max_active_torrents = $('max_active_to_value').getProperty('value').toInt();
2371 if (isNaN(max_active_torrents) || max_active_torrents < -1) {
2372 alert("QBT_TR(Maximum active torrents must be greater than -1.)QBT_TR[CONTEXT=HttpServer]");
2373 return;
2375 settings.set('max_active_torrents', max_active_torrents);
2376 settings.set('dont_count_slow_torrents', $('dont_count_slow_torrents_checkbox').getProperty('checked'));
2377 const dl_rate_threshold = $('dl_rate_threshold').getProperty('value').toInt();
2378 if (isNaN(dl_rate_threshold) || (dl_rate_threshold < 1)) {
2379 alert("QBT_TR(Download rate threshold must be greater than 0.)QBT_TR[CONTEXT=HttpServer]");
2380 return;
2382 settings.set('slow_torrent_dl_rate_threshold', dl_rate_threshold);
2383 const ul_rate_threshold = $('ul_rate_threshold').getProperty('value').toInt();
2384 if (isNaN(ul_rate_threshold) || (ul_rate_threshold < 1)) {
2385 alert("QBT_TR(Upload rate threshold must be greater than 0.)QBT_TR[CONTEXT=HttpServer]");
2386 return;
2388 settings.set('slow_torrent_ul_rate_threshold', ul_rate_threshold);
2389 const torrent_inactive_timer = $('torrent_inactive_timer').getProperty('value').toInt();
2390 if (isNaN(torrent_inactive_timer) || (torrent_inactive_timer < 1)) {
2391 alert("QBT_TR(Torrent inactivity timer must be greater than 0.)QBT_TR[CONTEXT=HttpServer]");
2392 return;
2394 settings.set('slow_torrent_inactive_timer', torrent_inactive_timer);
2397 // Share Ratio Limiting
2398 let max_ratio = -1;
2399 if ($('max_ratio_checkbox').getProperty('checked')) {
2400 max_ratio = $('max_ratio_value').getProperty('value').toFloat();
2401 if (isNaN(max_ratio) || (max_ratio < 0) || (max_ratio > 9998)) {
2402 alert("QBT_TR(Share ratio limit must be between 0 and 9998.)QBT_TR[CONTEXT=HttpServer]");
2403 return;
2406 settings.set('max_ratio_enabled', $('max_ratio_checkbox').getProperty('checked'));
2407 settings.set('max_ratio', max_ratio);
2409 let max_seeding_time = -1;
2410 if ($('max_seeding_time_checkbox').getProperty('checked')) {
2411 max_seeding_time = $('max_seeding_time_value').getProperty('value').toInt();
2412 if (isNaN(max_seeding_time) || (max_seeding_time < 0) || (max_seeding_time > 525600)) {
2413 alert("QBT_TR(Seeding time limit must be between 0 and 525600 minutes.)QBT_TR[CONTEXT=HttpServer]");
2414 return;
2417 settings.set('max_seeding_time_enabled', $('max_seeding_time_checkbox').getProperty('checked'));
2418 settings.set('max_seeding_time', max_seeding_time);
2419 settings.set('max_ratio_act', $('max_ratio_act').getProperty('value').toInt());
2421 // Add trackers
2422 settings.set('add_trackers_enabled', $('add_trackers_checkbox').getProperty('checked'));
2423 settings.set('add_trackers', $('add_trackers_textarea').getProperty('value'));
2425 // RSS Tab
2426 settings.set('rss_processing_enabled', $('enable_fetching_rss_feeds_checkbox').getProperty('checked'));
2427 settings.set('rss_refresh_interval', $('feed_refresh_interval').getProperty('value'));
2428 settings.set('rss_max_articles_per_feed', $('maximum_article_number').getProperty('value'));
2429 settings.set('rss_auto_downloading_enabled', $('enable_auto_downloading_rss_torrents_checkbox').getProperty('checked'));
2430 settings.set('rss_download_repack_proper_episodes', $('downlock_repack_proper_episodes').getProperty('checked'));
2431 settings.set('rss_smart_episode_filters', $('rss_filter_textarea').getProperty('value'));
2433 // Web UI tab
2434 // Language
2435 settings.set('locale', $('locale_select').getProperty('value'));
2436 settings.set('performance_warning', $('performanceWarning').getProperty('checked'));
2438 // HTTP Server
2439 settings.set('web_ui_domain_list', $('webui_domain_textarea').getProperty('value'));
2440 const web_ui_address = $('webui_address_value').getProperty('value').toString();
2441 const web_ui_port = $('webui_port_value').getProperty('value').toInt();
2442 if (isNaN(web_ui_port) || web_ui_port < 1 || web_ui_port > 65535) {
2443 alert("QBT_TR(The port used for the Web UI must be between 1 and 65535.)QBT_TR[CONTEXT=HttpServer]");
2444 return;
2446 settings.set('web_ui_address', web_ui_address);
2447 settings.set('web_ui_port', web_ui_port);
2448 settings.set('web_ui_upnp', $('webui_upnp_checkbox').getProperty('checked'));
2450 const useHTTPS = $('use_https_checkbox').getProperty('checked');
2451 settings.set('use_https', useHTTPS);
2453 const httpsCertificate = $('ssl_cert_text').getProperty('value');
2454 settings.set('web_ui_https_cert_path', httpsCertificate);
2455 if (useHTTPS && (httpsCertificate.length === 0)) {
2456 alert("QBT_TR(HTTPS certificate should not be empty)QBT_TR[CONTEXT=OptionsDialog]");
2457 return;
2460 const httpsKey = $('ssl_key_text').getProperty('value');
2461 settings.set('web_ui_https_key_path', httpsKey);
2462 if (useHTTPS && (httpsKey.length === 0)) {
2463 alert("QBT_TR(HTTPS key should not be empty)QBT_TR[CONTEXT=OptionsDialog]");
2464 return;
2467 // Authentication
2468 const web_ui_username = $('webui_username_text').getProperty('value');
2469 if (web_ui_username.length < 3) {
2470 alert("QBT_TR(The Web UI username must be at least 3 characters long.)QBT_TR[CONTEXT=OptionsDialog]");
2471 return;
2473 const web_ui_password = $('webui_password_text').getProperty('value');
2474 if ((0 < web_ui_password.length) && (web_ui_password.length < 6)) {
2475 alert("QBT_TR(The Web UI password must be at least 6 characters long.)QBT_TR[CONTEXT=OptionsDialog]");
2476 return;
2479 settings.set('web_ui_username', web_ui_username);
2480 if (web_ui_password.length > 0)
2481 settings.set('web_ui_password', web_ui_password);
2482 settings.set('bypass_local_auth', $('bypass_local_auth_checkbox').getProperty('checked'));
2483 settings.set('bypass_auth_subnet_whitelist_enabled', $('bypass_auth_subnet_whitelist_checkbox').getProperty('checked'));
2484 settings.set('bypass_auth_subnet_whitelist', $('bypass_auth_subnet_whitelist_textarea').getProperty('value'));
2485 settings.set('web_ui_max_auth_fail_count', $('webUIMaxAuthFailCountInput').getProperty('value'));
2486 settings.set('web_ui_ban_duration', $('webUIBanDurationInput').getProperty('value'));
2487 settings.set('web_ui_session_timeout', $('webUISessionTimeoutInput').getProperty('value'));
2489 // Use alternative Web UI
2490 const alternative_webui_enabled = $('use_alt_webui_checkbox').getProperty('checked');
2491 const webui_files_location_textarea = $('webui_files_location_textarea').getProperty('value');
2492 if (alternative_webui_enabled && (webui_files_location_textarea.trim() === "")) {
2493 alert("QBT_TR(The alternative Web UI files location cannot be blank.)QBT_TR[CONTEXT=OptionsDialog]");
2494 return;
2496 settings.set('alternative_webui_enabled', alternative_webui_enabled);
2497 settings.set('alternative_webui_path', webui_files_location_textarea);
2499 // Security
2500 settings.set('web_ui_clickjacking_protection_enabled', $('clickjacking_protection_checkbox').getProperty('checked'));
2501 settings.set('web_ui_csrf_protection_enabled', $('csrf_protection_checkbox').getProperty('checked'));
2502 settings.set('web_ui_secure_cookie_enabled', $('secureCookieCheckbox').getProperty('checked'));
2503 settings.set('web_ui_host_header_validation_enabled', $('host_header_validation_checkbox').getProperty('checked'));
2505 // Custom HTTP headers
2506 settings.set('web_ui_use_custom_http_headers_enabled', $('webUIUseCustomHTTPHeadersCheckbox').getProperty('checked'));
2507 settings.set('web_ui_custom_http_headers', $('webUICustomHTTPHeadersTextarea').getProperty('value'));
2509 // Reverse Proxy
2510 settings.set('web_ui_reverse_proxy_enabled', $('webUIReverseProxySupportCheckbox').getProperty('checked'));
2511 settings.set('web_ui_reverse_proxies_list', $('webUIReverseProxiesListTextarea').getProperty('value'));
2513 // Update my dynamic domain name
2514 settings.set('dyndns_enabled', $('use_dyndns_checkbox').getProperty('checked'));
2515 settings.set('dyndns_service', $('dyndns_select').getProperty('value'));
2516 settings.set('dyndns_domain', $('dyndns_domain_text').getProperty('value'));
2517 settings.set('dyndns_username', $('dyndns_username_text').getProperty('value'));
2518 settings.set('dyndns_password', $('dyndns_password_text').getProperty('value'));
2520 // Update advanced settings
2521 // qBittorrent section
2522 settings.set('resume_data_storage_type', $('resumeDataStorageType').getProperty('value'));
2523 settings.set('memory_working_set_limit', $('memoryWorkingSetLimit').getProperty('value'));
2524 settings.set('current_network_interface', $('networkInterface').getProperty('value'));
2525 settings.set('current_interface_address', $('optionalIPAddressToBind').getProperty('value'));
2526 settings.set('save_resume_data_interval', $('saveResumeDataInterval').getProperty('value'));
2527 settings.set('recheck_completed_torrents', $('recheckTorrentsOnCompletion').getProperty('checked'));
2528 settings.set('refresh_interval', $('refreshInterval').getProperty('value'));
2529 settings.set('resolve_peer_countries', $('resolvePeerCountries').getProperty('checked'));
2530 settings.set('reannounce_when_address_changed', $('reannounceWhenAddressChanged').getProperty('checked'));
2532 // libtorrent section
2533 settings.set('async_io_threads', $('asyncIOThreads').getProperty('value'));
2534 settings.set('hashing_threads', $('hashingThreads').getProperty('value'));
2535 settings.set('file_pool_size', $('filePoolSize').getProperty('value'));
2536 settings.set('checking_memory_use', $('outstandMemoryWhenCheckingTorrents').getProperty('value'));
2537 settings.set('disk_cache', $('diskCache').getProperty('value'));
2538 settings.set('disk_cache_ttl', $('diskCacheExpiryInterval').getProperty('value'));
2539 settings.set('disk_queue_size', ($('diskQueueSize').getProperty('value') * 1024));
2540 settings.set('disk_io_type', $('diskIOType').getProperty('value'));
2541 settings.set('disk_io_read_mode', $('diskIOReadMode').getProperty('value'));
2542 settings.set('disk_io_write_mode', $('diskIOWriteMode').getProperty('value'));
2543 settings.set('enable_coalesce_read_write', $('coalesceReadsAndWrites').getProperty('checked'));
2544 settings.set('enable_piece_extent_affinity', $('pieceExtentAffinity').getProperty('checked'));
2545 settings.set('enable_upload_suggestions', $('sendUploadPieceSuggestions').getProperty('checked'));
2546 settings.set('send_buffer_watermark', $('sendBufferWatermark').getProperty('value'));
2547 settings.set('send_buffer_low_watermark', $('sendBufferLowWatermark').getProperty('value'));
2548 settings.set('send_buffer_watermark_factor', $('sendBufferWatermarkFactor').getProperty('value'));
2549 settings.set('connection_speed', $('connectionSpeed').getProperty('value'));
2550 settings.set('socket_backlog_size', $('socketBacklogSize').getProperty('value'));
2551 settings.set('outgoing_ports_min', $('outgoingPortsMin').getProperty('value'));
2552 settings.set('outgoing_ports_max', $('outgoingPortsMax').getProperty('value'));
2553 settings.set('upnp_lease_duration', $('UPnPLeaseDuration').getProperty('value'));
2554 settings.set('peer_tos', $('peerToS').getProperty('value'));
2555 settings.set('utp_tcp_mixed_mode', $('utpTCPMixedModeAlgorithm').getProperty('value'));
2556 settings.set('idn_support_enabled', $('IDNSupportCheckbox').getProperty('checked'));
2557 settings.set('enable_multi_connections_from_same_ip', $('allowMultipleConnectionsFromTheSameIPAddress').getProperty('checked'));
2558 settings.set('validate_https_tracker_certificate', $('validateHTTPSTrackerCertificate').getProperty('checked'));
2559 settings.set('ssrf_mitigation', $('mitigateSSRF').getProperty('checked'));
2560 settings.set('block_peers_on_privileged_ports', $('blockPeersOnPrivilegedPorts').getProperty('checked'));
2561 settings.set('enable_embedded_tracker', $('enableEmbeddedTracker').getProperty('checked'));
2562 settings.set('embedded_tracker_port', $('embeddedTrackerPort').getProperty('value'));
2563 settings.set('embedded_tracker_port_forwarding', $('embeddedTrackerPortForwarding').getProperty('checked'));
2564 settings.set('upload_slots_behavior', $('uploadSlotsBehavior').getProperty('value'));
2565 settings.set('upload_choking_algorithm', $('uploadChokingAlgorithm').getProperty('value'));
2566 settings.set('announce_to_all_trackers', $('announceAllTrackers').getProperty('checked'));
2567 settings.set('announce_to_all_tiers', $('announceAllTiers').getProperty('checked'));
2568 settings.set('announce_ip', $('announceIP').getProperty('value'));
2569 settings.set('max_concurrent_http_announces', $('maxConcurrentHTTPAnnounces').getProperty('value'));
2570 settings.set('stop_tracker_timeout', $('stopTrackerTimeout').getProperty('value'));
2571 settings.set('peer_turnover', $('peerTurnover').getProperty('value'));
2572 settings.set('peer_turnover_cutoff', $('peerTurnoverCutoff').getProperty('value'));
2573 settings.set('peer_turnover_interval', $('peerTurnoverInterval').getProperty('value'));
2574 settings.set('request_queue_size', $('requestQueueSize').getProperty('value'));
2576 // Send it to qBT
2577 const json_str = JSON.encode(settings);
2579 new Request({
2580 url: 'api/v2/app/setPreferences',
2581 method: 'post',
2582 data: {
2583 'json': json_str,
2585 onFailure: function() {
2586 alert("QBT_TR(Unable to save program preferences, qBittorrent is probably unreachable.)QBT_TR[CONTEXT=HttpServer]");
2587 window.parent.closeWindows();
2589 onSuccess: function() {
2590 // Close window
2591 window.parent.location.reload();
2592 window.parent.closeWindows();
2594 }).send();
2597 $('networkInterface').addEvent('change', function() {
2598 updateInterfaceAddresses($(this).getProperty('value'), '');
2601 loadPreferences();
2603 return exports();
2604 })();
2606 Object.freeze(window.qBittorrent.Preferences);
2607 </script>