WebUI: unify curly bracket usage
[qBittorrent.git] / src / webui / www / private / views / preferences.html
blobc01be0ee667ed26b2a62edd143b38f8f8b1620ed
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="addToTopOfQueueCheckbox" />
59 <label for="addToTopOfQueueCheckbox">QBT_TR(Add to top of queue)QBT_TR[CONTEXT=OptionsDialog]</label>
60 </div>
61 <div class="formRow">
62 <input type="checkbox" id="dontstartdownloads_checkbox" />
63 <label for="dontstartdownloads_checkbox">QBT_TR(Do not start the download automatically)QBT_TR[CONTEXT=OptionsDialog]</label>
64 </div>
65 <div class="formRow">
66 <label for="stopConditionSelect">QBT_TR(Torrent stop condition:)QBT_TR[CONTEXT=OptionsDialog]</label>
67 <select id="stopConditionSelect">
68 <option value="None">QBT_TR(None)QBT_TR[CONTEXT=OptionsDialog]</option>
69 <option value="MetadataReceived">QBT_TR(Metadata received)QBT_TR[CONTEXT=OptionsDialog]</option>
70 <option value="FilesChecked">QBT_TR(Files checked)QBT_TR[CONTEXT=OptionsDialog]</option>
71 </select>
72 </div>
73 <div class="formRow">
74 <input type="checkbox" id="deletetorrentfileafter_checkbox" />
75 <label for="deletetorrentfileafter_checkbox">QBT_TR(Delete .torrent files afterwards)QBT_TR[CONTEXT=OptionsDialog]</label>
76 </div>
77 </fieldset>
79 <div class="formRow">
80 <input type="checkbox" id="preallocateall_checkbox" />
81 <label for="preallocateall_checkbox">QBT_TR(Pre-allocate disk space for all files)QBT_TR[CONTEXT=OptionsDialog]</label>
82 </div>
83 <div class="formRow">
84 <span id="appendexttr">
85 <input type="checkbox" id="appendext_checkbox" />
86 <label for="appendext_checkbox">QBT_TR(Append .!qB extension to incomplete files)QBT_TR[CONTEXT=OptionsDialog]</label>
87 </span>
88 </div>
89 <div class="formRow">
90 <span id="unwantedfoldertr">
91 <input type="checkbox" id="unwantedfolder_checkbox" />
92 <label for="unwantedfolder_checkbox">QBT_TR(Keep unselected files in ".unwanted" folder)QBT_TR[CONTEXT=OptionsDialog]</label>
93 </span>
94 </div>
96 <fieldset class="settings">
97 <legend>QBT_TR(Saving Management)QBT_TR[CONTEXT=HttpServer]</legend>
98 <table>
99 <tr>
100 <td>
101 <label>QBT_TR(Default Torrent Management Mode:)QBT_TR[CONTEXT=OptionsDialog]</label>
102 </td>
103 <td>
104 <select id="default_tmm_combobox">
105 <option value="false" selected>QBT_TR(Manual)QBT_TR[CONTEXT=OptionsDialog]</option>
106 <option value="true">QBT_TR(Automatic)QBT_TR[CONTEXT=OptionsDialog]</option>
107 </select>
108 </td>
109 </tr>
110 <tr>
111 <td>
112 <label>QBT_TR(When Torrent Category changed:)QBT_TR[CONTEXT=OptionsDialog]</label>
113 </td>
114 <td>
115 <select id="torrent_changed_tmm_combobox">
116 <option value="true">QBT_TR(Relocate torrent)QBT_TR[CONTEXT=OptionsDialog]</option>
117 <option value="false" selected>QBT_TR(Switch torrent to Manual Mode)QBT_TR[CONTEXT=OptionsDialog]</option>
118 </select>
119 </td>
120 </tr>
121 <tr>
122 <td>
123 <label>QBT_TR(When Default Save Path changed:)QBT_TR[CONTEXT=OptionsDialog]</label>
124 </td>
125 <td>
126 <select id="save_path_changed_tmm_combobox">
127 <option value="true">QBT_TR(Relocate affected torrents)QBT_TR[CONTEXT=OptionsDialog]</option>
128 <option value="false" selected>QBT_TR(Switch affected torrents to Manual Mode)QBT_TR[CONTEXT=OptionsDialog]</option>
129 </select>
130 </td>
131 </tr>
132 <tr>
133 <td>
134 <label>QBT_TR(When Category Save Path changed:)QBT_TR[CONTEXT=OptionsDialog]</label>
135 </td>
136 <td>
137 <select id="category_changed_tmm_combobox">
138 <option value="true">QBT_TR(Relocate affected torrents)QBT_TR[CONTEXT=OptionsDialog]</option>
139 <option value="false" selected>QBT_TR(Switch affected torrents to Manual Mode)QBT_TR[CONTEXT=OptionsDialog]</option>
140 </select>
141 </td>
142 </tr>
143 </table>
144 <div class="formRow">
145 <input type="checkbox" id="use_subcategories_checkbox" />
146 <label for="use_subcategories_checkbox">QBT_TR(Use Subcategories)QBT_TR[CONTEXT=OptionsDialog]</label>
147 </div>
148 <table>
149 <tr>
150 <td>
151 <label for="savepath_text">QBT_TR(Default Save Path:)QBT_TR[CONTEXT=OptionsDialog]</label>
152 </td>
153 <td>
154 <input type="text" id="savepath_text" autocorrect="off" autocapitalize="none" />
155 </td>
156 </tr>
157 <tr>
158 <td>
159 <input type="checkbox" id="temppath_checkbox" onclick="qBittorrent.Preferences.updateTempDirEnabled();" />
160 <label for="temppath_checkbox">QBT_TR(Keep incomplete torrents in:)QBT_TR[CONTEXT=OptionsDialog]</label>
161 </td>
162 <td>
163 <input type="text" id="temppath_text" autocorrect="off" autocapitalize="none" />
164 </td>
165 </tr>
166 <tr>
167 <td>
168 <input type="checkbox" id="exportdir_checkbox" onclick="qBittorrent.Preferences.updateExportDirEnabled();" />
169 <label for="exportdir_checkbox">QBT_TR(Copy .torrent files to:)QBT_TR[CONTEXT=OptionsDialog]</label>
170 </td>
171 <td>
172 <input type="text" id="exportdir_text" autocorrect="off" autocapitalize="none" />
173 </td>
174 </tr>
175 <tr>
176 <td>
177 <input type="checkbox" id="exportdirfin_checkbox" onclick="qBittorrent.Preferences.updateExportDirFinEnabled();" />
178 <label for="exportdirfin_checkbox">QBT_TR(Copy .torrent files for finished downloads to:)QBT_TR[CONTEXT=OptionsDialog]</label>
179 </td>
180 <td>
181 <input type="text" id="exportdirfin_text" autocorrect="off" autocapitalize="none" />
182 </td>
183 </tr>
184 </table>
185 </fieldset>
187 <fieldset class="settings">
188 <legend>QBT_TR(Automatically add torrents from:)QBT_TR[CONTEXT=OptionsDialog]</legend>
189 <table id="watched_folders_tab" style="border: 1px solid black;">
190 <thead>
191 <tr>
192 <th>QBT_TR(Monitored Folder)QBT_TR[CONTEXT=ScanFoldersModel]</th>
193 <th>QBT_TR(Override Save Location)QBT_TR[CONTEXT=ScanFoldersModel]</th>
194 </tr>
195 </thead>
196 <tbody></tbody>
197 </table>
198 </fieldset>
200 <fieldset class="settings">
201 <legend>
202 <input type="checkbox" id="excludedFileNamesCheckbox" onclick="qBittorrent.Preferences.updateExcludedFileNamesEnabled();" />
203 <label for="excludedFileNamesCheckbox">QBT_TR(Excluded file names)QBT_TR[CONTEXT=OptionsDialog]</label>
204 </legend>
205 <textarea id="excludedFileNamesTextarea" rows="6" cols="70"></textarea>
206 </fieldset>
208 <fieldset class="settings">
209 <legend>
210 <input type="checkbox" id="mail_notification_checkbox" onclick="qBittorrent.Preferences.updateMailNotification();" />
211 <label for="mail_notification_checkbox">QBT_TR(Email notification upon download completion)QBT_TR[CONTEXT=OptionsDialog]</label>
212 </legend>
213 <table>
214 <tr>
215 <td>
216 <label for="src_email_txt">QBT_TR(From:)QBT_TR[CONTEXT=OptionsDialog]</label>
217 </td>
218 <td>
219 <input type="text" id="src_email_txt" />
220 </td>
221 </tr>
222 <tr>
223 <td>
224 <label for="dest_email_txt">QBT_TR(To:)QBT_TR[CONTEXT=OptionsDialog]</label>
225 </td>
226 <td>
227 <input type="text" id="dest_email_txt" />
228 </td>
229 </tr>
230 <tr>
231 <td>
232 <label for="smtp_server_txt">QBT_TR(SMTP server:)QBT_TR[CONTEXT=OptionsDialog]</label>
233 </td>
234 <td>
235 <input type="text" id="smtp_server_txt" />
236 </td>
237 </tr>
238 </table>
239 <div class="formRow">
240 <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>
241 </div>
242 <fieldset class="settings">
243 <legend>
244 <input type="checkbox" id="mail_auth_checkbox" onclick="qBittorrent.Preferences.updateMailAuthSettings();" />
245 <label for="mail_auth_checkbox">QBT_TR(Authentication)QBT_TR[CONTEXT=OptionsDialog]</label>
246 </legend>
247 <table>
248 <tr>
249 <td>
250 <label for="mail_username_text">QBT_TR(Username:)QBT_TR[CONTEXT=OptionsDialog]</label>
251 </td>
252 <td>
253 <input type="text" id="mail_username_text" />
254 </td>
255 </tr>
256 <tr>
257 <td>
258 <label for="mail_password_text">QBT_TR(Password:)QBT_TR[CONTEXT=OptionsDialog]</label>
259 </td>
260 <td>
261 <input type="password" id="mail_password_text" />
262 </td>
263 </tr>
264 </table>
265 </fieldset>
266 <div class="formRow">
267 <input type="button" id="mail_test_button" value="QBT_TR(Send test email)QBT_TR[CONTEXT=OptionsDialog]" onclick="qBittorrent.Preferences.sendTestEmail();" />
268 </div>
269 </fieldset>
271 <fieldset class="settings">
272 <legend>
273 QBT_TR(Run external program)QBT_TR[CONTEXT=OptionsDialog]
274 </legend>
275 <div class="formRow">
276 <input type="checkbox" id="autorunOnTorrentAddedCheckbox" onclick="qBittorrent.Preferences.updateAutoRunOnTorrentAdded();" />
277 <label for="autorunOnTorrentAddedCheckbox">QBT_TR(Run external program on torrent added)QBT_TR[CONTEXT=OptionsDialog]</label>
278 <input type="text" id="autorunOnTorrentAddedProgram" style="width: 400px;" />
279 </div>
280 <div class="formRow">
281 <input type="checkbox" id="autorun_checkbox" onclick="qBittorrent.Preferences.updateAutoRun();" />
282 <label for="autorun_checkbox">QBT_TR(Run external program on torrent finished)QBT_TR[CONTEXT=OptionsDialog]</label>
283 <input type="text" id="autorunProg_txt" style="width: 400px;" />
284 </div>
285 <div style="font-style: italic;">QBT_TR(Supported parameters (case sensitive):)QBT_TR[CONTEXT=OptionsDialog]
286 <ul>
287 <li>QBT_TR(%N: Torrent name)QBT_TR[CONTEXT=OptionsDialog]</li>
288 <li>QBT_TR(%L: Category)QBT_TR[CONTEXT=OptionsDialog]</li>
289 <li>QBT_TR(%G: Tags (separated by comma))QBT_TR[CONTEXT=OptionsDialog]</li>
290 <li>QBT_TR(%F: Content path (same as root path for multifile torrent))QBT_TR[CONTEXT=OptionsDialog]</li>
291 <li>QBT_TR(%R: Root path (first torrent subdirectory path))QBT_TR[CONTEXT=OptionsDialog]</li>
292 <li>QBT_TR(%D: Save path)QBT_TR[CONTEXT=OptionsDialog]</li>
293 <li>QBT_TR(%C: Number of files)QBT_TR[CONTEXT=OptionsDialog]</li>
294 <li>QBT_TR(%Z: Torrent size (bytes))QBT_TR[CONTEXT=OptionsDialog]</li>
295 <li>QBT_TR(%T: Current tracker)QBT_TR[CONTEXT=OptionsDialog]</li>
296 <li>QBT_TR(%I: Info hash v1)QBT_TR[CONTEXT=OptionsDialog]</li>
297 <li>QBT_TR(%J: Info hash v2)QBT_TR[CONTEXT=OptionsDialog]</li>
298 <li>QBT_TR(%K: Torrent ID)QBT_TR[CONTEXT=OptionsDialog]</li>
299 </ul>
300 QBT_TR(Tip: Encapsulate parameter with quotation marks to avoid text being cut off at whitespace (e.g., "%N"))QBT_TR[CONTEXT=OptionsDialog]
301 </div>
302 </fieldset>
303 </div>
305 <div id="ConnectionTab" class="PrefTab invisible">
306 <div class="formRow">
307 <label>QBT_TR(Peer connection protocol:)QBT_TR[CONTEXT=OptionsDialog]</label>
308 <select id="enable_protocol_combobox">
309 <option value="0" selected>QBT_TR(TCP and μTP)QBT_TR[CONTEXT=OptionsDialog]</option>
310 <option value="1">TCP</option>
311 <option value="2">μTP</option>
312 </select>
313 </div>
314 <fieldset class="settings">
315 <legend>QBT_TR(Listening Port)QBT_TR[CONTEXT=OptionsDialog]</legend>
316 <div class="formRow">
317 <label for="port_value">QBT_TR(Port used for incoming connections:)QBT_TR[CONTEXT=OptionsDialog]</label>
318 <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]" />
319 <button type="button" style="margin-left: 1em;" onclick="qBittorrent.Preferences.generateRandomPort();">QBT_TR(Random)QBT_TR[CONTEXT=OptionsDialog]</button>
320 </div>
321 <div class="formRow">
322 <input type="checkbox" id="upnp_checkbox" />
323 <label for="upnp_checkbox">QBT_TR(Use UPnP / NAT-PMP port forwarding from my router)QBT_TR[CONTEXT=OptionsDialog]</label>
324 </div>
325 </fieldset>
327 <fieldset class="settings">
328 <legend>QBT_TR(Connections Limits)QBT_TR[CONTEXT=OptionsDialog]</legend>
329 <table>
330 <tr>
331 <td>
332 <input type="checkbox" id="max_connec_checkbox" onclick="qBittorrent.Preferences.updateMaxConnecEnabled();" />
333 <label for="max_connec_checkbox">QBT_TR(Global maximum number of connections:)QBT_TR[CONTEXT=OptionsDialog]</label>
334 </td>
335 <td><input type="text" id="max_connec_value" style="width: 4em;" /></td>
336 </tr>
337 <tr>
338 <td>
339 <input type="checkbox" id="max_connec_per_torrent_checkbox" onclick="qBittorrent.Preferences.updateMaxConnecPerTorrentEnabled();" />
340 <label for="max_connec_per_torrent_checkbox">QBT_TR(Maximum number of connections per torrent:)QBT_TR[CONTEXT=OptionsDialog]</label>
341 </td>
342 <td><input type="text" id="max_connec_per_torrent_value" style="width: 4em;" /></td>
343 </tr>
344 <tr>
345 <td>
346 <input type="checkbox" id="max_uploads_checkbox" onclick="qBittorrent.Preferences.updateMaxUploadsEnabled();" />
347 <label for="max_uploads_checkbox">QBT_TR(Global maximum number of upload slots:)QBT_TR[CONTEXT=OptionsDialog]</label>
348 </td>
349 <td><input type="text" id="max_uploads_value" style="width: 4em;" /></td>
350 </tr>
351 <tr>
352 <td>
353 <input type="checkbox" id="max_uploads_per_torrent_checkbox" onclick="qBittorrent.Preferences.updateMaxUploadsPerTorrentEnabled();" />
354 <label for="max_uploads_per_torrent_checkbox">QBT_TR(Maximum number of upload slots per torrent:)QBT_TR[CONTEXT=OptionsDialog]</label>
355 </td>
356 <td><input type="text" id="max_uploads_per_torrent_value" style="width: 4em;" /></td>
357 </tr>
358 </table>
359 </fieldset>
361 <fieldset class="settings" id="fieldsetI2p">
362 <legend>
363 <input type="checkbox" id="i2pEnabledCheckbox" onclick="qBittorrent.Preferences.updateI2PSettingsEnabled();" />
364 <label for="i2pEnabledCheckbox">QBT_TR(I2P (Experimental))QBT_TR[CONTEXT=OptionsDialog]</label>
365 </legend>
366 <table>
367 <tr>
368 <td>
369 <label for="i2pAddress">QBT_TR(Host:)QBT_TR[CONTEXT=OptionsDialog]</label>
370 </td>
371 <td>
372 <input type="text" id="i2pAddress" />
373 </td>
374 <td>
375 <label for="i2pPort">QBT_TR(Port:)QBT_TR[CONTEXT=OptionsDialog]</label>
376 </td>
377 <td>
378 <input type="number" id="i2pPort" min="0" max="65535" onchange="qBittorrent.Preferences.numberInputLimiter(this);" style="width: 5em;" />
379 </td>
380 </tr>
381 </table>
382 <div class="formRow">
383 <input type="checkbox" id="i2pMixedMode" title="QBT_TR(If &quot;mixed mode&quot; is enabled, I2P torrents are allowed to also get peers from other sources than the tracker, and connect to regular IPs, not providing any anonymization. This may be useful if the user is not interested in the anonymization of I2P, but still wants to be able to connect to I2P peers.)QBT_TR[CONTEXT=OptionsDialog]" />
384 <label for="i2pMixedMode">QBT_TR(Mixed mode)QBT_TR[CONTEXT=OptionsDialog]</label>
385 </div>
386 </fieldset>
388 <fieldset class="settings">
389 <legend>QBT_TR(Proxy Server)QBT_TR[CONTEXT=OptionsDialog]</legend>
390 <table>
391 <tr>
392 <td>
393 <label for="peer_proxy_type_select">QBT_TR(Type:)QBT_TR[CONTEXT=OptionsDialog]</label>
394 </td>
395 <td>
396 <select id="peer_proxy_type_select" onchange="qBittorrent.Preferences.updatePeerProxySettings();">
397 <option value="None">QBT_TR((None))QBT_TR[CONTEXT=OptionsDialog]</option>
398 <option value="SOCKS4">QBT_TR(SOCKS4)QBT_TR[CONTEXT=OptionsDialog]</option>
399 <option value="SOCKS5">QBT_TR(SOCKS5)QBT_TR[CONTEXT=OptionsDialog]</option>
400 <option value="HTTP">QBT_TR(HTTP)QBT_TR[CONTEXT=OptionsDialog]</option>
401 </select>
402 </td>
403 <td>
404 <label for="peer_proxy_host_text">QBT_TR(Host:)QBT_TR[CONTEXT=OptionsDialog]</label>
405 </td>
406 <td>
407 <input type="text" id="peer_proxy_host_text" />
408 </td>
409 <td>
410 <label for="peer_proxy_port_value">QBT_TR(Port:)QBT_TR[CONTEXT=OptionsDialog]</label>
411 </td>
412 <td>
413 <input type="text" id="peer_proxy_port_value" style="width: 4em;" />
414 </td>
415 </tr>
416 </table>
418 <div class="formRow">
419 <input type="checkbox" id="proxyHostnameLookupCheckbox" title="QBT_TR(If checked, hostname lookups are done via the proxy.)QBT_TR[CONTEXT=OptionsDialog]" />
420 <label for="proxyHostnameLookupCheckbox">QBT_TR(Perform hostname lookup via proxy)QBT_TR[CONTEXT=OptionsDialog]</label>
421 </div>
423 <fieldset class="settings">
424 <legend>
425 <input type="checkbox" id="peer_proxy_auth_checkbox" onclick="qBittorrent.Preferences.updatePeerProxyAuthSettings();" />
426 <label for="peer_proxy_auth_checkbox">QBT_TR(Authentication)QBT_TR[CONTEXT=OptionsDialog]</label>
427 </legend>
428 <table>
429 <tr>
430 <td>
431 <label for="peer_proxy_username_text">QBT_TR(Username:)QBT_TR[CONTEXT=OptionsDialog]</label>
432 </td>
433 <td>
434 <input type="text" id="peer_proxy_username_text" />
435 </td>
436 </tr>
437 <tr>
438 <td>
439 <label for="peer_proxy_password_text">QBT_TR(Password:)QBT_TR[CONTEXT=OptionsDialog]</label>
440 </td>
441 <td>
442 <input type="password" id="peer_proxy_password_text" />
443 </td>
444 </tr>
445 </table>
446 <div class="formRow">
447 <span>QBT_TR(Info: The password is saved unencrypted)QBT_TR[CONTEXT=OptionsDialog]</span>
448 </div>
449 </fieldset>
451 <fieldset class="settings">
452 <legend>
453 <input type="checkbox" id="proxy_bittorrent_checkbox" onclick="qBittorrent.Preferences.updatePeerProxySettings();" />
454 <label for="proxy_bittorrent_checkbox">QBT_TR(Use proxy for BitTorrent purposes)QBT_TR[CONTEXT=OptionsDialog]</label>
455 </legend>
456 <div class="formRow">
457 <input type="checkbox" id="use_peer_proxy_checkbox" />
458 <label for="use_peer_proxy_checkbox">QBT_TR(Use proxy for peer connections)QBT_TR[CONTEXT=OptionsDialog]</label>
459 </div>
460 </fieldset>
461 <div class="formRow">
462 <input type="checkbox" id="proxy_rss_checkbox" />
463 <label for="proxy_rss_checkbox">QBT_TR(Use proxy for RSS purposes)QBT_TR[CONTEXT=OptionsDialog]</label>
464 </div>
465 <div class="formRow">
466 <input type="checkbox" id="proxy_misc_checkbox" />
467 <label for="proxy_misc_checkbox">QBT_TR(Use proxy for general purposes)QBT_TR[CONTEXT=OptionsDialog]</label>
468 </div>
469 </fieldset>
471 <fieldset class="settings">
472 <legend>
473 <label>QBT_TR(IP Filtering)QBT_TR[CONTEXT=OptionsDialog]</label>
474 </legend>
475 <div class="formRow">
476 <input type="checkbox" id="ipfilter_text_checkbox" onclick="qBittorrent.Preferences.updateFilterSettings();" />
477 <label for="ipfilter_text_checkbox">QBT_TR(Filter path (.dat, .p2p, .p2b):)QBT_TR[CONTEXT=OptionsDialog]</label>
478 <input type="text" id="ipfilter_text" />
479 </div>
480 <div class="formRow">
481 <input type="checkbox" id="ipfilter_trackers_checkbox" />
482 <label for="ipfilter_trackers_checkbox">QBT_TR(Apply to trackers)QBT_TR[CONTEXT=OptionsDialog]</label>
483 </div>
484 <div class="formRow">
485 <fieldset class="settings">
486 <legend>QBT_TR(Manually banned IP addresses...)QBT_TR[CONTEXT=OptionsDialog]</legend>
487 <textarea id="banned_IPs_textarea" rows="5" cols="70"></textarea>
488 </fieldset>
489 </div>
490 </fieldset>
491 </div>
493 <div id="SpeedTab" class="PrefTab invisible">
494 <fieldset class="settings">
495 <legend>QBT_TR(Global Rate Limits)QBT_TR[CONTEXT=OptionsDialog]</legend>
496 <table>
497 <tr>
498 <td rowspan="2">
499 <img src="images/slow_off.svg" style="height: 1.5em;" alt="QBT_TR(Alternative speed limits)QBT_TR[CONTEXT=MainWindow]">
500 </td>
501 <td><label for="up_limit_value">QBT_TR(Upload:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
502 <td><input type="number" id="up_limit_value" style="width: 4em;" min="0" />&nbsp;&nbsp;QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog]</td>
503 </tr>
504 <tr>
505 <td><label for="dl_limit_value">QBT_TR(Download:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
506 <td><input type="number" id="dl_limit_value" style="width: 4em;" min="0" />&nbsp;&nbsp;QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog]</td>
507 </tr>
508 </table>
509 <i>QBT_TR(0 means unlimited)QBT_TR[CONTEXT=OptionsDialog]</i>
510 </fieldset>
512 <fieldset class="settings">
513 <legend>QBT_TR(Alternative Rate Limits)QBT_TR[CONTEXT=OptionsDialog]</legend>
514 <table>
515 <tr>
516 <td rowspan="2">
517 <img src="images/slow.svg" style="height: 1.5em;" alt="QBT_TR(Alternative speed limits)QBT_TR[CONTEXT=MainWindow]">
518 </td>
519 <td><label for="alt_up_limit_value">QBT_TR(Upload:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
520 <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>
521 </tr>
522 <tr>
523 <td><label for="alt_dl_limit_value">QBT_TR(Download:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
524 <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>
525 </tr>
526 </table>
527 <i>QBT_TR(0 means unlimited)QBT_TR[CONTEXT=OptionsDialog]</i>
529 <fieldset class="settings">
530 <legend>
531 <input type="checkbox" id="limitSchedulingCheckbox" onclick="qBittorrent.Preferences.updateSchedulingEnabled();" />
532 <label for="limitSchedulingCheckbox">QBT_TR(Schedule the use of alternative rate limits)QBT_TR[CONTEXT=OptionsDialog]</label>
533 </legend>
534 <div class="formRow">
535 QBT_TR(From:)QBT_TR[CONTEXT=OptionsDialog]
536 <input type="text" id="schedule_from_hour" style="width: 1.5em;" />:<input type="text" id="schedule_from_min" style="width: 1.5em;" />
537 QBT_TR(To:)QBT_TR[CONTEXT=OptionsDialog]
538 <input type="text" id="schedule_to_hour" style="width: 1.5em;" />:<input type="text" id="schedule_to_min" style="width: 1.5em;" />
539 </div>
540 <div class="formRow">
541 QBT_TR(When:)QBT_TR[CONTEXT=OptionsDialog]
542 <select id="schedule_freq_select">
543 <option value="0">QBT_TR(Every day)QBT_TR[CONTEXT=OptionsDialog]</option>
544 <option value="1">QBT_TR(Weekdays)QBT_TR[CONTEXT=OptionsDialog]</option>
545 <option value="2">QBT_TR(Weekends)QBT_TR[CONTEXT=OptionsDialog]</option>
546 <option value="3">QBT_TR(Monday)QBT_TR[CONTEXT=HttpServer]</option>
547 <option value="4">QBT_TR(Tuesday)QBT_TR[CONTEXT=HttpServer]</option>
548 <option value="5">QBT_TR(Wednesday)QBT_TR[CONTEXT=HttpServer]</option>
549 <option value="6">QBT_TR(Thursday)QBT_TR[CONTEXT=HttpServer]</option>
550 <option value="7">QBT_TR(Friday)QBT_TR[CONTEXT=HttpServer]</option>
551 <option value="8">QBT_TR(Saturday)QBT_TR[CONTEXT=HttpServer]</option>
552 <option value="9">QBT_TR(Sunday)QBT_TR[CONTEXT=HttpServer]</option>
553 </select>
554 </div>
555 </fieldset>
556 </fieldset>
558 <fieldset class="settings">
559 <legend>QBT_TR(Rate Limits Settings)QBT_TR[CONTEXT=OptionsDialog]</legend>
560 <div class="formRow">
561 <input type="checkbox" id="limit_utp_rate_checkbox" />
562 <label for="limit_utp_rate_checkbox">QBT_TR(Apply rate limit to µTP protocol)QBT_TR[CONTEXT=OptionsDialog]</label>
563 </div>
564 <div class="formRow">
565 <input type="checkbox" id="limit_tcp_overhead_checkbox" />
566 <label for="limit_tcp_overhead_checkbox">QBT_TR(Apply rate limit to transport overhead)QBT_TR[CONTEXT=OptionsDialog]</label>
567 </div>
568 <div class="formRow">
569 <input type="checkbox" id="limit_lan_peers_checkbox" />
570 <label for="limit_lan_peers_checkbox">QBT_TR(Apply rate limit to peers on LAN)QBT_TR[CONTEXT=OptionsDialog]</label>
571 </div>
572 </fieldset>
573 </div>
575 <div id="BittorrentTab" class="PrefTab invisible">
576 <fieldset class="settings">
577 <legend>QBT_TR(Privacy)QBT_TR[CONTEXT=OptionsDialog]</legend>
578 <div class="formRow">
579 <input type="checkbox" id="dht_checkbox" />
580 <label for="dht_checkbox">QBT_TR(Enable DHT (decentralized network) to find more peers)QBT_TR[CONTEXT=OptionsDialog]</label>
581 </div>
582 <div class="formRow">
583 <input type="checkbox" id="pex_checkbox" />
584 <label for="pex_checkbox">QBT_TR(Enable Peer Exchange (PeX) to find more peers)QBT_TR[CONTEXT=OptionsDialog]</label>
585 </div>
586 <div class="formRow">
587 <input type="checkbox" id="lsd_checkbox" />
588 <label for="lsd_checkbox">QBT_TR(Enable Local Peer Discovery to find more peers)QBT_TR[CONTEXT=OptionsDialog]</label>
589 </div>
590 <div class="formRow">
591 <label for="encryption_select">QBT_TR(Encryption mode:)QBT_TR[CONTEXT=OptionsDialog]</label>
592 <select id="encryption_select">
593 <option value="0">QBT_TR(Allow encryption)QBT_TR[CONTEXT=OptionsDialog]</option>
594 <option value="1">QBT_TR(Require encryption)QBT_TR[CONTEXT=OptionsDialog]</option>
595 <option value="2">QBT_TR(Disable encryption)QBT_TR[CONTEXT=OptionsDialog]</option>
596 </select>
597 </div>
598 <div class="formRow">
599 <input type="checkbox" id="anonymous_mode_checkbox" />
600 <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>
601 </div>
602 </fieldset>
604 <div class="formRow">
605 <label for="maxActiveCheckingTorrents">QBT_TR(Max active checking torrents:)QBT_TR[CONTEXT=OptionsDialog]</label>
606 <input type="number" id="maxActiveCheckingTorrents" style="width: 4em;" min="-1" />
607 </div>
609 <fieldset class="settings">
610 <legend>
611 <input type="checkbox" id="queueing_checkbox" onclick="qBittorrent.Preferences.updateQueueingSystem();" />
612 <label for="queueing_checkbox">QBT_TR(Torrent Queueing)QBT_TR[CONTEXT=OptionsDialog]</label>
613 </legend>
614 <table>
615 <tr>
616 <td>
617 <label for="max_active_dl_value">QBT_TR(Maximum active downloads:)QBT_TR[CONTEXT=OptionsDialog]</label>
618 </td>
619 <td>
620 <input type="text" id="max_active_dl_value" style="width: 4em;" />
621 </td>
622 </tr>
623 <tr>
624 <td>
625 <label for="max_active_up_value">QBT_TR(Maximum active uploads:)QBT_TR[CONTEXT=OptionsDialog]</label>
626 </td>
627 <td>
628 <input type="text" id="max_active_up_value" style="width: 4em;" />
629 </td>
630 </tr>
631 <tr>
632 <td>
633 <label for="max_active_to_value">QBT_TR(Maximum active torrents:)QBT_TR[CONTEXT=OptionsDialog]</label>
634 </td>
635 <td>
636 <input type="text" id="max_active_to_value" style="width: 4em;" />
637 </td>
638 </tr>
639 </table>
640 <fieldset class="settings">
641 <legend>
642 <input type="checkbox" id="dont_count_slow_torrents_checkbox" onclick="qBittorrent.Preferences.updateSlowTorrentsSettings();" />
643 <label for="dont_count_slow_torrents_checkbox">QBT_TR(Do not count slow torrents in these limits)QBT_TR[CONTEXT=OptionsDialog]</label>
644 </legend>
645 <table>
646 <tr>
647 <td>
648 <label for="dl_rate_threshold">QBT_TR(Download rate threshold:)QBT_TR[CONTEXT=OptionsDialog]</label>
649 </td>
650 <td>
651 <input type="text" id="dl_rate_threshold" style="width: 4em;" />&nbsp;&nbsp;QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog]
652 </td>
653 </tr>
654 <tr>
655 <td>
656 <label for="ul_rate_threshold">QBT_TR(Upload rate threshold:)QBT_TR[CONTEXT=OptionsDialog]</label>
657 </td>
658 <td>
659 <input type="text" id="ul_rate_threshold" style="width: 4em;" />&nbsp;&nbsp;QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog]
660 </td>
661 </tr>
662 <tr>
663 <td>
664 <label for="torrent_inactive_timer">QBT_TR(Torrent inactivity timer:)QBT_TR[CONTEXT=OptionsDialog]</label>
665 </td>
666 <td>
667 <input type="text" id="torrent_inactive_timer" style="width: 4em;" />&nbsp;&nbsp;QBT_TR(seconds)QBT_TR[CONTEXT=OptionsDialog]
668 </td>
669 </tr>
670 </table>
671 </fieldset>
672 </fieldset>
674 <fieldset class="settings">
675 <legend>QBT_TR(Seeding Limits)QBT_TR[CONTEXT=OptionsDialog]</legend>
676 <table>
677 <tr>
678 <td>
679 <input type="checkbox" id="max_ratio_checkbox" onclick="qBittorrent.Preferences.updateMaxRatioTimeEnabled();" />
680 <label for="max_ratio_checkbox">QBT_TR(When ratio reaches)QBT_TR[CONTEXT=OptionsDialog]</label>
681 </td>
682 <td>
683 <input type="text" id="max_ratio_value" style="width: 4em;" />
684 </td>
685 </tr>
686 <tr>
687 <td>
688 <input type="checkbox" id="max_seeding_time_checkbox" onclick="qBittorrent.Preferences.updateMaxRatioTimeEnabled();" />
689 <label for="max_seeding_time_checkbox">QBT_TR(When total seeding time reaches)QBT_TR[CONTEXT=OptionsDialog]</label>
690 </td>
691 <td>
692 <input type="text" id="max_seeding_time_value" style="width: 4em;" />QBT_TR(minutes)QBT_TR[CONTEXT=OptionsDialog]
693 </td>
694 </tr>
695 <tr>
696 <td>
697 <input type="checkbox" id="max_inactive_seeding_time_checkbox" onclick="qBittorrent.Preferences.updateMaxRatioTimeEnabled();" />
698 <label for="max_inactive_seeding_time_checkbox">QBT_TR(When inactive seeding time reaches)QBT_TR[CONTEXT=OptionsDialog]</label>
699 </td>
700 <td>
701 <input type="text" id="max_inactive_seeding_time_value" style="width: 4em;" />QBT_TR(minutes)QBT_TR[CONTEXT=OptionsDialog]
702 </td>
703 </tr>
704 <tr>
705 <td style="text-align: right;"><label for="max_ratio_act">QBT_TR(then)QBT_TR[CONTEXT=OptionsDialog]</label></td>
706 <td>
707 <select id="max_ratio_act">
708 <option value="0">QBT_TR(Stop torrent)QBT_TR[CONTEXT=OptionsDialog]</option>
709 <option value="1">QBT_TR(Remove torrent)QBT_TR[CONTEXT=OptionsDialog]</option>
710 <option value="3">QBT_TR(Remove torrent and its files)QBT_TR[CONTEXT=OptionsDialog]</option>
711 <option value="2">QBT_TR(Enable super seeding for torrent)QBT_TR[CONTEXT=OptionsDialog]</option>
712 </select>
713 </td>
714 </tr>
715 </table>
716 </fieldset>
718 <fieldset class="settings">
719 <legend>
720 <input type="checkbox" id="add_trackers_checkbox" onclick="qBittorrent.Preferences.updateAddTrackersEnabled();" />
721 <label for="add_trackers_checkbox">QBT_TR(Automatically append these trackers to new downloads:)QBT_TR[CONTEXT=OptionsDialog]</label>
722 </legend>
723 <textarea id="add_trackers_textarea" rows="5" cols="70"></textarea>
724 </fieldset>
725 </div>
727 <div id="RSSTab" class="PrefTab invisible">
728 <fieldset class="settings">
729 <legend>QBT_TR(RSS Reader)QBT_TR[CONTEXT=OptionsDialog]</legend>
730 <div class="formRow">
731 <input type="checkbox" id="enable_fetching_rss_feeds_checkbox" />
732 <label for="enable_fetching_rss_feeds_checkbox">QBT_TR(Enable fetching RSS feeds)QBT_TR[CONTEXT=OptionsDialog]</label>
733 </div>
734 <table>
735 <tr>
736 <td>
737 <label for="feed_refresh_interval">QBT_TR(Feeds refresh interval:)QBT_TR[CONTEXT=OptionsDialog]</label>
738 </td>
739 <td>
740 <input type="text" id="feed_refresh_interval" style="width: 4em;" />&nbsp;&nbsp;QBT_TR( min)QBT_TR[CONTEXT=OptionsDialog]
741 </td>
742 </tr>
743 <tr>
744 <td>
745 <label for="feedFetchDelay">QBT_TR(Same host request delay:)QBT_TR[CONTEXT=OptionsDialog]</label>
746 </td>
747 <td>
748 <input type="text" id="feedFetchDelay" style="width: 4em;" />&nbsp;&nbsp;QBT_TR( sec)QBT_TR[CONTEXT=OptionsDialog]
749 </td>
750 </tr>
751 <tr>
752 <td>
753 <label for="maximum_article_number">QBT_TR(Maximum number of articles per feed:)QBT_TR[CONTEXT=OptionsDialog]</label>
754 </td>
755 <td>
756 <input type="text" id="maximum_article_number" style="width: 4em;" />
757 </td>
758 </tr>
759 </table>
760 </fieldset>
762 <fieldset class="settings">
763 <legend>QBT_TR(RSS Torrent Auto Downloader)QBT_TR[CONTEXT=OptionsDialog]</legend>
764 <div class="formRow">
765 <input type="checkbox" id="enable_auto_downloading_rss_torrents_checkbox" />
766 <label for="enable_auto_downloading_rss_torrents_checkbox">QBT_TR(Enable auto downloading of RSS torrents)QBT_TR[CONTEXT=OptionsDialog]</label>
767 </div>
768 <button type="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>
769 </fieldset>
771 <fieldset class="settings">
772 <legend>QBT_TR(RSS Smart Episode Filter)QBT_TR[CONTEXT=OptionsDialog]</legend>
773 <div class="formRow">
774 <input type="checkbox" id="downlock_repack_proper_episodes" />
776 <label for="downlock_repack_proper_episodes">QBT_TR(Download REPACK/PROPER episodes)QBT_TR[CONTEXT=OptionsDialog]</label>
777 </div>
778 <label for="rss_filter_textarea">QBT_TR(Filters:)QBT_TR[CONTEXT=OptionsDialog]</label><br>
779 <textarea id="rss_filter_textarea" rows="6" cols="70"></textarea>
780 </fieldset>
781 </div>
783 <div id="WebUITab" class="PrefTab invisible">
784 <fieldset class="settings">
785 <legend>QBT_TR(Web User Interface (Remote control))QBT_TR[CONTEXT=OptionsDialog]</legend>
786 <table>
787 <tr>
788 <td>
789 <label for="webui_address_value">QBT_TR(IP address:)QBT_TR[CONTEXT=OptionsDialog]</label>
790 </td>
791 <td>
792 <input type="text" id="webui_address_value" />
793 <label for="webui_port_value" style="margin-left: 10px;">QBT_TR(Port:)QBT_TR[CONTEXT=OptionsDialog]</label>
794 <input type="text" id="webui_port_value" style="width: 4em;" />
795 </td>
796 </tr>
797 </table>
798 <div class="formRow">
799 <input type="checkbox" id="webui_upnp_checkbox" />
800 <label for="webui_upnp_checkbox">QBT_TR(Use UPnP / NAT-PMP to forward the port from my router)QBT_TR[CONTEXT=OptionsDialog]</label>
801 </div>
802 <fieldset class="settings">
803 <legend>
804 <input type="checkbox" id="use_https_checkbox" onclick="qBittorrent.Preferences.updateHttpsSettings();" />
805 <label for="use_https_checkbox">QBT_TR(Use HTTPS instead of HTTP)QBT_TR[CONTEXT=OptionsDialog]</label>
806 </legend>
807 <table>
808 <tr>
809 <td>
810 <label for="ssl_cert_text">QBT_TR(Certificate:)QBT_TR[CONTEXT=OptionsDialog]</label>
811 </td>
812 <td>
813 <input type="text" id="ssl_cert_text" style="width: 30em;" />
814 </td>
815 </tr>
816 <tr>
817 <td>
818 <label for="ssl_key_text">QBT_TR(Key:)QBT_TR[CONTEXT=OptionsDialog]</label>
819 </td>
820 <td>
821 <input type="text" id="ssl_key_text" style="width: 30em;" />
822 </td>
823 </tr>
824 </table>
825 <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>
826 </fieldset>
828 <fieldset class="settings">
829 <legend>QBT_TR(Authentication)QBT_TR[CONTEXT=OptionsDialog]</legend>
830 <table>
831 <tr>
832 <td>
833 <label for="webui_username_text">QBT_TR(Username:)QBT_TR[CONTEXT=OptionsDialog]</label>
834 </td>
835 <td>
836 <input type="text" id="webui_username_text" />
837 </td>
838 </tr>
839 <tr>
840 <td>
841 <label for="webui_password_text">QBT_TR(Password:)QBT_TR[CONTEXT=OptionsDialog]</label>
842 </td>
843 <td>
844 <input type="password" id="webui_password_text" placeholder="QBT_TR(Change current password)QBT_TR[CONTEXT=OptionsDialog]" autocomplete="new-password" />
845 </td>
846 </tr>
847 </table>
848 <div class="formRow">
849 <input type="checkbox" id="bypass_local_auth_checkbox" />
850 <label for="bypass_local_auth_checkbox">QBT_TR(Bypass authentication for clients on localhost)QBT_TR[CONTEXT=OptionsDialog]</label>
851 </div>
852 <div class="formRow">
853 <input type="checkbox" id="bypass_auth_subnet_whitelist_checkbox" onclick="qBittorrent.Preferences.updateBypasssAuthSettings();" />
854 <label for="bypass_auth_subnet_whitelist_checkbox">QBT_TR(Bypass authentication for clients in whitelisted IP subnets)QBT_TR[CONTEXT=OptionsDialog]</label>
855 </div>
856 <div class="formRow" style="padding-left: 30px; padding-top: 5px;">
857 <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>
858 </div>
859 <table>
860 <tr>
861 <td><label for="webUIMaxAuthFailCountInput">QBT_TR(Ban client after consecutive failures:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
862 <td><input type="number" id="webUIMaxAuthFailCountInput" style="width: 4em;" min="0" /></td>
863 </tr>
864 <tr>
865 <td style="text-align: right;"><label for="webUIBanDurationInput">QBT_TR(ban for:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
866 <td><input type="number" id="webUIBanDurationInput" style="width: 4em;" min="1" />QBT_TR(seconds)QBT_TR[CONTEXT=OptionsDialog]</td>
867 </tr>
868 </table>
869 <table>
870 <tr>
871 <td><label for="webUISessionTimeoutInput">QBT_TR(Session timeout:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
872 <td><input type="number" id="webUISessionTimeoutInput" style="width: 4em;" min="0" />&nbsp;&nbsp;QBT_TR(seconds)QBT_TR[CONTEXT=OptionsDialog]</td>
873 </tr>
874 </table>
875 </fieldset>
877 <fieldset class="settings">
878 <legend><input type="checkbox" id="use_alt_webui_checkbox" onclick="qBittorrent.Preferences.updateAlternativeWebUISettings();" />
879 <label for="use_alt_webui_checkbox">QBT_TR(Use alternative WebUI)QBT_TR[CONTEXT=OptionsDialog]</label>
880 </legend>
881 <div class="formRow">
882 <label for="webui_files_location_textarea">QBT_TR(Files location:)QBT_TR[CONTEXT=OptionsDialog]</label>
883 <input type="text" id="webui_files_location_textarea" />
884 </div>
885 </fieldset>
887 <fieldset class="settings">
888 <legend>QBT_TR(Security)QBT_TR[CONTEXT=OptionsDialog]</legend>
889 <div class="formRow">
890 <input type="checkbox" id="clickjacking_protection_checkbox" />
891 <label for="clickjacking_protection_checkbox">QBT_TR(Enable clickjacking protection)QBT_TR[CONTEXT=OptionsDialog]</label>
892 </div>
893 <div class="formRow">
894 <input type="checkbox" id="csrf_protection_checkbox" />
895 <label for="csrf_protection_checkbox">QBT_TR(Enable Cross-Site Request Forgery (CSRF) protection)QBT_TR[CONTEXT=OptionsDialog]</label>
896 </div>
897 <div class="formRow">
898 <input type="checkbox" id="secureCookieCheckbox" />
899 <label for="secureCookieCheckbox">QBT_TR(Enable cookie Secure flag (requires HTTPS))QBT_TR[CONTEXT=OptionsDialog]</label>
900 </div>
902 <fieldset class="settings">
903 <legend>
904 <input type="checkbox" id="host_header_validation_checkbox" onclick="qBittorrent.Preferences.updateHostHeaderValidationSettings();" />
905 <label for="host_header_validation_checkbox">QBT_TR(Enable Host header validation)QBT_TR[CONTEXT=OptionsDialog]</label>
906 </legend>
907 <table>
908 <tr>
909 <td>
910 <label for="webui_domain_textarea">QBT_TR(Server domains:)QBT_TR[CONTEXT=OptionsDialog]</label>
911 </td>
912 <td>
913 <textarea id="webui_domain_textarea" rows="1" cols="60" title="QBT_TR(Whitelist for filtering HTTP Host header values.
914 In order to defend against DNS rebinding attack,
915 you should put in domain names used by WebUI server.
917 Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsDialog]"></textarea>
918 </td>
919 </tr>
920 </table>
921 </fieldset>
922 </fieldset>
924 <fieldset class="settings">
925 <legend>
926 <input type="checkbox" id="webUIUseCustomHTTPHeadersCheckbox" onclick="qBittorrent.Preferences.updateWebUICustomHTTPHeadersSettings();" />
927 <label for="webUIUseCustomHTTPHeadersCheckbox">QBT_TR(Add custom HTTP headers)QBT_TR[CONTEXT=OptionsDialog]</label>
928 </legend>
929 <textarea id="webUICustomHTTPHeadersTextarea" placeholder="QBT_TR(Header: value pairs, one per line)QBT_TR[CONTEXT=OptionsDialog]" style="width: 90%;"></textarea>
930 </fieldset>
932 <fieldset class="settings">
933 <legend>
934 <input type="checkbox" id="webUIReverseProxySupportCheckbox" onclick="qBittorrent.Preferences.updateWebUIReverseProxySettings();" />
935 <label for="webUIReverseProxySupportCheckbox">QBT_TR(Enable reverse proxy support)QBT_TR[CONTEXT=OptionsDialog]</label>
936 </legend>
937 <div class="formRow">
938 <label for="webUIReverseProxiesListTextarea">QBT_TR(Trusted proxies list:)QBT_TR[CONTEXT=OptionsDialog]</label>
939 <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]" />
940 </div>
941 </fieldset>
943 </fieldset>
945 <fieldset class="settings">
946 <legend>
947 <input type="checkbox" id="use_dyndns_checkbox" onclick="qBittorrent.Preferences.updateDynDnsSettings();" />
948 <label for="use_dyndns_checkbox">QBT_TR(Update my dynamic domain name)QBT_TR[CONTEXT=OptionsDialog]</label>
949 </legend>
950 <select id="dyndns_select">
951 <option value="0">DynDNS</option>
952 <option value="1">NO-IP</option>
953 </select>
954 <input type="button" value="QBT_TR(Register)QBT_TR[CONTEXT=OptionsDialog]" onclick="qBittorrent.Preferences.registerDynDns();" />
955 <table style="margin-top: 10px;">
956 <tr>
957 <td>
958 <label for="dyndns_domain_text">QBT_TR(Domain name:)QBT_TR[CONTEXT=OptionsDialog]</label>
959 </td>
960 <td>
961 <input type="text" id="dyndns_domain_text" />
962 </td>
963 </tr>
964 <tr>
965 <td>
966 <label for="dyndns_username_text">QBT_TR(Username:)QBT_TR[CONTEXT=OptionsDialog]</label>
967 </td>
968 <td>
969 <input type="text" id="dyndns_username_text" />
970 </td>
971 </tr>
972 <tr>
973 <td>
974 <label for="dyndns_password_text">QBT_TR(Password:)QBT_TR[CONTEXT=OptionsDialog]</label>
975 </td>
976 <td>
977 <input type="password" id="dyndns_password_text" />
978 </td>
979 </tr>
980 </table>
981 </fieldset>
982 </div>
984 <div id="AdvancedTab" class="PrefTab invisible">
985 <fieldset class="settings">
986 <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>
987 <table>
988 <tr>
989 <td>
990 <label for="resumeDataStorageType">QBT_TR(Resume data storage type (requires restart):)QBT_TR[CONTEXT=OptionsDialog]</label>
991 </td>
992 <td>
993 <select id="resumeDataStorageType" style="width: 15em;">
994 <option value="Legacy">QBT_TR(Fastresume files)QBT_TR[CONTEXT=OptionsDialog]</option>
995 <option value="SQLite">QBT_TR(SQLite database (experimental))QBT_TR[CONTEXT=OptionsDialog]</option>
996 </select>
997 </td>
998 </tr>
999 <tr id="rowMemoryWorkingSetLimit">
1000 <td>
1001 <label for="memoryWorkingSetLimit">QBT_TR(Physical memory (RAM) usage limit:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://wikipedia.org/wiki/Working_set" target="_blank">(?)</a></label>
1002 </td>
1003 <td>
1004 <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]
1005 </td>
1006 </tr>
1007 <tr>
1008 <td>
1009 <label for="networkInterface">QBT_TR(Network interface:)QBT_TR[CONTEXT=OptionsDialog]</label>
1010 </td>
1011 <td>
1012 <select id="networkInterface" style="width: 15em;">
1013 </select>
1014 </td>
1015 </tr>
1016 <tr>
1017 <td>
1018 <label for="optionalIPAddressToBind">QBT_TR(Optional IP address to bind to:)QBT_TR[CONTEXT=OptionsDialog]</label>
1019 </td>
1020 <td>
1021 <select id="optionalIPAddressToBind" style="width: 15em;">
1022 </select>
1023 </td>
1024 </tr>
1025 <tr>
1026 <td>
1027 <label for="saveResumeDataInterval">QBT_TR(Save resume data interval:)QBT_TR[CONTEXT=OptionsDialog]</label>
1028 </td>
1029 <td>
1030 <input type="text" id="saveResumeDataInterval" style="width: 15em;">&nbsp;&nbsp;QBT_TR(min)QBT_TR[CONTEXT=OptionsDialog]
1031 </td>
1032 </tr>
1033 <tr>
1034 <td>
1035 <label for="torrentFileSizeLimit">QBT_TR(.torrent file size limit:)QBT_TR[CONTEXT=OptionsDialog]</label>
1036 </td>
1037 <td>
1038 <input type="text" id="torrentFileSizeLimit" style="width: 15em;">&nbsp;&nbsp;QBT_TR(MiB)QBT_TR[CONTEXT=OptionsDialog]
1039 </td>
1040 </tr>
1041 <tr>
1042 <td>
1043 <label for="recheckTorrentsOnCompletion">QBT_TR(Recheck torrents on completion:)QBT_TR[CONTEXT=OptionsDialog]</label>
1044 </td>
1045 <td>
1046 <input type="checkbox" id="recheckTorrentsOnCompletion">
1047 </td>
1048 </tr>
1049 <tr>
1050 <td>
1051 <label for="appInstanceName">QBT_TR(Customize application instance name:)QBT_TR[CONTEXT=OptionsDialog]</label>
1052 </td>
1053 <td>
1054 <input type="text" id="appInstanceName" style="width: 15em;" title="QBT_TR(It appends the text to the window title to help distinguish qBittorent instances)QBT_TR[CONTEXT=OptionsDialog]" />
1055 </td>
1056 </tr>
1057 <tr>
1058 <td>
1059 <label for="refreshInterval">QBT_TR(Refresh interval:)QBT_TR[CONTEXT=OptionsDialog]</label>
1060 </td>
1061 <td>
1062 <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]
1063 </td>
1064 </tr>
1065 <tr>
1066 <td>
1067 <label for="resolvePeerCountries">QBT_TR(Resolve peer countries:)QBT_TR[CONTEXT=OptionsDialog]</label>
1068 </td>
1069 <td>
1070 <input type="checkbox" id="resolvePeerCountries">
1071 </td>
1072 </tr>
1073 <tr>
1074 <td>
1075 <label for="reannounceWhenAddressChanged">QBT_TR(Reannounce to all trackers when IP or port changed:)QBT_TR[CONTEXT=OptionsDialog]</label>
1076 </td>
1077 <td>
1078 <input type="checkbox" id="reannounceWhenAddressChanged" />
1079 </td>
1080 </tr>
1081 <tr>
1082 <td>
1083 <label for="enableEmbeddedTracker">QBT_TR(Enable embedded tracker:)QBT_TR[CONTEXT=OptionsDialog]</label>
1084 </td>
1085 <td>
1086 <input type="checkbox" id="enableEmbeddedTracker" />
1087 </td>
1088 </tr>
1089 <tr>
1090 <td>
1091 <label for="embeddedTrackerPort">QBT_TR(Embedded tracker port:)QBT_TR[CONTEXT=OptionsDialog]</label>
1092 </td>
1093 <td>
1094 <input type="text" id="embeddedTrackerPort" style="width: 15em;" />
1095 </td>
1096 </tr>
1097 <tr>
1098 <td>
1099 <label for="embeddedTrackerPortForwarding">QBT_TR(Enable port forwarding for embedded tracker:)QBT_TR[CONTEXT=OptionsDialog]</label>
1100 </td>
1101 <td>
1102 <input type="checkbox" id="embeddedTrackerPortForwarding" />
1103 </td>
1104 </tr>
1105 <tr id="rowMarkOfTheWeb">
1106 <td>
1107 <label for="markOfTheWeb">QBT_TR(Enable Mark-of-the-Web (MOTW) for downloaded files (require macOS or Windows):)QBT_TR[CONTEXT=OptionsDialog]</label>
1108 </td>
1109 <td>
1110 <input type="checkbox" id="markOfTheWeb" />
1111 </td>
1112 </tr>
1113 <tr>
1114 <td>
1115 <label for="pythonExecutablePath">QBT_TR(Python executable path (may require restart):)QBT_TR[CONTEXT=OptionsDialog]</label>
1116 </td>
1117 <td>
1118 <input type="text" id="pythonExecutablePath" placeholder="QBT_TR((Auto detect if empty))QBT_TR[CONTEXT=OptionsDialog]" style="width: 15em;" />
1119 </td>
1120 </tr>
1121 </table>
1122 </fieldset>
1123 <fieldset class="settings">
1124 <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>
1125 <table>
1126 <tr>
1127 <td>
1128 <label for="bdecodeDepthLimit">QBT_TR(Bdecode depth limit:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Bdecoding.html#bdecode()" target="_blank">(?)</a></label>
1129 </td>
1130 <td>
1131 <input type="text" id="bdecodeDepthLimit" style="width: 15em;" />
1132 </td>
1133 </tr>
1134 <tr>
1135 <td>
1136 <label for="bdecodeTokenLimit">QBT_TR(Bdecode token limit:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Bdecoding.html#bdecode()" target="_blank">(?)</a></label>
1137 </td>
1138 <td>
1139 <input type="text" id="bdecodeTokenLimit" style="width: 15em;" />
1140 </td>
1141 </tr>
1142 <tr>
1143 <td>
1144 <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>
1145 </td>
1146 <td>
1147 <input type="text" id="asyncIOThreads" style="width: 15em;" />
1148 </td>
1149 </tr>
1150 <tr id="rowHashingThreads">
1151 <td>
1152 <label for="hashingThreads">QBT_TR(Hashing threads:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#hashing_threads" target="_blank">(?)</a></label>
1153 </td>
1154 <td>
1155 <input type="text" id="hashingThreads" style="width: 15em;" />
1156 </td>
1157 </tr>
1158 <tr>
1159 <td>
1160 <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>
1161 </td>
1162 <td>
1163 <input type="text" id="filePoolSize" style="width: 15em;" />
1164 </td>
1165 </tr>
1166 <tr>
1167 <td>
1168 <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>
1169 </td>
1170 <td>
1171 <input type="text" id="outstandMemoryWhenCheckingTorrents" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(MiB)QBT_TR[CONTEXT=OptionsDialog]
1172 </td>
1173 </tr>
1174 <tr id="rowDiskCache">
1175 <td>
1176 <label for="diskCache">QBT_TR(Disk cache:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#cache_size" target="_blank">(?)</a></label>
1177 </td>
1178 <td>
1179 <input type="text" id="diskCache" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(MiB)QBT_TR[CONTEXT=OptionsDialog]
1180 </td>
1181 </tr>
1182 <tr id="rowDiskCacheExpiryInterval">
1183 <td>
1184 <label for="diskCacheExpiryInterval">QBT_TR(Disk cache expiry interval:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#cache_expiry" target="_blank">(?)</a></label>
1185 </td>
1186 <td>
1187 <input type="text" id="diskCacheExpiryInterval" style="width: 15em;">&nbsp;&nbsp;QBT_TR(s)QBT_TR[CONTEXT=OptionsDialog]
1188 </td>
1189 </tr>
1190 <tr>
1191 <td>
1192 <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>
1193 </td>
1194 <td>
1195 <input type="text" id="diskQueueSize" style="width: 15em;">&nbsp;&nbsp;QBT_TR(KiB)QBT_TR[CONTEXT=OptionsDialog]
1196 </td>
1197 </tr>
1198 <tr id="rowDiskIOType">
1199 <td>
1200 <label for="diskIOType">QBT_TR(Disk IO type (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>
1201 </td>
1202 <td>
1203 <select id="diskIOType" style="width: 15em;">
1204 <option value="0">QBT_TR(Default)QBT_TR[CONTEXT=OptionsDialog]</option>
1205 <option value="1">QBT_TR(Memory mapped files)QBT_TR[CONTEXT=OptionsDialog]</option>
1206 <option value="2">QBT_TR(POSIX-compliant)QBT_TR[CONTEXT=OptionsDialog]</option>
1207 </select>
1208 </td>
1209 </tr>
1210 <tr>
1211 <td>
1212 <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>
1213 </td>
1214 <td>
1215 <select id="diskIOReadMode" style="width: 15em;">
1216 <option value="0">QBT_TR(Disable OS cache)QBT_TR[CONTEXT=OptionsDialog]</option>
1217 <option value="1">QBT_TR(Enable OS cache)QBT_TR[CONTEXT=OptionsDialog]</option>
1218 </select>
1219 </td>
1220 </tr>
1221 <tr>
1222 <td>
1223 <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>
1224 </td>
1225 <td>
1226 <select id="diskIOWriteMode" style="width: 15em;">
1227 <option value="0">QBT_TR(Disable OS cache)QBT_TR[CONTEXT=OptionsDialog]</option>
1228 <option value="1">QBT_TR(Enable OS cache)QBT_TR[CONTEXT=OptionsDialog]</option>
1229 <option value="2" id="diskIOWriteModeWriteThrough">QBT_TR(Write-through)QBT_TR[CONTEXT=OptionsDialog]</option>
1230 </select>
1231 </td>
1232 </tr>
1233 <tr id="rowCoalesceReadsAndWrites">
1234 <td>
1235 <label for="coalesceReadsAndWrites">QBT_TR(Coalesce reads &amp; writes:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#coalesce_reads" target="_blank">(?)</a></label>
1236 </td>
1237 <td>
1238 <input type="checkbox" id="coalesceReadsAndWrites" />
1239 </td>
1240 </tr>
1241 <tr>
1242 <td>
1243 <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>
1244 </td>
1245 <td>
1246 <input type="checkbox" id="pieceExtentAffinity" />
1247 </td>
1248 </tr>
1249 <tr>
1250 <td>
1251 <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>
1252 </td>
1253 <td>
1254 <input type="checkbox" id="sendUploadPieceSuggestions" />
1255 </td>
1256 </tr>
1257 <tr>
1258 <td>
1259 <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>
1260 </td>
1261 <td>
1262 <input type="text" id="sendBufferWatermark" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(KiB)QBT_TR[CONTEXT=OptionsDialog]
1263 </td>
1264 </tr>
1265 <tr>
1266 <td>
1267 <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>
1268 </td>
1269 <td>
1270 <input type="text" id="sendBufferLowWatermark" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(KiB)QBT_TR[CONTEXT=OptionsDialog]
1271 </td>
1272 </tr>
1273 <tr>
1274 <td>
1275 <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>
1276 </td>
1277 <td>
1278 <input type="text" id="sendBufferWatermarkFactor" style="width: 15em;" />&nbsp;&nbsp;%
1279 </td>
1280 </tr>
1281 <tr>
1282 <td>
1283 <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>
1284 </td>
1285 <td>
1286 <input type="text" id="connectionSpeed" style="width: 15em;" />
1287 </td>
1288 </tr>
1289 <tr>
1290 <td>
1291 <label for="socketSendBufferSize">QBT_TR(Socket send buffer size [0: system default]:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#send_socket_buffer_size" target="_blank">(?)</a></label>
1292 </td>
1293 <td>
1294 <input type="text" id="socketSendBufferSize" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(KiB)QBT_TR[CONTEXT=OptionsDialog]
1295 </td>
1296 </tr>
1297 <tr>
1298 <td>
1299 <label for="socketReceiveBufferSize">QBT_TR(Socket receive buffer size [0: system default]:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#recv_socket_buffer_size" target="_blank">(?)</a></label>
1300 </td>
1301 <td>
1302 <input type="text" id="socketReceiveBufferSize" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(KiB)QBT_TR[CONTEXT=OptionsDialog]
1303 </td>
1304 </tr>
1305 <tr>
1306 <td>
1307 <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>
1308 </td>
1309 <td>
1310 <input type="text" id="socketBacklogSize" style="width: 15em;" />
1311 </td>
1312 </tr>
1313 <tr>
1314 <td>
1315 <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>
1316 </td>
1317 <td>
1318 <input type="text" id="outgoingPortsMin" style="width: 15em;" />
1319 </td>
1320 </tr>
1321 <tr>
1322 <td>
1323 <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>
1324 </td>
1325 <td>
1326 <input type="text" id="outgoingPortsMax" style="width: 15em;" />
1327 </td>
1328 </tr>
1329 <tr>
1330 <td>
1331 <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>
1332 </td>
1333 <td>
1334 <input type="text" id="UPnPLeaseDuration" style="width: 15em;" />
1335 </td>
1336 </tr>
1337 <tr>
1338 <td>
1339 <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>
1340 </td>
1341 <td>
1342 <input type="text" id="peerToS" style="width: 15em;" />
1343 </td>
1344 </tr>
1345 <tr>
1346 <td>
1347 <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>
1348 </td>
1349 <td>
1350 <select id="utpTCPMixedModeAlgorithm" style="width: 15em;">
1351 <option value="0">QBT_TR(Prefer TCP)QBT_TR[CONTEXT=OptionsDialog]</option>
1352 <option value="1">QBT_TR(Peer proportional (throttles TCP))QBT_TR[CONTEXT=OptionsDialog]</option>
1353 </select>
1354 </td>
1355 </tr>
1356 <tr>
1357 <td>
1358 <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>
1359 </td>
1360 <td>
1361 <input type="checkbox" id="IDNSupportCheckbox" />
1362 </td>
1363 </tr>
1364 <tr>
1365 <td>
1366 <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>
1367 </td>
1368 <td>
1369 <input type="checkbox" id="allowMultipleConnectionsFromTheSameIPAddress" />
1370 </td>
1371 </tr>
1372 <tr>
1373 <td>
1374 <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>
1375 </td>
1376 <td>
1377 <input type="checkbox" id="validateHTTPSTrackerCertificate" />
1378 </td>
1379 </tr>
1380 <tr>
1381 <td>
1382 <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>
1383 </td>
1384 <td>
1385 <input type="checkbox" id="mitigateSSRF" />
1386 </td>
1387 </tr>
1388 <tr>
1389 <td>
1390 <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>
1391 </td>
1392 <td>
1393 <input type="checkbox" id="blockPeersOnPrivilegedPorts" />
1394 </td>
1395 </tr>
1396 <tr>
1397 <td>
1398 <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>
1399 </td>
1400 <td>
1401 <select id="uploadSlotsBehavior" style="width: 15em;">
1402 <option value="0">QBT_TR(Fixed slots)QBT_TR[CONTEXT=OptionsDialog]</option>
1403 <option value="1">QBT_TR(Upload rate based)QBT_TR[CONTEXT=OptionsDialog]</option>
1404 </select>
1405 </td>
1406 </tr>
1407 <tr>
1408 <td>
1409 <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>
1410 </td>
1411 <td>
1412 <select id="uploadChokingAlgorithm" style="width: 15em;">
1413 <option value="0">QBT_TR(Round-robin)QBT_TR[CONTEXT=OptionsDialog]</option>
1414 <option value="1">QBT_TR(Fastest upload)QBT_TR[CONTEXT=OptionsDialog]</option>
1415 <option value="2">QBT_TR(Anti-leech)QBT_TR[CONTEXT=OptionsDialog]</option>
1416 </select>
1417 </td>
1418 </tr>
1419 <tr>
1420 <td>
1421 <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>
1422 </td>
1423 <td>
1424 <input type="checkbox" id="announceAllTrackers" />
1425 </td>
1426 </tr>
1427 <tr>
1428 <td>
1429 <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>
1430 </td>
1431 <td>
1432 <input type="checkbox" id="announceAllTiers" />
1433 </td>
1434 </tr>
1435 <tr>
1436 <td>
1437 <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>
1438 </td>
1439 <td>
1440 <input type="text" id="announceIP" style="width: 15em;" />
1441 </td>
1442 </tr>
1443 <tr>
1444 <td>
1445 <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>
1446 </td>
1447 <td>
1448 <input type="text" id="maxConcurrentHTTPAnnounces" style="width: 15em;" />
1449 </td>
1450 </tr>
1451 <tr>
1452 <td>
1453 <label for="stopTrackerTimeout">QBT_TR(Stop tracker timeout [0: disabled]:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#stop_tracker_timeout" target="_blank">(?)</a></label>
1454 </td>
1455 <td>
1456 <input type="text" id="stopTrackerTimeout" style="width: 15em;" />
1457 </td>
1458 </tr>
1459 <tr>
1460 <td>
1461 <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>
1462 </td>
1463 <td>
1464 <input type="text" id="peerTurnover" style="width: 15em;" />&nbsp;&nbsp;%
1465 </td>
1466 </tr>
1467 <tr>
1468 <td>
1469 <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>
1470 </td>
1471 <td>
1472 <input type="text" id="peerTurnoverCutoff" style="width: 15em;" />&nbsp;&nbsp;%
1473 </td>
1474 </tr>
1475 <tr>
1476 <td>
1477 <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>
1478 </td>
1479 <td>
1480 <input type="text" id="peerTurnoverInterval" style="width: 15em;" />&nbsp;&nbsp;s
1481 </td>
1482 </tr>
1483 <tr>
1484 <td>
1485 <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>
1486 </td>
1487 <td>
1488 <input type="text" id="requestQueueSize" style="width: 15em;" />
1489 </td>
1490 </tr>
1491 <tr>
1492 <td>
1493 <label for="dhtBootstrapNodes">QBT_TR(DHT bootstrap nodes:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#dht_bootstrap_nodes" target="_blank">(?)</a></label>
1494 </td>
1495 <td>
1496 <input type="text" id="dhtBootstrapNodes" placeholder="QBT_TR(Resets to default if empty)QBT_TR[CONTEXT=OptionsDialog]" style="width: 15em;" />
1497 </td>
1498 </tr>
1499 <tr id="rowI2pInboundQuantity">
1500 <td>
1501 <label for="i2pInboundQuantity">QBT_TR(I2P inbound quantity:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#i2p_inbound_quantity" target="_blank">(?)</a></label>
1502 </td>
1503 <td>
1504 <input id="i2pInboundQuantity" type="number" min="1" max="16" onchange="qBittorrent.Preferences.numberInputLimiter(this);" style="width: 15em;" />
1505 </td>
1506 </tr>
1507 <tr id="rowI2pOutboundQuantity">
1508 <td>
1509 <label for="i2pOutboundQuantity">QBT_TR(I2P outbound quantity:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#i2p_outbound_quantity" target="_blank">(?)</a></label>
1510 </td>
1511 <td>
1512 <input id="i2pOutboundQuantity" type="number" min="1" max="16" onchange="qBittorrent.Preferences.numberInputLimiter(this);" style="width: 15em;" />
1513 </td>
1514 </tr>
1515 <tr id="rowI2pInboundLength">
1516 <td>
1517 <label for="i2pInboundLength">QBT_TR(I2P inbound length:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#i2p_inbound_length" target="_blank">(?)</a></label>
1518 </td>
1519 <td>
1520 <input id="i2pInboundLength" type="number" min="0" max="7" onchange="qBittorrent.Preferences.numberInputLimiter(this);" style="width: 15em;" />
1521 </td>
1522 </tr>
1523 <tr id="rowI2pOutboundLength">
1524 <td>
1525 <label for="i2pOutboundLength">QBT_TR(I2P outbound length:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#i2p_outbound_length" target="_blank">(?)</a></label>
1526 </td>
1527 <td>
1528 <input id="i2pOutboundLength" type="number" min="0" max="7" onchange="qBittorrent.Preferences.numberInputLimiter(this);" style="width: 15em;" />
1529 </td>
1530 </tr>
1531 </table>
1532 </fieldset>
1533 </div>
1535 <div style="text-align: center; margin-top: 1em;"><input type="button" value="QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" onclick="qBittorrent.Preferences.applyPreferences();" /></div>
1537 <script>
1538 "use strict";
1540 if (window.qBittorrent === undefined)
1541 window.qBittorrent = {};
1543 window.qBittorrent.Preferences = (function() {
1544 const exports = function() {
1545 return {
1546 numberInputLimiter: numberInputLimiter,
1547 updateFileLogEnabled: updateFileLogEnabled,
1548 updateFileLogBackupEnabled: updateFileLogBackupEnabled,
1549 updateFileLogDeleteEnabled: updateFileLogDeleteEnabled,
1550 updateTempDirEnabled: updateTempDirEnabled,
1551 updateExportDirEnabled: updateExportDirEnabled,
1552 updateExportDirFinEnabled: updateExportDirFinEnabled,
1553 addWatchFolder: addWatchFolder,
1554 updateExcludedFileNamesEnabled: updateExcludedFileNamesEnabled,
1555 changeWatchFolderSelect: changeWatchFolderSelect,
1556 updateMailNotification: updateMailNotification,
1557 updateMailAuthSettings: updateMailAuthSettings,
1558 sendTestEmail: sendTestEmail,
1559 updateAutoRun: updateAutoRun,
1560 updateAutoRunOnTorrentAdded: updateAutoRunOnTorrentAdded,
1561 generateRandomPort: generateRandomPort,
1562 updateMaxConnecEnabled: updateMaxConnecEnabled,
1563 updateMaxConnecPerTorrentEnabled: updateMaxConnecPerTorrentEnabled,
1564 updateMaxUploadsEnabled: updateMaxUploadsEnabled,
1565 updateMaxUploadsPerTorrentEnabled: updateMaxUploadsPerTorrentEnabled,
1566 updateI2PSettingsEnabled: updateI2PSettingsEnabled,
1567 updatePeerProxySettings: updatePeerProxySettings,
1568 updatePeerProxyAuthSettings: updatePeerProxyAuthSettings,
1569 updateFilterSettings: updateFilterSettings,
1570 updateSchedulingEnabled: updateSchedulingEnabled,
1571 updateQueueingSystem: updateQueueingSystem,
1572 updateSlowTorrentsSettings: updateSlowTorrentsSettings,
1573 updateMaxRatioTimeEnabled: updateMaxRatioTimeEnabled,
1574 updateAddTrackersEnabled: updateAddTrackersEnabled,
1575 updateHttpsSettings: updateHttpsSettings,
1576 updateBypasssAuthSettings: updateBypasssAuthSettings,
1577 updateAlternativeWebUISettings: updateAlternativeWebUISettings,
1578 updateHostHeaderValidationSettings: updateHostHeaderValidationSettings,
1579 updateWebUICustomHTTPHeadersSettings: updateWebUICustomHTTPHeadersSettings,
1580 updateWebUIReverseProxySettings: updateWebUIReverseProxySettings,
1581 updateDynDnsSettings: updateDynDnsSettings,
1582 updateWebuiLocaleSelect: updateWebuiLocaleSelect,
1583 registerDynDns: registerDynDns,
1584 applyPreferences: applyPreferences
1588 // Behavior tab
1589 const numberInputLimiter = (input) => {
1590 const min = input.getAttribute("min");
1591 const max = input.getAttribute("max");
1593 if (min && (input.value.toInt() < min.toInt()))
1594 input.value = min;
1596 if (max && (input.value.toInt() > max.toInt()))
1597 input.value = max;
1600 const updateFileLogEnabled = function() {
1601 const isFileLogEnabled = $("filelog_checkbox").getProperty("checked");
1602 $("filelog_save_path_input").setProperty("disabled", !isFileLogEnabled);
1603 $("filelog_backup_checkbox").setProperty("disabled", !isFileLogEnabled);
1604 $("filelog_delete_old_checkbox").setProperty("disabled", !isFileLogEnabled);
1606 updateFileLogBackupEnabled();
1607 updateFileLogDeleteEnabled();
1610 const updateFileLogBackupEnabled = function() {
1611 const pros = $("filelog_backup_checkbox").getProperties("disabled", "checked");
1612 $("filelog_max_size_input").setProperty("disabled", pros.disabled || !pros.checked);
1615 const updateFileLogDeleteEnabled = function() {
1616 const pros = $("filelog_delete_old_checkbox").getProperties("disabled", "checked");
1617 $("filelog_age_input").setProperty("disabled", pros.disabled || !pros.checked);
1618 $("filelog_age_type_select").setProperty("disabled", pros.disabled || !pros.checked);
1621 // Downloads tab
1622 const watchedFoldersTable = new HtmlTable($("watched_folders_tab"));
1624 const updateTempDirEnabled = function() {
1625 const isTempDirEnabled = $("temppath_checkbox").getProperty("checked");
1626 $("temppath_text").setProperty("disabled", !isTempDirEnabled);
1629 const changeWatchFolderSelect = (item) => {
1630 if (item.value === "other") {
1631 item.nextElementSibling.hidden = false;
1632 item.nextElementSibling.value = "QBT_TR(Type folder here)QBT_TR[CONTEXT=ScanFoldersModel]";
1633 item.nextElementSibling.select();
1635 else {
1636 item.nextElementSibling.hidden = true;
1637 const text = item.options[item.selectedIndex].textContent;
1638 item.nextElementSibling.value = text;
1642 const addWatchFolder = (folder = "", sel = "default_folder", other = "") => {
1643 const pos = $("watched_folders_tab").getChildren("tbody")[0].getChildren("tr").length;
1644 const myinput = "<input id='text_watch_" + pos + "' type='text' value='" + folder + "'>";
1645 const disableInput = (sel !== "other");
1646 const mycb = "<div class='select-watched-folder-editable'>"
1647 + "<select id ='cb_watch_" + pos + "' onchange='qBittorrent.Preferences.changeWatchFolderSelect(this)'>"
1648 + "<option value='watch_folder'>QBT_TR(Monitored folder)QBT_TR[CONTEXT=ScanFoldersModel]</option>"
1649 + "<option value='default_folder'>QBT_TR(Default save location)QBT_TR[CONTEXT=ScanFoldersModel]</option>"
1650 + "<option value='other'>QBT_TR(Other...)QBT_TR[CONTEXT=ScanFoldersModel]</option>"
1651 + "</select>"
1652 + "<input id='cb_watch_txt_" + pos + "' type='text' " + (disableInput ? "hidden " : "") + "/>"
1653 + "<img src='images/list-add.svg' id='addFolderImg_" + pos + "' alt='Add' style='padding-left:170px;width:16px;cursor:pointer;' onclick='qBittorrent.Preferences.addWatchFolder();' />"
1654 + "</div>";
1656 watchedFoldersTable.push([myinput, mycb]);
1657 $("cb_watch_" + pos).setProperty("value", sel);
1658 if (disableInput) {
1659 const elt = $("cb_watch_" + pos);
1660 other = elt.options[elt.selectedIndex].textContent;
1662 $("cb_watch_txt_" + pos).setProperty("value", other);
1664 // hide previous img
1665 if (pos > 0)
1666 $("addFolderImg_" + (pos - 1)).style.display = "none";
1669 const getWatchedFolders = () => {
1670 const nb_folders = $("watched_folders_tab").getChildren("tbody")[0].getChildren("tr").length;
1671 const folders = new Hash();
1672 for (let i = 0; i < nb_folders; ++i) {
1673 const fpath = $("text_watch_" + i).getProperty("value").trim();
1674 if (fpath.length > 0) {
1675 const sel = $("cb_watch_" + i).getProperty("value").trim();
1677 let other;
1678 if (sel === "other")
1679 other = $("cb_watch_txt_" + i).getProperty("value").trim();
1680 else
1681 other = (sel === "watch_folder") ? 0 : 1;
1683 folders.set(fpath, other);
1686 return folders;
1689 const updateExcludedFileNamesEnabled = function() {
1690 const isAExcludedFileNamesEnabled = $("excludedFileNamesCheckbox").getProperty("checked");
1691 $("excludedFileNamesTextarea").setProperty("disabled", !isAExcludedFileNamesEnabled);
1694 const updateExportDirEnabled = function() {
1695 const isExportDirEnabled = $("exportdir_checkbox").getProperty("checked");
1696 $("exportdir_text").setProperty("disabled", !isExportDirEnabled);
1699 const updateExportDirFinEnabled = function() {
1700 const isExportDirFinEnabled = $("exportdirfin_checkbox").getProperty("checked");
1701 $("exportdirfin_text").setProperty("disabled", !isExportDirFinEnabled);
1704 const updateMailNotification = function() {
1705 const isMailNotificationEnabled = $("mail_notification_checkbox").getProperty("checked");
1706 $("src_email_txt").setProperty("disabled", !isMailNotificationEnabled);
1707 $("dest_email_txt").setProperty("disabled", !isMailNotificationEnabled);
1708 $("smtp_server_txt").setProperty("disabled", !isMailNotificationEnabled);
1709 $("mail_ssl_checkbox").setProperty("disabled", !isMailNotificationEnabled);
1710 $("mail_auth_checkbox").setProperty("disabled", !isMailNotificationEnabled);
1711 $("mail_test_button").setProperty("disabled", !isMailNotificationEnabled);
1713 if (!isMailNotificationEnabled) {
1714 $("mail_auth_checkbox").setProperty("checked", !isMailNotificationEnabled);
1715 updateMailAuthSettings();
1719 const updateMailAuthSettings = function() {
1720 const isMailAuthEnabled = $("mail_auth_checkbox").getProperty("checked");
1721 $("mail_username_text").setProperty("disabled", !isMailAuthEnabled);
1722 $("mail_password_text").setProperty("disabled", !isMailAuthEnabled);
1725 const sendTestEmail = function() {
1726 new Request({
1727 url: "api/v2/app/sendTestEmail",
1728 method: "post",
1729 onFailure: function() {
1730 alert("QBT_TR(Could not contact qBittorrent)QBT_TR[CONTEXT=HttpServer]");
1732 onSuccess: function() {
1733 alert("QBT_TR(Attempted to send email. Check your inbox to confirm success)QBT_TR[CONTEXT=OptionsDialog]");
1735 }).send();
1738 const updateAutoRunOnTorrentAdded = function() {
1739 const isAutoRunOnTorrentAddedEnabled = $("autorunOnTorrentAddedCheckbox").getProperty("checked");
1740 $("autorunOnTorrentAddedProgram").setProperty("disabled", !isAutoRunOnTorrentAddedEnabled);
1743 const updateAutoRun = function() {
1744 const isAutoRunEnabled = $("autorun_checkbox").getProperty("checked");
1745 $("autorunProg_txt").setProperty("disabled", !isAutoRunEnabled);
1748 // Connection tab
1750 const updateMaxConnecEnabled = function() {
1751 const isMaxConnecEnabled = $("max_connec_checkbox").getProperty("checked");
1752 $("max_connec_value").setProperty("disabled", !isMaxConnecEnabled);
1755 const updateMaxConnecPerTorrentEnabled = function() {
1756 const isMaxConnecPerTorrentEnabled = $("max_connec_per_torrent_checkbox").getProperty("checked");
1757 $("max_connec_per_torrent_value").setProperty("disabled", !isMaxConnecPerTorrentEnabled);
1760 const updateMaxUploadsEnabled = function() {
1761 const isMaxUploadsEnabled = $("max_uploads_checkbox").getProperty("checked");
1762 $("max_uploads_value").setProperty("disabled", !isMaxUploadsEnabled);
1765 const updateMaxUploadsPerTorrentEnabled = function() {
1766 const isMaxUploadsPerTorrentEnabled = $("max_uploads_per_torrent_checkbox").getProperty("checked");
1767 $("max_uploads_per_torrent_value").setProperty("disabled", !isMaxUploadsPerTorrentEnabled);
1770 const updateI2PSettingsEnabled = function() {
1771 const isI2PEnabled = $("i2pEnabledCheckbox").getProperty("checked");
1772 $("i2pAddress").setProperty("disabled", !isI2PEnabled);
1773 $("i2pPort").setProperty("disabled", !isI2PEnabled);
1774 $("i2pMixedMode").setProperty("disabled", !isI2PEnabled);
1777 const updatePeerProxySettings = function() {
1778 const proxyType = $("peer_proxy_type_select").getProperty("value");
1779 const isProxyDisabled = (proxyType === "None");
1780 const isProxySocks4 = (proxyType === "SOCKS4");
1782 $("peer_proxy_host_text").setProperty("disabled", isProxyDisabled);
1783 $("peer_proxy_port_value").setProperty("disabled", isProxyDisabled);
1785 $("peer_proxy_auth_checkbox").setProperty("disabled", (isProxyDisabled || isProxySocks4));
1786 $("proxy_bittorrent_checkbox").setProperty("disabled", isProxyDisabled);
1787 $("use_peer_proxy_checkbox").setProperty("disabled", (isProxyDisabled || !$("proxy_bittorrent_checkbox").getProperty("checked")));
1788 $("proxyHostnameLookupCheckbox").setProperty("disabled", (isProxyDisabled || isProxySocks4));
1789 $("proxy_rss_checkbox").setProperty("disabled", (isProxyDisabled || isProxySocks4));
1790 $("proxy_misc_checkbox").setProperty("disabled", (isProxyDisabled || isProxySocks4));
1792 updatePeerProxyAuthSettings();
1795 const updatePeerProxyAuthSettings = function() {
1796 const proxyType = $("peer_proxy_type_select").getProperty("value");
1797 const isProxyDisabled = (proxyType === "None");
1798 const isPeerProxyAuthEnabled = (!$("peer_proxy_auth_checkbox").getProperty("disabled") && $("peer_proxy_auth_checkbox").getProperty("checked"));
1799 $("peer_proxy_username_text").setProperty("disabled", (isProxyDisabled || !isPeerProxyAuthEnabled));
1800 $("peer_proxy_password_text").setProperty("disabled", (isProxyDisabled || !isPeerProxyAuthEnabled));
1803 const updateFilterSettings = function() {
1804 const isIPFilterEnabled = $("ipfilter_text_checkbox").getProperty("checked");
1805 $("ipfilter_text").setProperty("disabled", !isIPFilterEnabled);
1808 // Speed tab
1809 const updateSchedulingEnabled = function() {
1810 const isLimitSchedulingEnabled = $("limitSchedulingCheckbox").getProperty("checked");
1811 $("schedule_from_hour").setProperty("disabled", !isLimitSchedulingEnabled);
1812 $("schedule_from_min").setProperty("disabled", !isLimitSchedulingEnabled);
1813 $("schedule_to_hour").setProperty("disabled", !isLimitSchedulingEnabled);
1814 $("schedule_to_min").setProperty("disabled", !isLimitSchedulingEnabled);
1815 $("schedule_freq_select").setProperty("disabled", !isLimitSchedulingEnabled);
1818 // Bittorrent tab
1819 const updateQueueingSystem = function() {
1820 const isQueueingEnabled = $("queueing_checkbox").getProperty("checked");
1821 $("max_active_dl_value").setProperty("disabled", !isQueueingEnabled);
1822 $("max_active_up_value").setProperty("disabled", !isQueueingEnabled);
1823 $("max_active_to_value").setProperty("disabled", !isQueueingEnabled);
1824 $("dont_count_slow_torrents_checkbox").setProperty("disabled", !isQueueingEnabled);
1825 updateSlowTorrentsSettings();
1828 const updateSlowTorrentsSettings = function() {
1829 const isDontCountSlowTorrentsEnabled = (!$("dont_count_slow_torrents_checkbox").getProperty("disabled")) && $("dont_count_slow_torrents_checkbox").getProperty("checked");
1830 $("dl_rate_threshold").setProperty("disabled", !isDontCountSlowTorrentsEnabled);
1831 $("ul_rate_threshold").setProperty("disabled", !isDontCountSlowTorrentsEnabled);
1832 $("torrent_inactive_timer").setProperty("disabled", !isDontCountSlowTorrentsEnabled);
1835 const updateMaxRatioTimeEnabled = function() {
1836 const isMaxRatioEnabled = $("max_ratio_checkbox").getProperty("checked");
1837 $("max_ratio_value").setProperty("disabled", !isMaxRatioEnabled);
1839 const isMaxSeedingTimeEnabled = $("max_seeding_time_checkbox").getProperty("checked");
1840 $("max_seeding_time_value").setProperty("disabled", !isMaxSeedingTimeEnabled);
1842 const isMaxInactiveSeedingTimeEnabled = $("max_inactive_seeding_time_checkbox").getProperty("checked");
1843 $("max_inactive_seeding_time_value").setProperty("disabled", !isMaxInactiveSeedingTimeEnabled);
1845 $("max_ratio_act").setProperty("disabled", !(isMaxRatioEnabled || isMaxSeedingTimeEnabled || isMaxInactiveSeedingTimeEnabled));
1848 const updateAddTrackersEnabled = function() {
1849 const isAddTrackersEnabled = $("add_trackers_checkbox").getProperty("checked");
1850 $("add_trackers_textarea").setProperty("disabled", !isAddTrackersEnabled);
1853 // WebUI tab
1854 const updateHttpsSettings = function() {
1855 const isUseHttpsEnabled = $("use_https_checkbox").getProperty("checked");
1856 $("ssl_cert_text").setProperty("disabled", !isUseHttpsEnabled);
1857 $("ssl_key_text").setProperty("disabled", !isUseHttpsEnabled);
1858 $("secureCookieCheckbox").setProperty("disabled", !isUseHttpsEnabled);
1861 const updateBypasssAuthSettings = function() {
1862 const isBypassAuthSubnetWhitelistEnabled = $("bypass_auth_subnet_whitelist_checkbox").getProperty("checked");
1863 $("bypass_auth_subnet_whitelist_textarea").setProperty("disabled", !isBypassAuthSubnetWhitelistEnabled);
1866 const updateAlternativeWebUISettings = function() {
1867 const isUseAlternativeWebUIEnabled = $("use_alt_webui_checkbox").getProperty("checked");
1868 $("webui_files_location_textarea").setProperty("disabled", !isUseAlternativeWebUIEnabled);
1871 const updateHostHeaderValidationSettings = function() {
1872 const isHostHeaderValidationEnabled = $("host_header_validation_checkbox").getProperty("checked");
1873 $("webui_domain_textarea").setProperty("disabled", !isHostHeaderValidationEnabled);
1876 const updateWebUICustomHTTPHeadersSettings = function() {
1877 const isEnabled = $("webUIUseCustomHTTPHeadersCheckbox").getProperty("checked");
1878 $("webUICustomHTTPHeadersTextarea").setProperty("disabled", !isEnabled);
1881 const updateWebUIReverseProxySettings = function() {
1882 const isEnabled = $("webUIReverseProxySupportCheckbox").getProperty("checked");
1883 $("webUIReverseProxiesListTextarea").setProperty("disabled", !isEnabled);
1886 const updateDynDnsSettings = function() {
1887 const isDynDnsEnabled = $("use_dyndns_checkbox").getProperty("checked");
1888 $("dyndns_select").setProperty("disabled", !isDynDnsEnabled);
1889 $("dyndns_domain_text").setProperty("disabled", !isDynDnsEnabled);
1890 $("dyndns_username_text").setProperty("disabled", !isDynDnsEnabled);
1891 $("dyndns_password_text").setProperty("disabled", !isDynDnsEnabled);
1894 const registerDynDns = function() {
1895 if ($("dyndns_select").getProperty("value").toInt() === 1)
1896 window.open("http://www.no-ip.com/services/managed_dns/free_dynamic_dns.html", "NO-IP Registration");
1897 else
1898 window.open("https://www.dyndns.com/account/services/hosts/add.html", "DynDNS Registration");
1901 const generateRandomPort = function() {
1902 const min = 1024;
1903 const max = 65535;
1904 const port = Math.floor(Math.random() * (max - min + 1) + min);
1905 $("port_value").setProperty("value", port);
1908 const time_padding = function(val) {
1909 let ret = val.toString();
1910 if (ret.length === 1)
1911 ret = "0" + ret;
1912 return ret;
1915 // Advanced Tab
1916 const updateNetworkInterfaces = function(default_iface, default_iface_name) {
1917 const url = "api/v2/app/networkInterfaceList";
1918 $("networkInterface").getChildren().each(c => c.destroy());
1919 new Request.JSON({
1920 url: url,
1921 method: "get",
1922 noCache: true,
1923 onFailure: function() {
1924 alert("Could not contact qBittorrent");
1926 onSuccess: function(ifaces) {
1927 if (!Array.isArray(ifaces))
1928 return;
1930 // add the current network interface to the options if needed
1931 if (default_iface && !ifaces.some((item) => item.value === default_iface))
1932 ifaces.push({ name: default_iface_name || default_iface, value: default_iface });
1934 $("networkInterface").options.add(new Option("QBT_TR(Any interface)QBT_TR[CONTEXT=OptionsDialog]", ""));
1935 ifaces.forEach((item, index) => {
1936 $("networkInterface").options.add(new Option(item.name, item.value));
1938 $("networkInterface").setProperty("value", default_iface);
1940 }).send();
1943 const updateInterfaceAddresses = function(iface, default_addr) {
1944 const url = "api/v2/app/networkInterfaceAddressList";
1945 $("optionalIPAddressToBind").getChildren().each(c => c.destroy());
1946 new Request.JSON({
1947 url: url,
1948 method: "get",
1949 noCache: true,
1950 data: {
1951 "iface": iface
1953 onFailure: function() {
1954 alert("Could not contact qBittorrent");
1956 onSuccess: function(addresses) {
1957 if (!addresses)
1958 return;
1960 $("optionalIPAddressToBind").options.add(new Option("QBT_TR(All addresses)QBT_TR[CONTEXT=OptionDialog]", ""));
1961 $("optionalIPAddressToBind").options.add(new Option("QBT_TR(All IPv4 addresses)QBT_TR[CONTEXT=OptionDialog]", "0.0.0.0"));
1962 $("optionalIPAddressToBind").options.add(new Option("QBT_TR(All IPv6 addresses)QBT_TR[CONTEXT=OptionDialog]", "::"));
1963 addresses.forEach((item, index) => {
1964 $("optionalIPAddressToBind").options.add(new Option(item, item));
1966 $("optionalIPAddressToBind").setProperty("value", default_addr);
1968 }).send();
1971 const updateWebuiLocaleSelect = (selected) => {
1972 const languages = [];
1973 for (let i = 0; i < $("locale_select").options.length; i++)
1974 languages.push($("locale_select").options[i].value);
1976 if (!languages.includes(selected)) {
1977 const lang = selected.slice(0, selected.indexOf("_"));
1978 selected = languages.includes(lang) ? lang : "en";
1980 $("locale_select").setProperty("value", selected);
1983 const loadPreferences = function() {
1984 window.parent.qBittorrent.Cache.preferences.init({
1985 onSuccess: (pref) => {
1986 // Behavior tab
1987 $("filelog_checkbox").setProperty("checked", pref.file_log_enabled);
1988 $("filelog_save_path_input").setProperty("value", pref.file_log_path);
1989 $("filelog_backup_checkbox").setProperty("checked", pref.file_log_backup_enabled);
1990 $("filelog_max_size_input").setProperty("value", pref.file_log_max_size);
1991 $("filelog_delete_old_checkbox").setProperty("checked", pref.file_log_delete_old);
1992 $("filelog_age_input").setProperty("value", pref.file_log_age);
1993 $("filelog_age_type_select").setProperty("value", pref.file_log_age_type);
1994 updateFileLogEnabled();
1996 // Downloads tab
1997 // When adding a torrent
1998 let index = 0;
1999 switch (pref.torrent_content_layout) {
2000 case "Original":
2001 index = 0;
2002 break;
2003 case "Subfolder":
2004 index = 1;
2005 break;
2006 case "NoSubfolder":
2007 index = 2;
2008 break;
2010 $("contentlayout_select").getChildren("option")[index].selected = true;
2011 $("addToTopOfQueueCheckbox").setProperty("checked", pref.add_to_top_of_queue);
2012 $("dontstartdownloads_checkbox").setProperty("checked", pref.add_stopped_enabled);
2013 switch (pref.torrent_stop_condition) {
2014 case "None":
2015 index = 0;
2016 break;
2017 case "MetadataReceived":
2018 index = 1;
2019 break;
2020 case "FilesChecked":
2021 index = 2;
2022 break;
2024 $("stopConditionSelect").getChildren("option")[index].selected = true;
2025 $("deletetorrentfileafter_checkbox").setProperty("checked", pref.auto_delete_mode);
2027 $("preallocateall_checkbox").setProperty("checked", pref.preallocate_all);
2028 $("appendext_checkbox").setProperty("checked", pref.incomplete_files_ext);
2029 $("unwantedfolder_checkbox").setProperty("checked", pref.use_unwanted_folder);
2031 // Saving Management
2032 $("default_tmm_combobox").setProperty("value", pref.auto_tmm_enabled);
2033 $("torrent_changed_tmm_combobox").setProperty("value", pref.torrent_changed_tmm_enabled);
2034 $("save_path_changed_tmm_combobox").setProperty("value", pref.save_path_changed_tmm_enabled);
2035 $("category_changed_tmm_combobox").setProperty("value", pref.category_changed_tmm_enabled);
2036 $("use_subcategories_checkbox").setProperty("checked", pref.use_subcategories);
2037 $("savepath_text").setProperty("value", pref.save_path);
2038 $("temppath_checkbox").setProperty("checked", pref.temp_path_enabled);
2039 $("temppath_text").setProperty("value", pref.temp_path);
2040 updateTempDirEnabled();
2041 if (pref.export_dir !== "") {
2042 $("exportdir_checkbox").setProperty("checked", true);
2043 $("exportdir_text").setProperty("value", pref.export_dir);
2045 else {
2046 $("exportdir_checkbox").setProperty("checked", false);
2047 $("exportdir_text").setProperty("value", "");
2049 updateExportDirEnabled();
2050 if (pref.export_dir_fin !== "") {
2051 $("exportdirfin_checkbox").setProperty("checked", true);
2052 $("exportdirfin_text").setProperty("value", pref.export_dir_fin);
2054 else {
2055 $("exportdirfin_checkbox").setProperty("checked", false);
2056 $("exportdirfin_text").setProperty("value", "");
2058 updateExportDirFinEnabled();
2060 // Automatically add torrents from
2061 for (const folder in pref.scan_dirs) {
2062 if (!Object.hasOwn(pref.scan_dirs, folder))
2063 continue;
2065 const folderType = pref.scan_dirs[folder];
2066 let sel = "";
2067 let other = "";
2068 if (typeof folderType === "number") {
2069 sel = (folderType === 0) ? "watch_folder" : "default_folder";
2071 else {
2072 sel = "other";
2073 other = folderType;
2075 addWatchFolder(folder, sel, other);
2077 addWatchFolder();
2079 // Excluded file names
2080 $("excludedFileNamesCheckbox").setProperty("checked", pref.excluded_file_names_enabled);
2081 $("excludedFileNamesTextarea").setProperty("value", pref.excluded_file_names);
2083 // Email notification upon download completion
2084 $("mail_notification_checkbox").setProperty("checked", pref.mail_notification_enabled);
2085 $("src_email_txt").setProperty("value", pref.mail_notification_sender);
2086 $("dest_email_txt").setProperty("value", pref.mail_notification_email);
2087 $("smtp_server_txt").setProperty("value", pref.mail_notification_smtp);
2088 $("mail_ssl_checkbox").setProperty("checked", pref.mail_notification_ssl_enabled);
2089 $("mail_auth_checkbox").setProperty("checked", pref.mail_notification_auth_enabled);
2090 $("mail_username_text").setProperty("value", pref.mail_notification_username);
2091 $("mail_password_text").setProperty("value", pref.mail_notification_password);
2092 updateMailNotification();
2093 updateMailAuthSettings();
2095 // Run an external program on torrent added
2096 $("autorunOnTorrentAddedCheckbox").setProperty("checked", pref.autorun_on_torrent_added_enabled);
2097 $("autorunOnTorrentAddedProgram").setProperty("value", pref.autorun_on_torrent_added_program);
2098 updateAutoRunOnTorrentAdded();
2099 // Run an external program on torrent finished
2100 $("autorun_checkbox").setProperty("checked", pref.autorun_enabled);
2101 $("autorunProg_txt").setProperty("value", pref.autorun_program);
2102 updateAutoRun();
2104 // Connection tab
2105 // Listening Port
2106 $("port_value").setProperty("value", pref.listen_port.toInt());
2107 $("upnp_checkbox").setProperty("checked", pref.upnp);
2109 // Connections Limits
2110 const max_connec = pref.max_connec.toInt();
2111 if (max_connec <= 0) {
2112 $("max_connec_checkbox").setProperty("checked", false);
2113 $("max_connec_value").setProperty("value", 500);
2115 else {
2116 $("max_connec_checkbox").setProperty("checked", true);
2117 $("max_connec_value").setProperty("value", max_connec);
2119 updateMaxConnecEnabled();
2120 const max_connec_per_torrent = pref.max_connec_per_torrent.toInt();
2121 if (max_connec_per_torrent <= 0) {
2122 $("max_connec_per_torrent_checkbox").setProperty("checked", false);
2123 $("max_connec_per_torrent_value").setProperty("value", 100);
2125 else {
2126 $("max_connec_per_torrent_checkbox").setProperty("checked", true);
2127 $("max_connec_per_torrent_value").setProperty("value", max_connec_per_torrent);
2129 updateMaxConnecPerTorrentEnabled();
2130 const max_uploads = pref.max_uploads.toInt();
2131 if (max_uploads <= 0) {
2132 $("max_uploads_checkbox").setProperty("checked", false);
2133 $("max_uploads_value").setProperty("value", 8);
2135 else {
2136 $("max_uploads_checkbox").setProperty("checked", true);
2137 $("max_uploads_value").setProperty("value", max_uploads);
2139 updateMaxUploadsEnabled();
2140 const max_uploads_per_torrent = pref.max_uploads_per_torrent.toInt();
2141 if (max_uploads_per_torrent <= 0) {
2142 $("max_uploads_per_torrent_checkbox").setProperty("checked", false);
2143 $("max_uploads_per_torrent_value").setProperty("value", 4);
2145 else {
2146 $("max_uploads_per_torrent_checkbox").setProperty("checked", true);
2147 $("max_uploads_per_torrent_value").setProperty("value", max_uploads_per_torrent);
2149 updateMaxUploadsPerTorrentEnabled();
2151 // I2P
2152 $("i2pEnabledCheckbox").setProperty("checked", pref.i2p_enabled);
2153 $("i2pAddress").setProperty("value", pref.i2p_address);
2154 $("i2pPort").setProperty("value", pref.i2p_port);
2155 $("i2pMixedMode").setProperty("checked", pref.i2p_mixed_mode);
2156 updateI2PSettingsEnabled();
2158 // Proxy Server
2159 $("peer_proxy_type_select").setProperty("value", pref.proxy_type);
2160 $("peer_proxy_host_text").setProperty("value", pref.proxy_ip);
2161 $("peer_proxy_port_value").setProperty("value", pref.proxy_port);
2162 $("peer_proxy_auth_checkbox").setProperty("checked", pref.proxy_auth_enabled);
2163 $("peer_proxy_username_text").setProperty("value", pref.proxy_username);
2164 $("peer_proxy_password_text").setProperty("value", pref.proxy_password);
2165 $("proxyHostnameLookupCheckbox").setProperty("checked", pref.proxy_hostname_lookup);
2166 $("proxy_bittorrent_checkbox").setProperty("checked", pref.proxy_bittorrent);
2167 $("use_peer_proxy_checkbox").setProperty("checked", pref.proxy_peer_connections);
2168 $("proxy_rss_checkbox").setProperty("checked", pref.proxy_rss);
2169 $("proxy_misc_checkbox").setProperty("checked", pref.proxy_misc);
2170 updatePeerProxySettings();
2172 // IP Filtering
2173 $("ipfilter_text_checkbox").setProperty("checked", pref.ip_filter_enabled);
2174 $("ipfilter_text").setProperty("value", pref.ip_filter_path);
2175 $("ipfilter_trackers_checkbox").setProperty("checked", pref.ip_filter_trackers);
2176 $("banned_IPs_textarea").setProperty("value", pref.banned_IPs);
2177 updateFilterSettings();
2179 // Speed tab
2180 // Global Rate Limits
2181 $("up_limit_value").setProperty("value", (pref.up_limit.toInt() / 1024));
2182 $("dl_limit_value").setProperty("value", (pref.dl_limit.toInt() / 1024));
2183 // Alternative Global Rate Limits
2184 $("alt_up_limit_value").setProperty("value", (pref.alt_up_limit.toInt() / 1024));
2185 $("alt_dl_limit_value").setProperty("value", (pref.alt_dl_limit.toInt() / 1024));
2187 $("enable_protocol_combobox").setProperty("value", pref.bittorrent_protocol);
2188 $("limit_utp_rate_checkbox").setProperty("checked", pref.limit_utp_rate);
2189 $("limit_tcp_overhead_checkbox").setProperty("checked", pref.limit_tcp_overhead);
2190 $("limit_lan_peers_checkbox").setProperty("checked", pref.limit_lan_peers);
2192 // Scheduling
2193 $("limitSchedulingCheckbox").setProperty("checked", pref.scheduler_enabled);
2194 $("schedule_from_hour").setProperty("value", time_padding(pref.schedule_from_hour));
2195 $("schedule_from_min").setProperty("value", time_padding(pref.schedule_from_min));
2196 $("schedule_to_hour").setProperty("value", time_padding(pref.schedule_to_hour));
2197 $("schedule_to_min").setProperty("value", time_padding(pref.schedule_to_min));
2198 $("schedule_freq_select").setProperty("value", pref.scheduler_days);
2199 updateSchedulingEnabled();
2201 // Bittorrent tab
2202 // Privacy
2203 $("dht_checkbox").setProperty("checked", pref.dht);
2204 $("pex_checkbox").setProperty("checked", pref.pex);
2205 $("lsd_checkbox").setProperty("checked", pref.lsd);
2206 const encryption = pref.encryption.toInt();
2207 $("encryption_select").getChildren("option")[encryption].selected = true;
2208 $("anonymous_mode_checkbox").setProperty("checked", pref.anonymous_mode);
2210 $("maxActiveCheckingTorrents").setProperty("value", pref.max_active_checking_torrents);
2212 // Torrent Queueing
2213 $("queueing_checkbox").setProperty("checked", pref.queueing_enabled);
2214 $("max_active_dl_value").setProperty("value", pref.max_active_downloads.toInt());
2215 $("max_active_up_value").setProperty("value", pref.max_active_uploads.toInt());
2216 $("max_active_to_value").setProperty("value", pref.max_active_torrents.toInt());
2217 $("dont_count_slow_torrents_checkbox").setProperty("checked", pref.dont_count_slow_torrents);
2218 $("dl_rate_threshold").setProperty("value", pref.slow_torrent_dl_rate_threshold.toInt());
2219 $("ul_rate_threshold").setProperty("value", pref.slow_torrent_ul_rate_threshold.toInt());
2220 $("torrent_inactive_timer").setProperty("value", pref.slow_torrent_inactive_timer.toInt());
2221 updateQueueingSystem();
2223 // Share Limiting
2224 $("max_ratio_checkbox").setProperty("checked", pref.max_ratio_enabled);
2225 $("max_ratio_value").setProperty("value", (pref.max_ratio_enabled ? pref.max_ratio : 1));
2226 $("max_seeding_time_checkbox").setProperty("checked", pref.max_seeding_time_enabled);
2227 $("max_seeding_time_value").setProperty("value", (pref.max_seeding_time_enabled ? pref.max_seeding_time.toInt() : 1440));
2228 $("max_inactive_seeding_time_checkbox").setProperty("checked", pref.max_inactive_seeding_time_enabled);
2229 $("max_inactive_seeding_time_value").setProperty("value", (pref.max_inactive_seeding_time_enabled ? pref.max_inactive_seeding_time.toInt() : 1440));
2230 let maxRatioAct = 0;
2231 switch (pref.max_ratio_act.toInt()) {
2232 case 0: // Stop
2233 default:
2234 maxRatioAct = 0;
2235 break;
2236 case 1: // Remove
2237 maxRatioAct = 1;
2238 break;
2239 case 2: // Enable super seeding
2240 maxRatioAct = 3;
2241 break;
2242 case 3: // Remove torrent and files
2243 maxRatioAct = 2;
2244 break;
2246 $("max_ratio_act").getChildren("option")[maxRatioAct].selected = true;
2247 updateMaxRatioTimeEnabled();
2249 // Add trackers
2250 $("add_trackers_checkbox").setProperty("checked", pref.add_trackers_enabled);
2251 $("add_trackers_textarea").setProperty("value", pref.add_trackers);
2252 updateAddTrackersEnabled();
2254 // RSS Tab
2255 $("enable_fetching_rss_feeds_checkbox").setProperty("checked", pref.rss_processing_enabled);
2256 $("feed_refresh_interval").setProperty("value", pref.rss_refresh_interval);
2257 $("feedFetchDelay").setProperty("value", pref.rss_fetch_delay);
2258 $("maximum_article_number").setProperty("value", pref.rss_max_articles_per_feed);
2259 $("enable_auto_downloading_rss_torrents_checkbox").setProperty("checked", pref.rss_auto_downloading_enabled);
2260 $("downlock_repack_proper_episodes").setProperty("checked", pref.rss_download_repack_proper_episodes);
2261 $("rss_filter_textarea").setProperty("value", pref.rss_smart_episode_filters);
2263 // WebUI tab
2264 // Language
2265 updateWebuiLocaleSelect(pref.locale);
2266 $("performanceWarning").setProperty("checked", pref.performance_warning);
2268 // HTTP Server
2269 $("webui_domain_textarea").setProperty("value", pref.web_ui_domain_list);
2270 $("webui_address_value").setProperty("value", pref.web_ui_address);
2271 $("webui_port_value").setProperty("value", pref.web_ui_port);
2272 $("webui_upnp_checkbox").setProperty("checked", pref.web_ui_upnp);
2273 $("use_https_checkbox").setProperty("checked", pref.use_https);
2274 $("ssl_cert_text").setProperty("value", pref.web_ui_https_cert_path);
2275 $("ssl_key_text").setProperty("value", pref.web_ui_https_key_path);
2276 updateHttpsSettings();
2278 // Authentication
2279 $("webui_username_text").setProperty("value", pref.web_ui_username);
2280 $("bypass_local_auth_checkbox").setProperty("checked", pref.bypass_local_auth);
2281 $("bypass_auth_subnet_whitelist_checkbox").setProperty("checked", pref.bypass_auth_subnet_whitelist_enabled);
2282 $("bypass_auth_subnet_whitelist_textarea").setProperty("value", pref.bypass_auth_subnet_whitelist);
2283 updateBypasssAuthSettings();
2284 $("webUIMaxAuthFailCountInput").setProperty("value", pref.web_ui_max_auth_fail_count.toInt());
2285 $("webUIBanDurationInput").setProperty("value", pref.web_ui_ban_duration.toInt());
2286 $("webUISessionTimeoutInput").setProperty("value", pref.web_ui_session_timeout.toInt());
2288 // Use alternative WebUI
2289 $("use_alt_webui_checkbox").setProperty("checked", pref.alternative_webui_enabled);
2290 $("webui_files_location_textarea").setProperty("value", pref.alternative_webui_path);
2291 updateAlternativeWebUISettings();
2293 // Security
2294 $("clickjacking_protection_checkbox").setProperty("checked", pref.web_ui_clickjacking_protection_enabled);
2295 $("csrf_protection_checkbox").setProperty("checked", pref.web_ui_csrf_protection_enabled);
2296 $("secureCookieCheckbox").setProperty("checked", pref.web_ui_secure_cookie_enabled);
2297 $("host_header_validation_checkbox").setProperty("checked", pref.web_ui_host_header_validation_enabled);
2298 updateHostHeaderValidationSettings();
2300 // Custom HTTP headers
2301 $("webUIUseCustomHTTPHeadersCheckbox").setProperty("checked", pref.web_ui_use_custom_http_headers_enabled);
2302 $("webUICustomHTTPHeadersTextarea").setProperty("value", pref.web_ui_custom_http_headers);
2303 updateWebUICustomHTTPHeadersSettings();
2305 // Reverse Proxy
2306 $("webUIReverseProxySupportCheckbox").setProperty("checked", pref.web_ui_reverse_proxy_enabled);
2307 $("webUIReverseProxiesListTextarea").setProperty("value", pref.web_ui_reverse_proxies_list);
2308 updateWebUIReverseProxySettings();
2310 // Update my dynamic domain name
2311 $("use_dyndns_checkbox").setProperty("checked", pref.dyndns_enabled);
2312 $("dyndns_select").setProperty("value", pref.dyndns_service);
2313 $("dyndns_domain_text").setProperty("value", pref.dyndns_domain);
2314 $("dyndns_username_text").setProperty("value", pref.dyndns_username);
2315 $("dyndns_password_text").setProperty("value", pref.dyndns_password);
2316 updateDynDnsSettings();
2318 // Advanced settings
2319 // qBittorrent section
2320 $("resumeDataStorageType").setProperty("value", pref.resume_data_storage_type);
2321 $("memoryWorkingSetLimit").setProperty("value", pref.memory_working_set_limit);
2322 updateNetworkInterfaces(pref.current_network_interface, pref.current_interface_name);
2323 updateInterfaceAddresses(pref.current_network_interface, pref.current_interface_address);
2324 $("saveResumeDataInterval").setProperty("value", pref.save_resume_data_interval);
2325 $("torrentFileSizeLimit").setProperty("value", (pref.torrent_file_size_limit / 1024 / 1024));
2326 $("recheckTorrentsOnCompletion").setProperty("checked", pref.recheck_completed_torrents);
2327 $("appInstanceName").setProperty("value", pref.app_instance_name);
2328 $("refreshInterval").setProperty("value", pref.refresh_interval);
2329 $("resolvePeerCountries").setProperty("checked", pref.resolve_peer_countries);
2330 $("reannounceWhenAddressChanged").setProperty("checked", pref.reannounce_when_address_changed);
2331 // libtorrent section
2332 $("bdecodeDepthLimit").setProperty("value", pref.bdecode_depth_limit);
2333 $("bdecodeTokenLimit").setProperty("value", pref.bdecode_token_limit);
2334 $("asyncIOThreads").setProperty("value", pref.async_io_threads);
2335 $("hashingThreads").setProperty("value", pref.hashing_threads);
2336 $("filePoolSize").setProperty("value", pref.file_pool_size);
2337 $("outstandMemoryWhenCheckingTorrents").setProperty("value", pref.checking_memory_use);
2338 $("diskCache").setProperty("value", pref.disk_cache);
2339 $("diskCacheExpiryInterval").setProperty("value", pref.disk_cache_ttl);
2340 $("diskQueueSize").setProperty("value", (pref.disk_queue_size / 1024));
2341 $("diskIOType").setProperty("value", pref.disk_io_type);
2342 $("diskIOReadMode").setProperty("value", pref.disk_io_read_mode);
2343 $("diskIOWriteMode").setProperty("value", pref.disk_io_write_mode);
2344 $("coalesceReadsAndWrites").setProperty("checked", pref.enable_coalesce_read_write);
2345 $("pieceExtentAffinity").setProperty("checked", pref.enable_piece_extent_affinity);
2346 $("sendUploadPieceSuggestions").setProperty("checked", pref.enable_upload_suggestions);
2347 $("sendBufferWatermark").setProperty("value", pref.send_buffer_watermark);
2348 $("sendBufferLowWatermark").setProperty("value", pref.send_buffer_low_watermark);
2349 $("sendBufferWatermarkFactor").setProperty("value", pref.send_buffer_watermark_factor);
2350 $("connectionSpeed").setProperty("value", pref.connection_speed);
2351 $("socketSendBufferSize").setProperty("value", (pref.socket_send_buffer_size / 1024));
2352 $("socketReceiveBufferSize").setProperty("value", (pref.socket_receive_buffer_size / 1024));
2353 $("socketBacklogSize").setProperty("value", pref.socket_backlog_size);
2354 $("outgoingPortsMin").setProperty("value", pref.outgoing_ports_min);
2355 $("outgoingPortsMax").setProperty("value", pref.outgoing_ports_max);
2356 $("UPnPLeaseDuration").setProperty("value", pref.upnp_lease_duration);
2357 $("peerToS").setProperty("value", pref.peer_tos);
2358 $("utpTCPMixedModeAlgorithm").setProperty("value", pref.utp_tcp_mixed_mode);
2359 $("IDNSupportCheckbox").setProperty("checked", pref.idn_support_enabled);
2360 $("allowMultipleConnectionsFromTheSameIPAddress").setProperty("checked", pref.enable_multi_connections_from_same_ip);
2361 $("validateHTTPSTrackerCertificate").setProperty("checked", pref.validate_https_tracker_certificate);
2362 $("mitigateSSRF").setProperty("checked", pref.ssrf_mitigation);
2363 $("blockPeersOnPrivilegedPorts").setProperty("checked", pref.block_peers_on_privileged_ports);
2364 $("enableEmbeddedTracker").setProperty("checked", pref.enable_embedded_tracker);
2365 $("embeddedTrackerPort").setProperty("value", pref.embedded_tracker_port);
2366 $("embeddedTrackerPortForwarding").setProperty("checked", pref.embedded_tracker_port_forwarding);
2367 $("markOfTheWeb").setProperty("checked", pref.mark_of_the_web);
2368 $("pythonExecutablePath").setProperty("value", pref.python_executable_path);
2369 $("uploadSlotsBehavior").setProperty("value", pref.upload_slots_behavior);
2370 $("uploadChokingAlgorithm").setProperty("value", pref.upload_choking_algorithm);
2371 $("announceAllTrackers").setProperty("checked", pref.announce_to_all_trackers);
2372 $("announceAllTiers").setProperty("checked", pref.announce_to_all_tiers);
2373 $("announceIP").setProperty("value", pref.announce_ip);
2374 $("maxConcurrentHTTPAnnounces").setProperty("value", pref.max_concurrent_http_announces);
2375 $("stopTrackerTimeout").setProperty("value", pref.stop_tracker_timeout);
2376 $("peerTurnover").setProperty("value", pref.peer_turnover);
2377 $("peerTurnoverCutoff").setProperty("value", pref.peer_turnover_cutoff);
2378 $("peerTurnoverInterval").setProperty("value", pref.peer_turnover_interval);
2379 $("requestQueueSize").setProperty("value", pref.request_queue_size);
2380 $("dhtBootstrapNodes").setProperty("value", pref.dht_bootstrap_nodes);
2381 $("i2pInboundQuantity").setProperty("value", pref.i2p_inbound_quantity);
2382 $("i2pOutboundQuantity").setProperty("value", pref.i2p_outbound_quantity);
2383 $("i2pInboundLength").setProperty("value", pref.i2p_inbound_length);
2384 $("i2pOutboundLength").setProperty("value", pref.i2p_outbound_length);
2389 const applyPreferences = function() {
2390 const settings = {};
2391 // Validate form data
2393 // Behavior tab
2394 settings["file_log_enabled"] = $("filelog_checkbox").getProperty("checked");
2395 settings["file_log_path"] = $("filelog_save_path_input").getProperty("value");
2396 settings["file_log_backup_enabled"] = $("filelog_backup_checkbox").getProperty("checked");
2397 settings["file_log_max_size"] = Number($("filelog_max_size_input").getProperty("value"));
2398 settings["file_log_delete_old"] = $("filelog_delete_old_checkbox").getProperty("checked");
2399 settings["file_log_age"] = Number($("filelog_age_input").getProperty("value"));
2400 settings["file_log_age_type"] = Number($("filelog_age_type_select").getProperty("value"));
2402 // Downloads tab
2403 // When adding a torrent
2404 settings["torrent_content_layout"] = $("contentlayout_select").getSelected()[0].getProperty("value");
2405 settings["add_to_top_of_queue"] = $("addToTopOfQueueCheckbox").getProperty("checked");
2406 settings["add_stopped_enabled"] = $("dontstartdownloads_checkbox").getProperty("checked");
2407 settings["torrent_stop_condition"] = $("stopConditionSelect").getSelected()[0].getProperty("value");
2408 settings["auto_delete_mode"] = Number($("deletetorrentfileafter_checkbox").getProperty("checked"));
2410 settings["preallocate_all"] = $("preallocateall_checkbox").getProperty("checked");
2411 settings["incomplete_files_ext"] = $("appendext_checkbox").getProperty("checked");
2412 settings["use_unwanted_folder"] = $("unwantedfolder_checkbox").getProperty("checked");
2414 // Saving Management
2415 settings["auto_tmm_enabled"] = ($("default_tmm_combobox").getProperty("value") === "true");
2416 settings["torrent_changed_tmm_enabled"] = ($("torrent_changed_tmm_combobox").getProperty("value") === "true");
2417 settings["save_path_changed_tmm_enabled"] = ($("save_path_changed_tmm_combobox").getProperty("value") === "true");
2418 settings["category_changed_tmm_enabled"] = ($("category_changed_tmm_combobox").getProperty("value") === "true");
2419 settings["use_subcategories"] = $("use_subcategories_checkbox").getProperty("checked");
2420 settings["save_path"] = $("savepath_text").getProperty("value");
2421 settings["temp_path_enabled"] = $("temppath_checkbox").getProperty("checked");
2422 settings["temp_path"] = $("temppath_text").getProperty("value");
2423 if ($("exportdir_checkbox").getProperty("checked"))
2424 settings["export_dir"] = $("exportdir_text").getProperty("value");
2425 else
2426 settings["export_dir"] = "";
2427 if ($("exportdirfin_checkbox").getProperty("checked"))
2428 settings["export_dir_fin"] = $("exportdirfin_text").getProperty("value");
2429 else
2430 settings["export_dir_fin"] = "";
2432 // Automatically add torrents from
2433 settings["scan_dirs"] = getWatchedFolders();
2435 // Excluded file names
2436 settings["excluded_file_names_enabled"] = $("excludedFileNamesCheckbox").getProperty("checked");
2437 settings["excluded_file_names"] = $("excludedFileNamesTextarea").getProperty("value");
2439 // Email notification upon download completion
2440 settings["mail_notification_enabled"] = $("mail_notification_checkbox").getProperty("checked");
2441 settings["mail_notification_sender"] = $("src_email_txt").getProperty("value");
2442 settings["mail_notification_email"] = $("dest_email_txt").getProperty("value");
2443 settings["mail_notification_smtp"] = $("smtp_server_txt").getProperty("value");
2444 settings["mail_notification_ssl_enabled"] = $("mail_ssl_checkbox").getProperty("checked");
2445 settings["mail_notification_auth_enabled"] = $("mail_auth_checkbox").getProperty("checked");
2446 settings["mail_notification_username"] = $("mail_username_text").getProperty("value");
2447 settings["mail_notification_password"] = $("mail_password_text").getProperty("value");
2449 // Run an external program on torrent added
2450 settings["autorun_on_torrent_added_enabled"] = $("autorunOnTorrentAddedCheckbox").getProperty("checked");
2451 settings["autorun_on_torrent_added_program"] = $("autorunOnTorrentAddedProgram").getProperty("value");
2452 // Run an external program on torrent finished
2453 settings["autorun_enabled"] = $("autorun_checkbox").getProperty("checked");
2454 settings["autorun_program"] = $("autorunProg_txt").getProperty("value");
2456 // Connection tab
2457 // Listening Port
2458 const listen_port = $("port_value").getProperty("value").toInt();
2459 if (isNaN(listen_port) || (listen_port < 0) || (listen_port > 65535)) {
2460 alert("QBT_TR(The port used for incoming connections must be between 0 and 65535.)QBT_TR[CONTEXT=HttpServer]");
2461 return;
2463 settings["listen_port"] = listen_port;
2464 settings["upnp"] = $("upnp_checkbox").getProperty("checked");
2466 // Connections Limits
2467 let max_connec = -1;
2468 if ($("max_connec_checkbox").getProperty("checked")) {
2469 max_connec = $("max_connec_value").getProperty("value").toInt();
2470 if (isNaN(max_connec) || (max_connec <= 0)) {
2471 alert("QBT_TR(Maximum number of connections limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2472 return;
2475 settings["max_connec"] = max_connec;
2476 let max_connec_per_torrent = -1;
2477 if ($("max_connec_per_torrent_checkbox").getProperty("checked")) {
2478 max_connec_per_torrent = $("max_connec_per_torrent_value").getProperty("value").toInt();
2479 if (isNaN(max_connec_per_torrent) || (max_connec_per_torrent <= 0)) {
2480 alert("QBT_TR(Maximum number of connections per torrent limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2481 return;
2484 settings["max_connec_per_torrent"] = max_connec_per_torrent;
2485 let max_uploads = -1;
2486 if ($("max_uploads_checkbox").getProperty("checked")) {
2487 max_uploads = $("max_uploads_value").getProperty("value").toInt();
2488 if (isNaN(max_uploads) || (max_uploads <= 0)) {
2489 alert("QBT_TR(Global number of upload slots limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2490 return;
2493 settings["max_uploads"] = max_uploads;
2494 let max_uploads_per_torrent = -1;
2495 if ($("max_uploads_per_torrent_checkbox").getProperty("checked")) {
2496 max_uploads_per_torrent = $("max_uploads_per_torrent_value").getProperty("value").toInt();
2497 if (isNaN(max_uploads_per_torrent) || (max_uploads_per_torrent <= 0)) {
2498 alert("QBT_TR(Maximum number of upload slots per torrent limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2499 return;
2502 settings["max_uploads_per_torrent"] = max_uploads_per_torrent;
2504 // I2P
2505 settings["i2p_enabled"] = $("i2pEnabledCheckbox").getProperty("checked");
2506 settings["i2p_address"] = $("i2pAddress").getProperty("value");
2507 settings["i2p_port"] = $("i2pPort").getProperty("value").toInt();
2508 settings["i2p_mixed_mode"] = $("i2pMixedMode").getProperty("checked");
2510 // Proxy Server
2511 settings["proxy_type"] = $("peer_proxy_type_select").getProperty("value");
2512 settings["proxy_ip"] = $("peer_proxy_host_text").getProperty("value");
2513 settings["proxy_port"] = $("peer_proxy_port_value").getProperty("value").toInt();
2514 settings["proxy_auth_enabled"] = $("peer_proxy_auth_checkbox").getProperty("checked");
2515 settings["proxy_username"] = $("peer_proxy_username_text").getProperty("value");
2516 settings["proxy_password"] = $("peer_proxy_password_text").getProperty("value");
2517 settings["proxy_hostname_lookup"] = $("proxyHostnameLookupCheckbox").getProperty("checked");
2518 settings["proxy_bittorrent"] = $("proxy_bittorrent_checkbox").getProperty("checked");
2519 settings["proxy_peer_connections"] = $("use_peer_proxy_checkbox").getProperty("checked");
2520 settings["proxy_rss"] = $("proxy_rss_checkbox").getProperty("checked");
2521 settings["proxy_misc"] = $("proxy_misc_checkbox").getProperty("checked");
2523 // IP Filtering
2524 settings["ip_filter_enabled"] = $("ipfilter_text_checkbox").getProperty("checked");
2525 settings["ip_filter_path"] = $("ipfilter_text").getProperty("value");
2526 settings["ip_filter_trackers"] = $("ipfilter_trackers_checkbox").getProperty("checked");
2527 settings["banned_IPs"] = $("banned_IPs_textarea").getProperty("value");
2529 // Speed tab
2530 // Global Rate Limits
2531 const up_limit = $("up_limit_value").getProperty("value").toInt() * 1024;
2532 if (isNaN(up_limit) || (up_limit < 0)) {
2533 alert("QBT_TR(Global upload rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2534 return;
2536 settings["up_limit"] = up_limit;
2538 const dl_limit = $("dl_limit_value").getProperty("value").toInt() * 1024;
2539 if (isNaN(dl_limit) || (dl_limit < 0)) {
2540 alert("QBT_TR(Global download rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2541 return;
2543 settings["dl_limit"] = dl_limit;
2545 // Alternative Global Rate Limits
2546 const alt_up_limit = $("alt_up_limit_value").getProperty("value").toInt() * 1024;
2547 if (isNaN(alt_up_limit) || (alt_up_limit < 0)) {
2548 alert("QBT_TR(Alternative upload rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2549 return;
2551 settings["alt_up_limit"] = alt_up_limit;
2553 const alt_dl_limit = $("alt_dl_limit_value").getProperty("value").toInt() * 1024;
2554 if (isNaN(alt_dl_limit) || (alt_dl_limit < 0)) {
2555 alert("QBT_TR(Alternative download rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2556 return;
2558 settings["alt_dl_limit"] = alt_dl_limit;
2560 settings["bittorrent_protocol"] = Number($("enable_protocol_combobox").getProperty("value"));
2561 settings["limit_utp_rate"] = $("limit_utp_rate_checkbox").getProperty("checked");
2562 settings["limit_tcp_overhead"] = $("limit_tcp_overhead_checkbox").getProperty("checked");
2563 settings["limit_lan_peers"] = $("limit_lan_peers_checkbox").getProperty("checked");
2565 // Scheduler
2566 const scheduling_enabled = $("limitSchedulingCheckbox").getProperty("checked");
2567 settings["scheduler_enabled"] = scheduling_enabled;
2568 if (scheduling_enabled) {
2569 settings["schedule_from_hour"] = $("schedule_from_hour").getProperty("value").toInt();
2570 settings["schedule_from_min"] = $("schedule_from_min").getProperty("value").toInt();
2571 settings["schedule_to_hour"] = $("schedule_to_hour").getProperty("value").toInt();
2572 settings["schedule_to_min"] = $("schedule_to_min").getProperty("value").toInt();
2573 settings["scheduler_days"] = $("schedule_freq_select").getProperty("value").toInt();
2576 // Bittorrent tab
2577 // Privacy
2578 settings["dht"] = $("dht_checkbox").getProperty("checked");
2579 settings["pex"] = $("pex_checkbox").getProperty("checked");
2580 settings["lsd"] = $("lsd_checkbox").getProperty("checked");
2581 settings["encryption"] = Number($("encryption_select").getSelected()[0].getProperty("value"));
2582 settings["anonymous_mode"] = $("anonymous_mode_checkbox").getProperty("checked");
2584 settings["max_active_checking_torrents"] = Number($("maxActiveCheckingTorrents").getProperty("value"));
2586 // Torrent Queueing
2587 settings["queueing_enabled"] = $("queueing_checkbox").getProperty("checked");
2588 if ($("queueing_checkbox").getProperty("checked")) {
2589 const max_active_downloads = $("max_active_dl_value").getProperty("value").toInt();
2590 if (isNaN(max_active_downloads) || (max_active_downloads < -1)) {
2591 alert("QBT_TR(Maximum active downloads must be greater than -1.)QBT_TR[CONTEXT=HttpServer]");
2592 return;
2594 settings["max_active_downloads"] = max_active_downloads;
2595 const max_active_uploads = $("max_active_up_value").getProperty("value").toInt();
2596 if (isNaN(max_active_uploads) || (max_active_uploads < -1)) {
2597 alert("QBT_TR(Maximum active uploads must be greater than -1.)QBT_TR[CONTEXT=HttpServer]");
2598 return;
2600 settings["max_active_uploads"] = max_active_uploads;
2601 const max_active_torrents = $("max_active_to_value").getProperty("value").toInt();
2602 if (isNaN(max_active_torrents) || (max_active_torrents < -1)) {
2603 alert("QBT_TR(Maximum active torrents must be greater than -1.)QBT_TR[CONTEXT=HttpServer]");
2604 return;
2606 settings["max_active_torrents"] = max_active_torrents;
2607 settings["dont_count_slow_torrents"] = $("dont_count_slow_torrents_checkbox").getProperty("checked");
2608 const dl_rate_threshold = $("dl_rate_threshold").getProperty("value").toInt();
2609 if (isNaN(dl_rate_threshold) || (dl_rate_threshold < 1)) {
2610 alert("QBT_TR(Download rate threshold must be greater than 0.)QBT_TR[CONTEXT=HttpServer]");
2611 return;
2613 settings["slow_torrent_dl_rate_threshold"] = dl_rate_threshold;
2614 const ul_rate_threshold = $("ul_rate_threshold").getProperty("value").toInt();
2615 if (isNaN(ul_rate_threshold) || (ul_rate_threshold < 1)) {
2616 alert("QBT_TR(Upload rate threshold must be greater than 0.)QBT_TR[CONTEXT=HttpServer]");
2617 return;
2619 settings["slow_torrent_ul_rate_threshold"] = ul_rate_threshold;
2620 const torrent_inactive_timer = $("torrent_inactive_timer").getProperty("value").toInt();
2621 if (isNaN(torrent_inactive_timer) || (torrent_inactive_timer < 1)) {
2622 alert("QBT_TR(Torrent inactivity timer must be greater than 0.)QBT_TR[CONTEXT=HttpServer]");
2623 return;
2625 settings["slow_torrent_inactive_timer"] = torrent_inactive_timer;
2628 // Share Ratio Limiting
2629 let max_ratio = -1;
2630 if ($("max_ratio_checkbox").getProperty("checked")) {
2631 max_ratio = $("max_ratio_value").getProperty("value").toFloat();
2632 if (isNaN(max_ratio) || (max_ratio < 0) || (max_ratio > 9998)) {
2633 alert("QBT_TR(Share ratio limit must be between 0 and 9998.)QBT_TR[CONTEXT=HttpServer]");
2634 return;
2637 settings["max_ratio_enabled"] = $("max_ratio_checkbox").getProperty("checked");
2638 settings["max_ratio"] = max_ratio;
2640 let max_seeding_time = -1;
2641 if ($("max_seeding_time_checkbox").getProperty("checked")) {
2642 max_seeding_time = $("max_seeding_time_value").getProperty("value").toInt();
2643 if (isNaN(max_seeding_time) || (max_seeding_time < 0) || (max_seeding_time > 525600)) {
2644 alert("QBT_TR(Seeding time limit must be between 0 and 525600 minutes.)QBT_TR[CONTEXT=HttpServer]");
2645 return;
2648 settings["max_seeding_time_enabled"] = $("max_seeding_time_checkbox").getProperty("checked");
2649 settings["max_seeding_time"] = max_seeding_time;
2650 settings["max_ratio_act"] = $("max_ratio_act").getProperty("value").toInt();
2652 let max_inactive_seeding_time = -1;
2653 if ($("max_inactive_seeding_time_checkbox").getProperty("checked")) {
2654 max_inactive_seeding_time = $("max_inactive_seeding_time_value").getProperty("value").toInt();
2655 if (isNaN(max_inactive_seeding_time) || (max_inactive_seeding_time < 0) || (max_inactive_seeding_time > 525600)) {
2656 alert("QBT_TR(Seeding time limit must be between 0 and 525600 minutes.)QBT_TR[CONTEXT=HttpServer]");
2657 return;
2660 settings["max_inactive_seeding_time_enabled"] = $("max_inactive_seeding_time_checkbox").getProperty("checked");
2661 settings["max_inactive_seeding_time"] = max_inactive_seeding_time;
2662 settings["max_ratio_act"] = $("max_ratio_act").getProperty("value").toInt();
2664 // Add trackers
2665 settings["add_trackers_enabled"] = $("add_trackers_checkbox").getProperty("checked");
2666 settings["add_trackers"] = $("add_trackers_textarea").getProperty("value");
2668 // RSS Tab
2669 settings["rss_processing_enabled"] = $("enable_fetching_rss_feeds_checkbox").getProperty("checked");
2670 settings["rss_refresh_interval"] = Number($("feed_refresh_interval").getProperty("value"));
2671 settings["rss_fetch_delay"] = Number($("feedFetchDelay").getProperty("value"));
2672 settings["rss_max_articles_per_feed"] = Number($("maximum_article_number").getProperty("value"));
2673 settings["rss_auto_downloading_enabled"] = $("enable_auto_downloading_rss_torrents_checkbox").getProperty("checked");
2674 settings["rss_download_repack_proper_episodes"] = $("downlock_repack_proper_episodes").getProperty("checked");
2675 settings["rss_smart_episode_filters"] = $("rss_filter_textarea").getProperty("value");
2677 // WebUI tab
2678 // Language
2679 settings["locale"] = $("locale_select").getProperty("value");
2680 settings["performance_warning"] = $("performanceWarning").getProperty("checked");
2682 // HTTP Server
2683 settings["web_ui_domain_list"] = $("webui_domain_textarea").getProperty("value");
2684 const web_ui_address = $("webui_address_value").getProperty("value").toString();
2685 const web_ui_port = $("webui_port_value").getProperty("value").toInt();
2686 if (isNaN(web_ui_port) || (web_ui_port < 1) || (web_ui_port > 65535)) {
2687 alert("QBT_TR(The port used for the WebUI must be between 1 and 65535.)QBT_TR[CONTEXT=HttpServer]");
2688 return;
2690 settings["web_ui_address"] = web_ui_address;
2691 settings["web_ui_port"] = web_ui_port;
2692 settings["web_ui_upnp"] = $("webui_upnp_checkbox").getProperty("checked");
2694 const useHTTPS = $("use_https_checkbox").getProperty("checked");
2695 settings["use_https"] = useHTTPS;
2697 const httpsCertificate = $("ssl_cert_text").getProperty("value");
2698 settings["web_ui_https_cert_path"] = httpsCertificate;
2699 if (useHTTPS && (httpsCertificate.length === 0)) {
2700 alert("QBT_TR(HTTPS certificate should not be empty)QBT_TR[CONTEXT=OptionsDialog]");
2701 return;
2704 const httpsKey = $("ssl_key_text").getProperty("value");
2705 settings["web_ui_https_key_path"] = httpsKey;
2706 if (useHTTPS && (httpsKey.length === 0)) {
2707 alert("QBT_TR(HTTPS key should not be empty)QBT_TR[CONTEXT=OptionsDialog]");
2708 return;
2711 // Authentication
2712 const web_ui_username = $("webui_username_text").getProperty("value");
2713 if (web_ui_username.length < 3) {
2714 alert("QBT_TR(The WebUI username must be at least 3 characters long.)QBT_TR[CONTEXT=OptionsDialog]");
2715 return;
2717 const web_ui_password = $("webui_password_text").getProperty("value");
2718 if ((0 < web_ui_password.length) && (web_ui_password.length < 6)) {
2719 alert("QBT_TR(The WebUI password must be at least 6 characters long.)QBT_TR[CONTEXT=OptionsDialog]");
2720 return;
2723 settings["web_ui_username"] = web_ui_username;
2724 if (web_ui_password.length > 0)
2725 settings["web_ui_password"] = web_ui_password;
2726 settings["bypass_local_auth"] = $("bypass_local_auth_checkbox").getProperty("checked");
2727 settings["bypass_auth_subnet_whitelist_enabled"] = $("bypass_auth_subnet_whitelist_checkbox").getProperty("checked");
2728 settings["bypass_auth_subnet_whitelist"] = $("bypass_auth_subnet_whitelist_textarea").getProperty("value");
2729 settings["web_ui_max_auth_fail_count"] = Number($("webUIMaxAuthFailCountInput").getProperty("value"));
2730 settings["web_ui_ban_duration"] = Number($("webUIBanDurationInput").getProperty("value"));
2731 settings["web_ui_session_timeout"] = Number($("webUISessionTimeoutInput").getProperty("value"));
2733 // Use alternative WebUI
2734 const alternative_webui_enabled = $("use_alt_webui_checkbox").getProperty("checked");
2735 const webui_files_location_textarea = $("webui_files_location_textarea").getProperty("value");
2736 if (alternative_webui_enabled && (webui_files_location_textarea.trim() === "")) {
2737 alert("QBT_TR(The alternative WebUI files location cannot be blank.)QBT_TR[CONTEXT=OptionsDialog]");
2738 return;
2740 settings["alternative_webui_enabled"] = alternative_webui_enabled;
2741 settings["alternative_webui_path"] = webui_files_location_textarea;
2743 // Security
2744 settings["web_ui_clickjacking_protection_enabled"] = $("clickjacking_protection_checkbox").getProperty("checked");
2745 settings["web_ui_csrf_protection_enabled"] = $("csrf_protection_checkbox").getProperty("checked");
2746 settings["web_ui_secure_cookie_enabled"] = $("secureCookieCheckbox").getProperty("checked");
2747 settings["web_ui_host_header_validation_enabled"] = $("host_header_validation_checkbox").getProperty("checked");
2749 // Custom HTTP headers
2750 settings["web_ui_use_custom_http_headers_enabled"] = $("webUIUseCustomHTTPHeadersCheckbox").getProperty("checked");
2751 settings["web_ui_custom_http_headers"] = $("webUICustomHTTPHeadersTextarea").getProperty("value");
2753 // Reverse Proxy
2754 settings["web_ui_reverse_proxy_enabled"] = $("webUIReverseProxySupportCheckbox").getProperty("checked");
2755 settings["web_ui_reverse_proxies_list"] = $("webUIReverseProxiesListTextarea").getProperty("value");
2757 // Update my dynamic domain name
2758 settings["dyndns_enabled"] = $("use_dyndns_checkbox").getProperty("checked");
2759 settings["dyndns_service"] = Number($("dyndns_select").getProperty("value"));
2760 settings["dyndns_domain"] = $("dyndns_domain_text").getProperty("value");
2761 settings["dyndns_username"] = $("dyndns_username_text").getProperty("value");
2762 settings["dyndns_password"] = $("dyndns_password_text").getProperty("value");
2764 // Update advanced settings
2765 // qBittorrent section
2766 settings["resume_data_storage_type"] = $("resumeDataStorageType").getProperty("value");
2767 settings["memory_working_set_limit"] = Number($("memoryWorkingSetLimit").getProperty("value"));
2768 settings["current_network_interface"] = $("networkInterface").getProperty("value");
2769 settings["current_interface_address"] = $("optionalIPAddressToBind").getProperty("value");
2770 settings["save_resume_data_interval"] = Number($("saveResumeDataInterval").getProperty("value"));
2771 settings["torrent_file_size_limit"] = ($("torrentFileSizeLimit").getProperty("value") * 1024 * 1024);
2772 settings["recheck_completed_torrents"] = $("recheckTorrentsOnCompletion").getProperty("checked");
2773 settings["app_instance_name"] = $("appInstanceName").getProperty("value");
2774 settings["refresh_interval"] = Number($("refreshInterval").getProperty("value"));
2775 settings["resolve_peer_countries"] = $("resolvePeerCountries").getProperty("checked");
2776 settings["reannounce_when_address_changed"] = $("reannounceWhenAddressChanged").getProperty("checked");
2778 // libtorrent section
2779 settings["bdecode_depth_limit"] = Number($("bdecodeDepthLimit").getProperty("value"));
2780 settings["bdecode_token_limit"] = Number($("bdecodeTokenLimit").getProperty("value"));
2781 settings["async_io_threads"] = Number($("asyncIOThreads").getProperty("value"));
2782 settings["hashing_threads"] = Number($("hashingThreads").getProperty("value"));
2783 settings["file_pool_size"] = Number($("filePoolSize").getProperty("value"));
2784 settings["checking_memory_use"] = Number($("outstandMemoryWhenCheckingTorrents").getProperty("value"));
2785 settings["disk_cache"] = Number($("diskCache").getProperty("value"));
2786 settings["disk_cache_ttl"] = Number($("diskCacheExpiryInterval").getProperty("value"));
2787 settings["disk_queue_size"] = (Number($("diskQueueSize").getProperty("value")) * 1024);
2788 settings["disk_io_type"] = Number($("diskIOType").getProperty("value"));
2789 settings["disk_io_read_mode"] = Number($("diskIOReadMode").getProperty("value"));
2790 settings["disk_io_write_mode"] = Number($("diskIOWriteMode").getProperty("value"));
2791 settings["enable_coalesce_read_write"] = $("coalesceReadsAndWrites").getProperty("checked");
2792 settings["enable_piece_extent_affinity"] = $("pieceExtentAffinity").getProperty("checked");
2793 settings["enable_upload_suggestions"] = $("sendUploadPieceSuggestions").getProperty("checked");
2794 settings["send_buffer_watermark"] = Number($("sendBufferWatermark").getProperty("value"));
2795 settings["send_buffer_low_watermark"] = Number($("sendBufferLowWatermark").getProperty("value"));
2796 settings["send_buffer_watermark_factor"] = Number($("sendBufferWatermarkFactor").getProperty("value"));
2797 settings["connection_speed"] = Number($("connectionSpeed").getProperty("value"));
2798 settings["socket_send_buffer_size"] = ($("socketSendBufferSize").getProperty("value") * 1024);
2799 settings["socket_receive_buffer_size"] = ($("socketReceiveBufferSize").getProperty("value") * 1024);
2800 settings["socket_backlog_size"] = Number($("socketBacklogSize").getProperty("value"));
2801 settings["outgoing_ports_min"] = Number($("outgoingPortsMin").getProperty("value"));
2802 settings["outgoing_ports_max"] = Number($("outgoingPortsMax").getProperty("value"));
2803 settings["upnp_lease_duration"] = Number($("UPnPLeaseDuration").getProperty("value"));
2804 settings["peer_tos"] = Number($("peerToS").getProperty("value"));
2805 settings["utp_tcp_mixed_mode"] = Number($("utpTCPMixedModeAlgorithm").getProperty("value"));
2806 settings["idn_support_enabled"] = $("IDNSupportCheckbox").getProperty("checked");
2807 settings["enable_multi_connections_from_same_ip"] = $("allowMultipleConnectionsFromTheSameIPAddress").getProperty("checked");
2808 settings["validate_https_tracker_certificate"] = $("validateHTTPSTrackerCertificate").getProperty("checked");
2809 settings["ssrf_mitigation"] = $("mitigateSSRF").getProperty("checked");
2810 settings["block_peers_on_privileged_ports"] = $("blockPeersOnPrivilegedPorts").getProperty("checked");
2811 settings["enable_embedded_tracker"] = $("enableEmbeddedTracker").getProperty("checked");
2812 settings["embedded_tracker_port"] = Number($("embeddedTrackerPort").getProperty("value"));
2813 settings["embedded_tracker_port_forwarding"] = $("embeddedTrackerPortForwarding").getProperty("checked");
2814 settings["mark_of_the_web"] = $("markOfTheWeb").getProperty("checked");
2815 settings["python_executable_path"] = $("pythonExecutablePath").getProperty("value");
2816 settings["upload_slots_behavior"] = Number($("uploadSlotsBehavior").getProperty("value"));
2817 settings["upload_choking_algorithm"] = Number($("uploadChokingAlgorithm").getProperty("value"));
2818 settings["announce_to_all_trackers"] = $("announceAllTrackers").getProperty("checked");
2819 settings["announce_to_all_tiers"] = $("announceAllTiers").getProperty("checked");
2820 settings["announce_ip"] = $("announceIP").getProperty("value");
2821 settings["max_concurrent_http_announces"] = Number($("maxConcurrentHTTPAnnounces").getProperty("value"));
2822 settings["stop_tracker_timeout"] = Number($("stopTrackerTimeout").getProperty("value"));
2823 settings["peer_turnover"] = Number($("peerTurnover").getProperty("value"));
2824 settings["peer_turnover_cutoff"] = Number($("peerTurnoverCutoff").getProperty("value"));
2825 settings["peer_turnover_interval"] = Number($("peerTurnoverInterval").getProperty("value"));
2826 settings["request_queue_size"] = Number($("requestQueueSize").getProperty("value"));
2827 settings["dht_bootstrap_nodes"] = $("dhtBootstrapNodes").getProperty("value");
2828 settings["i2p_inbound_quantity"] = Number($("i2pInboundQuantity").getProperty("value"));
2829 settings["i2p_outbound_quantity"] = Number($("i2pOutboundQuantity").getProperty("value"));
2830 settings["i2p_inbound_length"] = Number($("i2pInboundLength").getProperty("value"));
2831 settings["i2p_outbound_length"] = Number($("i2pOutboundLength").getProperty("value"));
2833 // Send it to qBT
2834 window.parent.qBittorrent.Cache.preferences.set({
2835 data: settings,
2836 onFailure: function() {
2837 alert("QBT_TR(Unable to save program preferences, qBittorrent is probably unreachable.)QBT_TR[CONTEXT=HttpServer]");
2838 window.parent.qBittorrent.Client.closeWindows();
2840 onSuccess: function() {
2841 // Close window
2842 window.parent.location.reload();
2843 window.parent.qBittorrent.Client.closeWindows();
2848 // hide entries
2849 const buildInfo = window.qBittorrent.Cache.buildInfo.get();
2851 const libtorrentVersion = window.qBittorrent.Misc.parseVersion(buildInfo.libtorrent);
2852 if (libtorrentVersion.valid) {
2853 if (libtorrentVersion.major >= 2) {
2854 $("rowDiskCache").style.display = "none";
2855 $("rowDiskCacheExpiryInterval").style.display = "none";
2856 $("rowCoalesceReadsAndWrites").style.display = "none";
2858 else {
2859 $("fieldsetI2p").style.display = "none";
2860 $("rowMemoryWorkingSetLimit").style.display = "none";
2861 $("rowHashingThreads").style.display = "none";
2862 $("rowDiskIOType").style.display = "none";
2863 $("rowI2pInboundQuantity").style.display = "none";
2864 $("rowI2pOutboundQuantity").style.display = "none";
2865 $("rowI2pInboundLength").style.display = "none";
2866 $("rowI2pOutboundLength").style.display = "none";
2869 if (!((libtorrentVersion.major >= 2) && (libtorrentVersion.minor >= 0) && (libtorrentVersion.fix >= 6)))
2870 $("diskIOWriteModeWriteThrough").style.display = "none";
2873 if ((buildInfo.platform !== "macos") && (buildInfo.platform !== "windows"))
2874 $("rowMarkOfTheWeb").style.display = "none";
2876 $("networkInterface").addEvent("change", function() {
2877 updateInterfaceAddresses($(this).getProperty("value"), "");
2880 loadPreferences();
2882 return exports();
2883 })();
2885 Object.freeze(window.qBittorrent.Preferences);
2886 </script>