Migrate to Cache for commonly used data
[qBittorrent.git] / src / webui / www / private / views / preferences.html
blob00b7212f43409a2250b7770ba1cfae9be313bde1
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 </fieldset>
268 <fieldset class="settings">
269 <legend>
270 QBT_TR(Run external program)QBT_TR[CONTEXT=OptionsDialog]
271 </legend>
272 <div class="formRow">
273 <input type="checkbox" id="autorunOnTorrentAddedCheckbox" onclick="qBittorrent.Preferences.updateAutoRunOnTorrentAdded();" />
274 <label for="autorunOnTorrentAddedCheckbox">QBT_TR(Run external program on torrent added)QBT_TR[CONTEXT=OptionsDialog]</label>
275 <input type="text" id="autorunOnTorrentAddedProgram" style="width: 400px;" />
276 </div>
277 <div class="formRow">
278 <input type="checkbox" id="autorun_checkbox" onclick="qBittorrent.Preferences.updateAutoRun();" />
279 <label for="autorun_checkbox">QBT_TR(Run external program on torrent finished)QBT_TR[CONTEXT=OptionsDialog]</label>
280 <input type="text" id="autorunProg_txt" style="width: 400px;" />
281 </div>
282 <div style="font-style: italic;">QBT_TR(Supported parameters (case sensitive):)QBT_TR[CONTEXT=OptionsDialog]
283 <ul>
284 <li>QBT_TR(%N: Torrent name)QBT_TR[CONTEXT=OptionsDialog]</li>
285 <li>QBT_TR(%L: Category)QBT_TR[CONTEXT=OptionsDialog]</li>
286 <li>QBT_TR(%G: Tags (separated by comma))QBT_TR[CONTEXT=OptionsDialog]</li>
287 <li>QBT_TR(%F: Content path (same as root path for multifile torrent))QBT_TR[CONTEXT=OptionsDialog]</li>
288 <li>QBT_TR(%R: Root path (first torrent subdirectory path))QBT_TR[CONTEXT=OptionsDialog]</li>
289 <li>QBT_TR(%D: Save path)QBT_TR[CONTEXT=OptionsDialog]</li>
290 <li>QBT_TR(%C: Number of files)QBT_TR[CONTEXT=OptionsDialog]</li>
291 <li>QBT_TR(%Z: Torrent size (bytes))QBT_TR[CONTEXT=OptionsDialog]</li>
292 <li>QBT_TR(%T: Current tracker)QBT_TR[CONTEXT=OptionsDialog]</li>
293 <li>QBT_TR(%I: Info hash v1)QBT_TR[CONTEXT=OptionsDialog]</li>
294 <li>QBT_TR(%J: Info hash v2)QBT_TR[CONTEXT=OptionsDialog]</li>
295 <li>QBT_TR(%K: Torrent ID)QBT_TR[CONTEXT=OptionsDialog]</li>
296 </ul>
297 QBT_TR(Tip: Encapsulate parameter with quotation marks to avoid text being cut off at whitespace (e.g., "%N"))QBT_TR[CONTEXT=OptionsDialog]
298 </div>
299 </fieldset>
300 </div>
302 <div id="ConnectionTab" class="PrefTab invisible">
303 <div class="formRow">
304 <label>QBT_TR(Peer connection protocol:)QBT_TR[CONTEXT=OptionsDialog]</label>
305 <select id="enable_protocol_combobox">
306 <option value="0" selected>QBT_TR(TCP and μTP)QBT_TR[CONTEXT=OptionsDialog]</option>
307 <option value="1">TCP</option>
308 <option value="2">μTP</option>
309 </select>
310 </div>
311 <fieldset class="settings">
312 <legend>QBT_TR(Listening Port)QBT_TR[CONTEXT=OptionsDialog]</legend>
313 <div class="formRow">
314 <label for="port_value">QBT_TR(Port used for incoming connections:)QBT_TR[CONTEXT=OptionsDialog]</label>
315 <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]" />
316 <button type="button" style="margin-left: 1em;" onclick="qBittorrent.Preferences.generateRandomPort();">QBT_TR(Random)QBT_TR[CONTEXT=OptionsDialog]</button>
317 </div>
318 <div class="formRow">
319 <input type="checkbox" id="upnp_checkbox" />
320 <label for="upnp_checkbox">QBT_TR(Use UPnP / NAT-PMP port forwarding from my router)QBT_TR[CONTEXT=OptionsDialog]</label>
321 </div>
322 </fieldset>
324 <fieldset class="settings">
325 <legend>QBT_TR(Connections Limits)QBT_TR[CONTEXT=OptionsDialog]</legend>
326 <table>
327 <tr>
328 <td>
329 <input type="checkbox" id="max_connec_checkbox" onclick="qBittorrent.Preferences.updateMaxConnecEnabled();" />
330 <label for="max_connec_checkbox">QBT_TR(Global maximum number of connections:)QBT_TR[CONTEXT=OptionsDialog]</label>
331 </td>
332 <td><input type="text" id="max_connec_value" style="width: 4em;" /></td>
333 </tr>
334 <tr>
335 <td>
336 <input type="checkbox" id="max_connec_per_torrent_checkbox" onclick="qBittorrent.Preferences.updateMaxConnecPerTorrentEnabled();" />
337 <label for="max_connec_per_torrent_checkbox">QBT_TR(Maximum number of connections per torrent:)QBT_TR[CONTEXT=OptionsDialog]</label>
338 </td>
339 <td><input type="text" id="max_connec_per_torrent_value" style="width: 4em;" /></td>
340 </tr>
341 <tr>
342 <td>
343 <input type="checkbox" id="max_uploads_checkbox" onclick="qBittorrent.Preferences.updateMaxUploadsEnabled();" />
344 <label for="max_uploads_checkbox">QBT_TR(Global maximum number of upload slots:)QBT_TR[CONTEXT=OptionsDialog]</label>
345 </td>
346 <td><input type="text" id="max_uploads_value" style="width: 4em;" /></td>
347 </tr>
348 <tr>
349 <td>
350 <input type="checkbox" id="max_uploads_per_torrent_checkbox" onclick="qBittorrent.Preferences.updateMaxUploadsPerTorrentEnabled();" />
351 <label for="max_uploads_per_torrent_checkbox">QBT_TR(Maximum number of upload slots per torrent:)QBT_TR[CONTEXT=OptionsDialog]</label>
352 </td>
353 <td><input type="text" id="max_uploads_per_torrent_value" style="width: 4em;" /></td>
354 </tr>
355 </table>
356 </fieldset>
358 <fieldset class="settings" id="fieldsetI2p">
359 <legend>
360 <input type="checkbox" id="i2pEnabledCheckbox" onclick="qBittorrent.Preferences.updateI2PSettingsEnabled();" />
361 <label for="i2pEnabledCheckbox">QBT_TR(I2P (Experimental))QBT_TR[CONTEXT=OptionsDialog]</label>
362 </legend>
363 <table>
364 <tr>
365 <td>
366 <label for="i2pAddress">QBT_TR(Host:)QBT_TR[CONTEXT=OptionsDialog]</label>
367 </td>
368 <td>
369 <input type="text" id="i2pAddress" />
370 </td>
371 <td>
372 <label for="i2pPort">QBT_TR(Port:)QBT_TR[CONTEXT=OptionsDialog]</label>
373 </td>
374 <td>
375 <input type="number" id="i2pPort" min="0" max="65535" onchange="qBittorrent.Preferences.numberInputLimiter(this);" style="width: 5em;" />
376 </td>
377 </tr>
378 </table>
379 <div class="formRow">
380 <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]" />
381 <label for="i2pMixedMode">QBT_TR(Mixed mode)QBT_TR[CONTEXT=OptionsDialog]</label>
382 </div>
383 </fieldset>
385 <fieldset class="settings">
386 <legend>QBT_TR(Proxy Server)QBT_TR[CONTEXT=OptionsDialog]</legend>
387 <table>
388 <tr>
389 <td>
390 <label for="peer_proxy_type_select">QBT_TR(Type:)QBT_TR[CONTEXT=OptionsDialog]</label>
391 </td>
392 <td>
393 <select id="peer_proxy_type_select" onchange="qBittorrent.Preferences.updatePeerProxySettings();">
394 <option value="None">QBT_TR((None))QBT_TR[CONTEXT=OptionsDialog]</option>
395 <option value="SOCKS4">QBT_TR(SOCKS4)QBT_TR[CONTEXT=OptionsDialog]</option>
396 <option value="SOCKS5">QBT_TR(SOCKS5)QBT_TR[CONTEXT=OptionsDialog]</option>
397 <option value="HTTP">QBT_TR(HTTP)QBT_TR[CONTEXT=OptionsDialog]</option>
398 </select>
399 </td>
400 <td>
401 <label for="peer_proxy_host_text">QBT_TR(Host:)QBT_TR[CONTEXT=OptionsDialog]</label>
402 </td>
403 <td>
404 <input type="text" id="peer_proxy_host_text" />
405 </td>
406 <td>
407 <label for="peer_proxy_port_value">QBT_TR(Port:)QBT_TR[CONTEXT=OptionsDialog]</label>
408 </td>
409 <td>
410 <input type="text" id="peer_proxy_port_value" style="width: 4em;" />
411 </td>
412 </tr>
413 </table>
415 <div class="formRow">
416 <input type="checkbox" id="proxyHostnameLookupCheckbox" title="QBT_TR(If checked, hostname lookups are done via the proxy.)QBT_TR[CONTEXT=OptionsDialog]" />
417 <label for="proxyHostnameLookupCheckbox">QBT_TR(Perform hostname lookup via proxy)QBT_TR[CONTEXT=OptionsDialog]</label>
418 </div>
420 <fieldset class="settings">
421 <legend>
422 <input type="checkbox" id="peer_proxy_auth_checkbox" onclick="qBittorrent.Preferences.updatePeerProxyAuthSettings();" />
423 <label for="peer_proxy_auth_checkbox">QBT_TR(Authentication)QBT_TR[CONTEXT=OptionsDialog]</label>
424 </legend>
425 <table>
426 <tr>
427 <td>
428 <label for="peer_proxy_username_text">QBT_TR(Username:)QBT_TR[CONTEXT=OptionsDialog]</label>
429 </td>
430 <td>
431 <input type="text" id="peer_proxy_username_text" />
432 </td>
433 </tr>
434 <tr>
435 <td>
436 <label for="peer_proxy_password_text">QBT_TR(Password:)QBT_TR[CONTEXT=OptionsDialog]</label>
437 </td>
438 <td>
439 <input type="password" id="peer_proxy_password_text" />
440 </td>
441 </tr>
442 </table>
443 <div class="formRow">
444 <span>QBT_TR(Info: The password is saved unencrypted)QBT_TR[CONTEXT=OptionsDialog]</span>
445 </div>
446 </fieldset>
448 <fieldset class="settings">
449 <legend>
450 <input type="checkbox" id="proxy_bittorrent_checkbox" onclick="qBittorrent.Preferences.updatePeerProxySettings();" />
451 <label for="proxy_bittorrent_checkbox">QBT_TR(Use proxy for BitTorrent purposes)QBT_TR[CONTEXT=OptionsDialog]</label>
452 </legend>
453 <div class="formRow">
454 <input type="checkbox" id="use_peer_proxy_checkbox" />
455 <label for="use_peer_proxy_checkbox">QBT_TR(Use proxy for peer connections)QBT_TR[CONTEXT=OptionsDialog]</label>
456 </div>
457 </fieldset>
458 <div class="formRow">
459 <input type="checkbox" id="proxy_rss_checkbox" />
460 <label for="proxy_rss_checkbox">QBT_TR(Use proxy for RSS purposes)QBT_TR[CONTEXT=OptionsDialog]</label>
461 </div>
462 <div class="formRow">
463 <input type="checkbox" id="proxy_misc_checkbox" />
464 <label for="proxy_misc_checkbox">QBT_TR(Use proxy for general purposes)QBT_TR[CONTEXT=OptionsDialog]</label>
465 </div>
466 </fieldset>
468 <fieldset class="settings">
469 <legend>
470 <label>QBT_TR(IP Filtering)QBT_TR[CONTEXT=OptionsDialog]</label>
471 </legend>
472 <div class="formRow">
473 <input type="checkbox" id="ipfilter_text_checkbox" onclick="qBittorrent.Preferences.updateFilterSettings();" />
474 <label for="ipfilter_text_checkbox">QBT_TR(Filter path (.dat, .p2p, .p2b):)QBT_TR[CONTEXT=OptionsDialog]</label>
475 <input type="text" id="ipfilter_text" />
476 </div>
477 <div class="formRow">
478 <input type="checkbox" id="ipfilter_trackers_checkbox" />
479 <label for="ipfilter_trackers_checkbox">QBT_TR(Apply to trackers)QBT_TR[CONTEXT=OptionsDialog]</label>
480 </div>
481 <div class="formRow">
482 <fieldset class="settings">
483 <legend>QBT_TR(Manually banned IP addresses...)QBT_TR[CONTEXT=OptionsDialog]</legend>
484 <textarea id="banned_IPs_textarea" rows="5" cols="70"></textarea>
485 </fieldset>
486 </div>
487 </fieldset>
488 </div>
490 <div id="SpeedTab" class="PrefTab invisible">
491 <fieldset class="settings">
492 <legend>QBT_TR(Global Rate Limits)QBT_TR[CONTEXT=OptionsDialog]</legend>
493 <table>
494 <tr>
495 <td rowspan="2">
496 <img src="images/slow_off.svg" style="height: 1.5em;" alt="QBT_TR(Alternative speed limits)QBT_TR[CONTEXT=MainWindow]">
497 </td>
498 <td><label for="up_limit_value">QBT_TR(Upload:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
499 <td><input type="number" id="up_limit_value" style="width: 4em;" min="0" />&nbsp;&nbsp;QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog]</td>
500 </tr>
501 <tr>
502 <td><label for="dl_limit_value">QBT_TR(Download:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
503 <td><input type="number" id="dl_limit_value" style="width: 4em;" min="0" />&nbsp;&nbsp;QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog]</td>
504 </tr>
505 </table>
506 <i>QBT_TR(0 means unlimited)QBT_TR[CONTEXT=OptionsDialog]</i>
507 </fieldset>
509 <fieldset class="settings">
510 <legend>QBT_TR(Alternative Rate Limits)QBT_TR[CONTEXT=OptionsDialog]</legend>
511 <table>
512 <tr>
513 <td rowspan="2">
514 <img src="images/slow.svg" style="height: 1.5em;" alt="QBT_TR(Alternative speed limits)QBT_TR[CONTEXT=MainWindow]">
515 </td>
516 <td><label for="alt_up_limit_value">QBT_TR(Upload:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
517 <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>
518 </tr>
519 <tr>
520 <td><label for="alt_dl_limit_value">QBT_TR(Download:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
521 <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>
522 </tr>
523 </table>
524 <i>QBT_TR(0 means unlimited)QBT_TR[CONTEXT=OptionsDialog]</i>
526 <fieldset class="settings">
527 <legend>
528 <input type="checkbox" id="limitSchedulingCheckbox" onclick="qBittorrent.Preferences.updateSchedulingEnabled();" />
529 <label for="limitSchedulingCheckbox">QBT_TR(Schedule the use of alternative rate limits)QBT_TR[CONTEXT=OptionsDialog]</label>
530 </legend>
531 <div class="formRow">
532 QBT_TR(From:)QBT_TR[CONTEXT=OptionsDialog]
533 <input type="text" id="schedule_from_hour" style="width: 1.5em;" />:<input type="text" id="schedule_from_min" style="width: 1.5em;" />
534 QBT_TR(To:)QBT_TR[CONTEXT=OptionsDialog]
535 <input type="text" id="schedule_to_hour" style="width: 1.5em;" />:<input type="text" id="schedule_to_min" style="width: 1.5em;" />
536 </div>
537 <div class="formRow">
538 QBT_TR(When:)QBT_TR[CONTEXT=OptionsDialog]
539 <select id="schedule_freq_select">
540 <option value="0">QBT_TR(Every day)QBT_TR[CONTEXT=OptionsDialog]</option>
541 <option value="1">QBT_TR(Weekdays)QBT_TR[CONTEXT=OptionsDialog]</option>
542 <option value="2">QBT_TR(Weekends)QBT_TR[CONTEXT=OptionsDialog]</option>
543 <option value="3">QBT_TR(Monday)QBT_TR[CONTEXT=HttpServer]</option>
544 <option value="4">QBT_TR(Tuesday)QBT_TR[CONTEXT=HttpServer]</option>
545 <option value="5">QBT_TR(Wednesday)QBT_TR[CONTEXT=HttpServer]</option>
546 <option value="6">QBT_TR(Thursday)QBT_TR[CONTEXT=HttpServer]</option>
547 <option value="7">QBT_TR(Friday)QBT_TR[CONTEXT=HttpServer]</option>
548 <option value="8">QBT_TR(Saturday)QBT_TR[CONTEXT=HttpServer]</option>
549 <option value="9">QBT_TR(Sunday)QBT_TR[CONTEXT=HttpServer]</option>
550 </select>
551 </div>
552 </fieldset>
553 </fieldset>
555 <fieldset class="settings">
556 <legend>QBT_TR(Rate Limits Settings)QBT_TR[CONTEXT=OptionsDialog]</legend>
557 <div class="formRow">
558 <input type="checkbox" id="limit_utp_rate_checkbox" />
559 <label for="limit_utp_rate_checkbox">QBT_TR(Apply rate limit to µTP protocol)QBT_TR[CONTEXT=OptionsDialog]</label>
560 </div>
561 <div class="formRow">
562 <input type="checkbox" id="limit_tcp_overhead_checkbox" />
563 <label for="limit_tcp_overhead_checkbox">QBT_TR(Apply rate limit to transport overhead)QBT_TR[CONTEXT=OptionsDialog]</label>
564 </div>
565 <div class="formRow">
566 <input type="checkbox" id="limit_lan_peers_checkbox" />
567 <label for="limit_lan_peers_checkbox">QBT_TR(Apply rate limit to peers on LAN)QBT_TR[CONTEXT=OptionsDialog]</label>
568 </div>
569 </fieldset>
570 </div>
572 <div id="BittorrentTab" class="PrefTab invisible">
573 <fieldset class="settings">
574 <legend>QBT_TR(Privacy)QBT_TR[CONTEXT=OptionsDialog]</legend>
575 <div class="formRow">
576 <input type="checkbox" id="dht_checkbox" />
577 <label for="dht_checkbox">QBT_TR(Enable DHT (decentralized network) to find more peers)QBT_TR[CONTEXT=OptionsDialog]</label>
578 </div>
579 <div class="formRow">
580 <input type="checkbox" id="pex_checkbox" />
581 <label for="pex_checkbox">QBT_TR(Enable Peer Exchange (PeX) to find more peers)QBT_TR[CONTEXT=OptionsDialog]</label>
582 </div>
583 <div class="formRow">
584 <input type="checkbox" id="lsd_checkbox" />
585 <label for="lsd_checkbox">QBT_TR(Enable Local Peer Discovery to find more peers)QBT_TR[CONTEXT=OptionsDialog]</label>
586 </div>
587 <div class="formRow">
588 <label for="encryption_select">QBT_TR(Encryption mode:)QBT_TR[CONTEXT=OptionsDialog]</label>
589 <select id="encryption_select">
590 <option value="0">QBT_TR(Allow encryption)QBT_TR[CONTEXT=OptionsDialog]</option>
591 <option value="1">QBT_TR(Require encryption)QBT_TR[CONTEXT=OptionsDialog]</option>
592 <option value="2">QBT_TR(Disable encryption)QBT_TR[CONTEXT=OptionsDialog]</option>
593 </select>
594 </div>
595 <div class="formRow">
596 <input type="checkbox" id="anonymous_mode_checkbox" />
597 <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>
598 </div>
599 </fieldset>
601 <div class="formRow">
602 <label for="maxActiveCheckingTorrents">QBT_TR(Max active checking torrents:)QBT_TR[CONTEXT=OptionsDialog]</label>
603 <input type="number" id="maxActiveCheckingTorrents" style="width: 4em;" min="-1" />
604 </div>
606 <fieldset class="settings">
607 <legend>
608 <input type="checkbox" id="queueing_checkbox" onclick="qBittorrent.Preferences.updateQueueingSystem();" />
609 <label for="queueing_checkbox">QBT_TR(Torrent Queueing)QBT_TR[CONTEXT=OptionsDialog]</label>
610 </legend>
611 <table>
612 <tr>
613 <td>
614 <label for="max_active_dl_value">QBT_TR(Maximum active downloads:)QBT_TR[CONTEXT=OptionsDialog]</label>
615 </td>
616 <td>
617 <input type="text" id="max_active_dl_value" style="width: 4em;" />
618 </td>
619 </tr>
620 <tr>
621 <td>
622 <label for="max_active_up_value">QBT_TR(Maximum active uploads:)QBT_TR[CONTEXT=OptionsDialog]</label>
623 </td>
624 <td>
625 <input type="text" id="max_active_up_value" style="width: 4em;" />
626 </td>
627 </tr>
628 <tr>
629 <td>
630 <label for="max_active_to_value">QBT_TR(Maximum active torrents:)QBT_TR[CONTEXT=OptionsDialog]</label>
631 </td>
632 <td>
633 <input type="text" id="max_active_to_value" style="width: 4em;" />
634 </td>
635 </tr>
636 </table>
637 <fieldset class="settings">
638 <legend>
639 <input type="checkbox" id="dont_count_slow_torrents_checkbox" onclick="qBittorrent.Preferences.updateSlowTorrentsSettings();" />
640 <label for="dont_count_slow_torrents_checkbox">QBT_TR(Do not count slow torrents in these limits)QBT_TR[CONTEXT=OptionsDialog]</label>
641 </legend>
642 <table>
643 <tr>
644 <td>
645 <label for="dl_rate_threshold">QBT_TR(Download rate threshold:)QBT_TR[CONTEXT=OptionsDialog]</label>
646 </td>
647 <td>
648 <input type="text" id="dl_rate_threshold" style="width: 4em;" />&nbsp;&nbsp;QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog]
649 </td>
650 </tr>
651 <tr>
652 <td>
653 <label for="ul_rate_threshold">QBT_TR(Upload rate threshold:)QBT_TR[CONTEXT=OptionsDialog]</label>
654 </td>
655 <td>
656 <input type="text" id="ul_rate_threshold" style="width: 4em;" />&nbsp;&nbsp;QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog]
657 </td>
658 </tr>
659 <tr>
660 <td>
661 <label for="torrent_inactive_timer">QBT_TR(Torrent inactivity timer:)QBT_TR[CONTEXT=OptionsDialog]</label>
662 </td>
663 <td>
664 <input type="text" id="torrent_inactive_timer" style="width: 4em;" />&nbsp;&nbsp;QBT_TR(seconds)QBT_TR[CONTEXT=OptionsDialog]
665 </td>
666 </tr>
667 </table>
668 </fieldset>
669 </fieldset>
671 <fieldset class="settings">
672 <legend>QBT_TR(Seeding Limits)QBT_TR[CONTEXT=OptionsDialog]</legend>
673 <table>
674 <tr>
675 <td>
676 <input type="checkbox" id="max_ratio_checkbox" onclick="qBittorrent.Preferences.updateMaxRatioTimeEnabled();" />
677 <label for="max_ratio_checkbox">QBT_TR(When ratio reaches)QBT_TR[CONTEXT=OptionsDialog]</label>
678 </td>
679 <td>
680 <input type="text" id="max_ratio_value" style="width: 4em;" />
681 </td>
682 </tr>
683 <tr>
684 <td>
685 <input type="checkbox" id="max_seeding_time_checkbox" onclick="qBittorrent.Preferences.updateMaxRatioTimeEnabled();" />
686 <label for="max_seeding_time_checkbox">QBT_TR(When total seeding time reaches)QBT_TR[CONTEXT=OptionsDialog]</label>
687 </td>
688 <td>
689 <input type="text" id="max_seeding_time_value" style="width: 4em;" />QBT_TR(minutes)QBT_TR[CONTEXT=OptionsDialog]
690 </td>
691 </tr>
692 <tr>
693 <td>
694 <input type="checkbox" id="max_inactive_seeding_time_checkbox" onclick="qBittorrent.Preferences.updateMaxRatioTimeEnabled();" />
695 <label for="max_inactive_seeding_time_checkbox">QBT_TR(When inactive seeding time reaches)QBT_TR[CONTEXT=OptionsDialog]</label>
696 </td>
697 <td>
698 <input type="text" id="max_inactive_seeding_time_value" style="width: 4em;" />QBT_TR(minutes)QBT_TR[CONTEXT=OptionsDialog]
699 </td>
700 </tr>
701 <tr>
702 <td style="text-align: right;"><label for="max_ratio_act">QBT_TR(then)QBT_TR[CONTEXT=OptionsDialog]</label></td>
703 <td>
704 <select id="max_ratio_act">
705 <option value="0">QBT_TR(Pause torrent)QBT_TR[CONTEXT=OptionsDialog]</option>
706 <option value="1">QBT_TR(Remove torrent)QBT_TR[CONTEXT=OptionsDialog]</option>
707 <option value="3">QBT_TR(Remove torrent and its files)QBT_TR[CONTEXT=OptionsDialog]</option>
708 <option value="2">QBT_TR(Enable super seeding for torrent)QBT_TR[CONTEXT=OptionsDialog]</option>
709 </select>
710 </td>
711 </tr>
712 </table>
713 </fieldset>
715 <fieldset class="settings">
716 <legend>
717 <input type="checkbox" id="add_trackers_checkbox" onclick="qBittorrent.Preferences.updateAddTrackersEnabled();" />
718 <label for="add_trackers_checkbox">QBT_TR(Automatically add these trackers to new downloads:)QBT_TR[CONTEXT=OptionsDialog]</label>
719 </legend>
720 <textarea id="add_trackers_textarea" rows="5" cols="70"></textarea>
721 </fieldset>
722 </div>
724 <div id="RSSTab" class="PrefTab invisible">
725 <fieldset class="settings">
726 <legend>QBT_TR(RSS Reader)QBT_TR[CONTEXT=OptionsDialog]</legend>
727 <div class="formRow">
728 <input type="checkbox" id="enable_fetching_rss_feeds_checkbox" />
729 <label for="enable_fetching_rss_feeds_checkbox">QBT_TR(Enable fetching RSS feeds)QBT_TR[CONTEXT=OptionsDialog]</label>
730 </div>
731 <table>
732 <tr>
733 <td>
734 <label for="feed_refresh_interval">QBT_TR(Feeds refresh interval:)QBT_TR[CONTEXT=OptionsDialog]</label>
735 </td>
736 <td>
737 <input type="text" id="feed_refresh_interval" style="width: 4em;" />&nbsp;&nbsp;QBT_TR( min)QBT_TR[CONTEXT=OptionsDialog]
738 </td>
739 </tr>
740 <tr>
741 <td>
742 <label for="feedFetchDelay">QBT_TR(Same host request delay:)QBT_TR[CONTEXT=OptionsDialog]</label>
743 </td>
744 <td>
745 <input type="text" id="feedFetchDelay" style="width: 4em;" />&nbsp;&nbsp;QBT_TR( sec)QBT_TR[CONTEXT=OptionsDialog]
746 </td>
747 </tr>
748 <tr>
749 <td>
750 <label for="maximum_article_number">QBT_TR(Maximum number of articles per feed:)QBT_TR[CONTEXT=OptionsDialog]</label>
751 </td>
752 <td>
753 <input type="text" id="maximum_article_number" style="width: 4em;" />
754 </td>
755 </tr>
756 </table>
757 </fieldset>
759 <fieldset class="settings">
760 <legend>QBT_TR(RSS Torrent Auto Downloader)QBT_TR[CONTEXT=OptionsDialog]</legend>
761 <div class="formRow">
762 <input type="checkbox" id="enable_auto_downloading_rss_torrents_checkbox" />
763 <label for="enable_auto_downloading_rss_torrents_checkbox">QBT_TR(Enable auto downloading of RSS torrents)QBT_TR[CONTEXT=OptionsDialog]</label>
764 </div>
765 <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>
766 </fieldset>
768 <fieldset class="settings">
769 <legend>QBT_TR(RSS Smart Episode Filter)QBT_TR[CONTEXT=OptionsDialog]</legend>
770 <div class="formRow">
771 <input type="checkbox" id="downlock_repack_proper_episodes" />
773 <label for="downlock_repack_proper_episodes">QBT_TR(Download REPACK/PROPER episodes)QBT_TR[CONTEXT=OptionsDialog]</label>
774 </div>
775 <label for="rss_filter_textarea">QBT_TR(Filters:)QBT_TR[CONTEXT=OptionsDialog]</label><br>
776 <textarea id="rss_filter_textarea" rows="6" cols="70"></textarea>
777 </fieldset>
778 </div>
780 <div id="WebUITab" class="PrefTab invisible">
781 <fieldset class="settings">
782 <legend>QBT_TR(Web User Interface (Remote control))QBT_TR[CONTEXT=OptionsDialog]</legend>
783 <table>
784 <tr>
785 <td>
786 <label for="webui_address_value">QBT_TR(IP address:)QBT_TR[CONTEXT=OptionsDialog]</label>
787 </td>
788 <td>
789 <input type="text" id="webui_address_value" />
790 <label for="webui_port_value" style="margin-left: 10px;">QBT_TR(Port:)QBT_TR[CONTEXT=OptionsDialog]</label>
791 <input type="text" id="webui_port_value" style="width: 4em;" />
792 </td>
793 </tr>
794 </table>
795 <div class="formRow">
796 <input type="checkbox" id="webui_upnp_checkbox" />
797 <label for="webui_upnp_checkbox">QBT_TR(Use UPnP / NAT-PMP to forward the port from my router)QBT_TR[CONTEXT=OptionsDialog]</label>
798 </div>
799 <fieldset class="settings">
800 <legend>
801 <input type="checkbox" id="use_https_checkbox" onclick="qBittorrent.Preferences.updateHttpsSettings();" />
802 <label for="use_https_checkbox">QBT_TR(Use HTTPS instead of HTTP)QBT_TR[CONTEXT=OptionsDialog]</label>
803 </legend>
804 <table>
805 <tr>
806 <td>
807 <label for="ssl_cert_text">QBT_TR(Certificate:)QBT_TR[CONTEXT=OptionsDialog]</label>
808 </td>
809 <td>
810 <input type="text" id="ssl_cert_text" style="width: 30em;" />
811 </td>
812 </tr>
813 <tr>
814 <td>
815 <label for="ssl_key_text">QBT_TR(Key:)QBT_TR[CONTEXT=OptionsDialog]</label>
816 </td>
817 <td>
818 <input type="text" id="ssl_key_text" style="width: 30em;" />
819 </td>
820 </tr>
821 </table>
822 <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>
823 </fieldset>
825 <fieldset class="settings">
826 <legend>QBT_TR(Authentication)QBT_TR[CONTEXT=OptionsDialog]</legend>
827 <table>
828 <tr>
829 <td>
830 <label for="webui_username_text">QBT_TR(Username:)QBT_TR[CONTEXT=OptionsDialog]</label>
831 </td>
832 <td>
833 <input type="text" id="webui_username_text" />
834 </td>
835 </tr>
836 <tr>
837 <td>
838 <label for="webui_password_text">QBT_TR(Password:)QBT_TR[CONTEXT=OptionsDialog]</label>
839 </td>
840 <td>
841 <input type="password" id="webui_password_text" placeholder="QBT_TR(Change current password)QBT_TR[CONTEXT=OptionsDialog]" autocomplete="new-password" />
842 </td>
843 </tr>
844 </table>
845 <div class="formRow">
846 <input type="checkbox" id="bypass_local_auth_checkbox" />
847 <label for="bypass_local_auth_checkbox">QBT_TR(Bypass authentication for clients on localhost)QBT_TR[CONTEXT=OptionsDialog]</label>
848 </div>
849 <div class="formRow">
850 <input type="checkbox" id="bypass_auth_subnet_whitelist_checkbox" onclick="qBittorrent.Preferences.updateBypasssAuthSettings();" />
851 <label for="bypass_auth_subnet_whitelist_checkbox">QBT_TR(Bypass authentication for clients in whitelisted IP subnets)QBT_TR[CONTEXT=OptionsDialog]</label>
852 </div>
853 <div class="formRow" style="padding-left: 30px; padding-top: 5px;">
854 <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>
855 </div>
856 <table>
857 <tr>
858 <td><label for="webUIMaxAuthFailCountInput">QBT_TR(Ban client after consecutive failures:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
859 <td><input type="number" id="webUIMaxAuthFailCountInput" style="width: 4em;" min="0" /></td>
860 </tr>
861 <tr>
862 <td style="text-align: right;"><label for="webUIBanDurationInput">QBT_TR(ban for:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
863 <td><input type="number" id="webUIBanDurationInput" style="width: 4em;" min="1" />QBT_TR(seconds)QBT_TR[CONTEXT=OptionsDialog]</td>
864 </tr>
865 </table>
866 <table>
867 <tr>
868 <td><label for="webUISessionTimeoutInput">QBT_TR(Session timeout:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
869 <td><input type="number" id="webUISessionTimeoutInput" style="width: 4em;" min="0" />&nbsp;&nbsp;QBT_TR(seconds)QBT_TR[CONTEXT=OptionsDialog]</td>
870 </tr>
871 </table>
872 </fieldset>
874 <fieldset class="settings">
875 <legend><input type="checkbox" id="use_alt_webui_checkbox" onclick="qBittorrent.Preferences.updateAlternativeWebUISettings();" />
876 <label for="use_alt_webui_checkbox">QBT_TR(Use alternative Web UI)QBT_TR[CONTEXT=OptionsDialog]</label>
877 </legend>
878 <div class="formRow">
879 <label for="webui_files_location_textarea">QBT_TR(Files location:)QBT_TR[CONTEXT=OptionsDialog]</label>
880 <input type="text" id="webui_files_location_textarea" />
881 </div>
882 </fieldset>
884 <fieldset class="settings">
885 <legend>QBT_TR(Security)QBT_TR[CONTEXT=OptionsDialog]</legend>
886 <div class="formRow">
887 <input type="checkbox" id="clickjacking_protection_checkbox" />
888 <label for="clickjacking_protection_checkbox">QBT_TR(Enable clickjacking protection)QBT_TR[CONTEXT=OptionsDialog]</label>
889 </div>
890 <div class="formRow">
891 <input type="checkbox" id="csrf_protection_checkbox" />
892 <label for="csrf_protection_checkbox">QBT_TR(Enable Cross-Site Request Forgery (CSRF) protection)QBT_TR[CONTEXT=OptionsDialog]</label>
893 </div>
894 <div class="formRow">
895 <input type="checkbox" id="secureCookieCheckbox" />
896 <label for="secureCookieCheckbox">QBT_TR(Enable cookie Secure flag (requires HTTPS))QBT_TR[CONTEXT=OptionsDialog]</label>
897 </div>
899 <fieldset class="settings">
900 <legend>
901 <input type="checkbox" id="host_header_validation_checkbox" onclick="qBittorrent.Preferences.updateHostHeaderValidationSettings();" />
902 <label for="host_header_validation_checkbox">QBT_TR(Enable Host header validation)QBT_TR[CONTEXT=OptionsDialog]</label>
903 </legend>
904 <table>
905 <tr>
906 <td>
907 <label for="webui_domain_textarea">QBT_TR(Server domains:)QBT_TR[CONTEXT=OptionsDialog]</label>
908 </td>
909 <td>
910 <textarea id="webui_domain_textarea" rows="1" cols="60" title="QBT_TR(Whitelist for filtering HTTP Host header values.
911 In order to defend against DNS rebinding attack,
912 you should put in domain names used by WebUI server.
914 Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsDialog]"></textarea>
915 </td>
916 </tr>
917 </table>
918 </fieldset>
919 </fieldset>
921 <fieldset class="settings">
922 <legend>
923 <input type="checkbox" id="webUIUseCustomHTTPHeadersCheckbox" onclick="qBittorrent.Preferences.updateWebUICustomHTTPHeadersSettings();" />
924 <label for="webUIUseCustomHTTPHeadersCheckbox">QBT_TR(Add custom HTTP headers)QBT_TR[CONTEXT=OptionsDialog]</label>
925 </legend>
926 <textarea id="webUICustomHTTPHeadersTextarea" placeholder="QBT_TR(Header: value pairs, one per line)QBT_TR[CONTEXT=OptionsDialog]" style="width: 90%;"></textarea>
927 </fieldset>
929 <fieldset class="settings">
930 <legend>
931 <input type="checkbox" id="webUIReverseProxySupportCheckbox" onclick="qBittorrent.Preferences.updateWebUIReverseProxySettings();" />
932 <label for="webUIReverseProxySupportCheckbox">QBT_TR(Enable reverse proxy support)QBT_TR[CONTEXT=OptionsDialog]</label>
933 </legend>
934 <div class="formRow">
935 <label for="webUIReverseProxiesListTextarea">QBT_TR(Trusted proxies list:)QBT_TR[CONTEXT=OptionsDialog]</label>
936 <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]" />
937 </div>
938 </fieldset>
940 </fieldset>
942 <fieldset class="settings">
943 <legend>
944 <input type="checkbox" id="use_dyndns_checkbox" onclick="qBittorrent.Preferences.updateDynDnsSettings();" />
945 <label for="use_dyndns_checkbox">QBT_TR(Update my dynamic domain name)QBT_TR[CONTEXT=OptionsDialog]</label>
946 </legend>
947 <select id="dyndns_select">
948 <option value="0">DynDNS</option>
949 <option value="1">NO-IP</option>
950 </select>
951 <input type="button" value="QBT_TR(Register)QBT_TR[CONTEXT=OptionsDialog]" onclick="qBittorrent.Preferences.registerDynDns();" />
952 <table style="margin-top: 10px;">
953 <tr>
954 <td>
955 <label for="dyndns_domain_text">QBT_TR(Domain name:)QBT_TR[CONTEXT=OptionsDialog]</label>
956 </td>
957 <td>
958 <input type="text" id="dyndns_domain_text" />
959 </td>
960 </tr>
961 <tr>
962 <td>
963 <label for="dyndns_username_text">QBT_TR(Username:)QBT_TR[CONTEXT=OptionsDialog]</label>
964 </td>
965 <td>
966 <input type="text" id="dyndns_username_text" />
967 </td>
968 </tr>
969 <tr>
970 <td>
971 <label for="dyndns_password_text">QBT_TR(Password:)QBT_TR[CONTEXT=OptionsDialog]</label>
972 </td>
973 <td>
974 <input type="password" id="dyndns_password_text" />
975 </td>
976 </tr>
977 </table>
978 </fieldset>
979 </div>
981 <div id="AdvancedTab" class="PrefTab invisible">
982 <fieldset class="settings">
983 <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>
984 <table>
985 <tr>
986 <td>
987 <label for="resumeDataStorageType">QBT_TR(Resume data storage type (requires restart):)QBT_TR[CONTEXT=OptionsDialog]</label>
988 </td>
989 <td>
990 <select id="resumeDataStorageType" style="width: 15em;">
991 <option value="Legacy">QBT_TR(Fastresume files)QBT_TR[CONTEXT=OptionsDialog]</option>
992 <option value="SQLite">QBT_TR(SQLite database (experimental))QBT_TR[CONTEXT=OptionsDialog]</option>
993 </select>
994 </td>
995 </tr>
996 <tr id="rowMemoryWorkingSetLimit">
997 <td>
998 <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>
999 </td>
1000 <td>
1001 <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]
1002 </td>
1003 </tr>
1004 <tr>
1005 <td>
1006 <label for="networkInterface">QBT_TR(Network interface:)QBT_TR[CONTEXT=OptionsDialog]</label>
1007 </td>
1008 <td>
1009 <select id="networkInterface" style="width: 15em;">
1010 </select>
1011 </td>
1012 </tr>
1013 <tr>
1014 <td>
1015 <label for="optionalIPAddressToBind">QBT_TR(Optional IP address to bind to:)QBT_TR[CONTEXT=OptionsDialog]</label>
1016 </td>
1017 <td>
1018 <select id="optionalIPAddressToBind" style="width: 15em;">
1019 </select>
1020 </td>
1021 </tr>
1022 <tr>
1023 <td>
1024 <label for="saveResumeDataInterval">QBT_TR(Save resume data interval:)QBT_TR[CONTEXT=OptionsDialog]</label>
1025 </td>
1026 <td>
1027 <input type="text" id="saveResumeDataInterval" style="width: 15em;">&nbsp;&nbsp;QBT_TR(min)QBT_TR[CONTEXT=OptionsDialog]
1028 </td>
1029 </tr>
1030 <tr>
1031 <td>
1032 <label for="torrentFileSizeLimit">QBT_TR(.torrent file size limit:)QBT_TR[CONTEXT=OptionsDialog]</label>
1033 </td>
1034 <td>
1035 <input type="text" id="torrentFileSizeLimit" style="width: 15em;">&nbsp;&nbsp;QBT_TR(MiB)QBT_TR[CONTEXT=OptionsDialog]
1036 </td>
1037 </tr>
1038 <tr>
1039 <td>
1040 <label for="recheckTorrentsOnCompletion">QBT_TR(Recheck torrents on completion:)QBT_TR[CONTEXT=OptionsDialog]</label>
1041 </td>
1042 <td>
1043 <input type="checkbox" id="recheckTorrentsOnCompletion">
1044 </td>
1045 </tr>
1046 <tr>
1047 <td>
1048 <label for="refreshInterval">QBT_TR(Refresh interval:)QBT_TR[CONTEXT=OptionsDialog]</label>
1049 </td>
1050 <td>
1051 <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]
1052 </td>
1053 </tr>
1054 <tr>
1055 <td>
1056 <label for="resolvePeerCountries">QBT_TR(Resolve peer countries:)QBT_TR[CONTEXT=OptionsDialog]</label>
1057 </td>
1058 <td>
1059 <input type="checkbox" id="resolvePeerCountries">
1060 </td>
1061 </tr>
1062 <tr>
1063 <td>
1064 <label for="reannounceWhenAddressChanged">QBT_TR(Reannounce to all trackers when IP or port changed:)QBT_TR[CONTEXT=OptionsDialog]</label>
1065 </td>
1066 <td>
1067 <input type="checkbox" id="reannounceWhenAddressChanged" />
1068 </td>
1069 </tr>
1070 <tr>
1071 <td>
1072 <label for="enableEmbeddedTracker">QBT_TR(Enable embedded tracker:)QBT_TR[CONTEXT=OptionsDialog]</label>
1073 </td>
1074 <td>
1075 <input type="checkbox" id="enableEmbeddedTracker" />
1076 </td>
1077 </tr>
1078 <tr>
1079 <td>
1080 <label for="embeddedTrackerPort">QBT_TR(Embedded tracker port:)QBT_TR[CONTEXT=OptionsDialog]</label>
1081 </td>
1082 <td>
1083 <input type="text" id="embeddedTrackerPort" style="width: 15em;" />
1084 </td>
1085 </tr>
1086 <tr>
1087 <td>
1088 <label for="embeddedTrackerPortForwarding">QBT_TR(Enable port forwarding for embedded tracker:)QBT_TR[CONTEXT=OptionsDialog]</label>
1089 </td>
1090 <td>
1091 <input type="checkbox" id="embeddedTrackerPortForwarding" />
1092 </td>
1093 </tr>
1094 <tr id="rowMarkOfTheWeb">
1095 <td>
1096 <label for="markOfTheWeb">QBT_TR(Enable Mark-of-the-Web (MOTW) for downloaded files (require macOS or Windows):)QBT_TR[CONTEXT=OptionsDialog]</label>
1097 </td>
1098 <td>
1099 <input type="checkbox" id="markOfTheWeb" />
1100 </td>
1101 </tr>
1102 <tr>
1103 <td>
1104 <label for="pythonExecutablePath">QBT_TR(Python executable path (may require restart):)QBT_TR[CONTEXT=OptionsDialog]</label>
1105 </td>
1106 <td>
1107 <input type="text" id="pythonExecutablePath" placeholder="QBT_TR((Auto detect if empty))QBT_TR[CONTEXT=OptionsDialog]" style="width: 15em;" />
1108 </td>
1109 </tr>
1110 </table>
1111 </fieldset>
1112 <fieldset class="settings">
1113 <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>
1114 <table>
1115 <tr>
1116 <td>
1117 <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>
1118 </td>
1119 <td>
1120 <input type="text" id="bdecodeDepthLimit" style="width: 15em;" />
1121 </td>
1122 </tr>
1123 <tr>
1124 <td>
1125 <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>
1126 </td>
1127 <td>
1128 <input type="text" id="bdecodeTokenLimit" style="width: 15em;" />
1129 </td>
1130 </tr>
1131 <tr>
1132 <td>
1133 <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>
1134 </td>
1135 <td>
1136 <input type="text" id="asyncIOThreads" style="width: 15em;" />
1137 </td>
1138 </tr>
1139 <tr id="rowHashingThreads">
1140 <td>
1141 <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>
1142 </td>
1143 <td>
1144 <input type="text" id="hashingThreads" style="width: 15em;" />
1145 </td>
1146 </tr>
1147 <tr>
1148 <td>
1149 <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>
1150 </td>
1151 <td>
1152 <input type="text" id="filePoolSize" style="width: 15em;" />
1153 </td>
1154 </tr>
1155 <tr>
1156 <td>
1157 <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>
1158 </td>
1159 <td>
1160 <input type="text" id="outstandMemoryWhenCheckingTorrents" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(MiB)QBT_TR[CONTEXT=OptionsDialog]
1161 </td>
1162 </tr>
1163 <tr id="rowDiskCache">
1164 <td>
1165 <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>
1166 </td>
1167 <td>
1168 <input type="text" id="diskCache" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(MiB)QBT_TR[CONTEXT=OptionsDialog]
1169 </td>
1170 </tr>
1171 <tr id="rowDiskCacheExpiryInterval">
1172 <td>
1173 <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>
1174 </td>
1175 <td>
1176 <input type="text" id="diskCacheExpiryInterval" style="width: 15em;">&nbsp;&nbsp;QBT_TR(s)QBT_TR[CONTEXT=OptionsDialog]
1177 </td>
1178 </tr>
1179 <tr>
1180 <td>
1181 <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>
1182 </td>
1183 <td>
1184 <input type="text" id="diskQueueSize" style="width: 15em;">&nbsp;&nbsp;QBT_TR(KiB)QBT_TR[CONTEXT=OptionsDialog]
1185 </td>
1186 </tr>
1187 <tr id="rowDiskIOType">
1188 <td>
1189 <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>
1190 </td>
1191 <td>
1192 <select id="diskIOType" style="width: 15em;">
1193 <option value="0">QBT_TR(Default)QBT_TR[CONTEXT=OptionsDialog]</option>
1194 <option value="1">QBT_TR(Memory mapped files)QBT_TR[CONTEXT=OptionsDialog]</option>
1195 <option value="2">QBT_TR(POSIX-compliant)QBT_TR[CONTEXT=OptionsDialog]</option>
1196 </select>
1197 </td>
1198 </tr>
1199 <tr>
1200 <td>
1201 <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>
1202 </td>
1203 <td>
1204 <select id="diskIOReadMode" style="width: 15em;">
1205 <option value="0">QBT_TR(Disable OS cache)QBT_TR[CONTEXT=OptionsDialog]</option>
1206 <option value="1">QBT_TR(Enable OS cache)QBT_TR[CONTEXT=OptionsDialog]</option>
1207 </select>
1208 </td>
1209 </tr>
1210 <tr>
1211 <td>
1212 <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>
1213 </td>
1214 <td>
1215 <select id="diskIOWriteMode" 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 <option value="2" id="diskIOWriteModeWriteThrough">QBT_TR(Write-through)QBT_TR[CONTEXT=OptionsDialog]</option>
1219 </select>
1220 </td>
1221 </tr>
1222 <tr id="rowCoalesceReadsAndWrites">
1223 <td>
1224 <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>
1225 </td>
1226 <td>
1227 <input type="checkbox" id="coalesceReadsAndWrites" />
1228 </td>
1229 </tr>
1230 <tr>
1231 <td>
1232 <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>
1233 </td>
1234 <td>
1235 <input type="checkbox" id="pieceExtentAffinity" />
1236 </td>
1237 </tr>
1238 <tr>
1239 <td>
1240 <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>
1241 </td>
1242 <td>
1243 <input type="checkbox" id="sendUploadPieceSuggestions" />
1244 </td>
1245 </tr>
1246 <tr>
1247 <td>
1248 <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>
1249 </td>
1250 <td>
1251 <input type="text" id="sendBufferWatermark" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(KiB)QBT_TR[CONTEXT=OptionsDialog]
1252 </td>
1253 </tr>
1254 <tr>
1255 <td>
1256 <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>
1257 </td>
1258 <td>
1259 <input type="text" id="sendBufferLowWatermark" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(KiB)QBT_TR[CONTEXT=OptionsDialog]
1260 </td>
1261 </tr>
1262 <tr>
1263 <td>
1264 <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>
1265 </td>
1266 <td>
1267 <input type="text" id="sendBufferWatermarkFactor" style="width: 15em;" />&nbsp;&nbsp;%
1268 </td>
1269 </tr>
1270 <tr>
1271 <td>
1272 <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>
1273 </td>
1274 <td>
1275 <input type="text" id="connectionSpeed" style="width: 15em;" />
1276 </td>
1277 </tr>
1278 <tr>
1279 <td>
1280 <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>
1281 </td>
1282 <td>
1283 <input type="text" id="socketSendBufferSize" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(KiB)QBT_TR[CONTEXT=OptionsDialog]
1284 </td>
1285 </tr>
1286 <tr>
1287 <td>
1288 <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>
1289 </td>
1290 <td>
1291 <input type="text" id="socketReceiveBufferSize" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(KiB)QBT_TR[CONTEXT=OptionsDialog]
1292 </td>
1293 </tr>
1294 <tr>
1295 <td>
1296 <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>
1297 </td>
1298 <td>
1299 <input type="text" id="socketBacklogSize" style="width: 15em;" />
1300 </td>
1301 </tr>
1302 <tr>
1303 <td>
1304 <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>
1305 </td>
1306 <td>
1307 <input type="text" id="outgoingPortsMin" style="width: 15em;" />
1308 </td>
1309 </tr>
1310 <tr>
1311 <td>
1312 <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>
1313 </td>
1314 <td>
1315 <input type="text" id="outgoingPortsMax" style="width: 15em;" />
1316 </td>
1317 </tr>
1318 <tr>
1319 <td>
1320 <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>
1321 </td>
1322 <td>
1323 <input type="text" id="UPnPLeaseDuration" style="width: 15em;" />
1324 </td>
1325 </tr>
1326 <tr>
1327 <td>
1328 <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>
1329 </td>
1330 <td>
1331 <input type="text" id="peerToS" style="width: 15em;" />
1332 </td>
1333 </tr>
1334 <tr>
1335 <td>
1336 <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>
1337 </td>
1338 <td>
1339 <select id="utpTCPMixedModeAlgorithm" style="width: 15em;">
1340 <option value="0">QBT_TR(Prefer TCP)QBT_TR[CONTEXT=OptionsDialog]</option>
1341 <option value="1">QBT_TR(Peer proportional (throttles TCP))QBT_TR[CONTEXT=OptionsDialog]</option>
1342 </select>
1343 </td>
1344 </tr>
1345 <tr>
1346 <td>
1347 <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>
1348 </td>
1349 <td>
1350 <input type="checkbox" id="IDNSupportCheckbox" />
1351 </td>
1352 </tr>
1353 <tr>
1354 <td>
1355 <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>
1356 </td>
1357 <td>
1358 <input type="checkbox" id="allowMultipleConnectionsFromTheSameIPAddress" />
1359 </td>
1360 </tr>
1361 <tr>
1362 <td>
1363 <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>
1364 </td>
1365 <td>
1366 <input type="checkbox" id="validateHTTPSTrackerCertificate" />
1367 </td>
1368 </tr>
1369 <tr>
1370 <td>
1371 <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>
1372 </td>
1373 <td>
1374 <input type="checkbox" id="mitigateSSRF" />
1375 </td>
1376 </tr>
1377 <tr>
1378 <td>
1379 <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>
1380 </td>
1381 <td>
1382 <input type="checkbox" id="blockPeersOnPrivilegedPorts" />
1383 </td>
1384 </tr>
1385 <tr>
1386 <td>
1387 <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>
1388 </td>
1389 <td>
1390 <select id="uploadSlotsBehavior" style="width: 15em;">
1391 <option value="0">QBT_TR(Fixed slots)QBT_TR[CONTEXT=OptionsDialog]</option>
1392 <option value="1">QBT_TR(Upload rate based)QBT_TR[CONTEXT=OptionsDialog]</option>
1393 </select>
1394 </td>
1395 </tr>
1396 <tr>
1397 <td>
1398 <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>
1399 </td>
1400 <td>
1401 <select id="uploadChokingAlgorithm" style="width: 15em;">
1402 <option value="0">QBT_TR(Round-robin)QBT_TR[CONTEXT=OptionsDialog]</option>
1403 <option value="1">QBT_TR(Fastest upload)QBT_TR[CONTEXT=OptionsDialog]</option>
1404 <option value="2">QBT_TR(Anti-leech)QBT_TR[CONTEXT=OptionsDialog]</option>
1405 </select>
1406 </td>
1407 </tr>
1408 <tr>
1409 <td>
1410 <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>
1411 </td>
1412 <td>
1413 <input type="checkbox" id="announceAllTrackers" />
1414 </td>
1415 </tr>
1416 <tr>
1417 <td>
1418 <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>
1419 </td>
1420 <td>
1421 <input type="checkbox" id="announceAllTiers" />
1422 </td>
1423 </tr>
1424 <tr>
1425 <td>
1426 <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>
1427 </td>
1428 <td>
1429 <input type="text" id="announceIP" style="width: 15em;" />
1430 </td>
1431 </tr>
1432 <tr>
1433 <td>
1434 <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>
1435 </td>
1436 <td>
1437 <input type="text" id="maxConcurrentHTTPAnnounces" style="width: 15em;" />
1438 </td>
1439 </tr>
1440 <tr>
1441 <td>
1442 <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>
1443 </td>
1444 <td>
1445 <input type="text" id="stopTrackerTimeout" style="width: 15em;" />
1446 </td>
1447 </tr>
1448 <tr>
1449 <td>
1450 <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>
1451 </td>
1452 <td>
1453 <input type="text" id="peerTurnover" style="width: 15em;" />&nbsp;&nbsp;%
1454 </td>
1455 </tr>
1456 <tr>
1457 <td>
1458 <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>
1459 </td>
1460 <td>
1461 <input type="text" id="peerTurnoverCutoff" style="width: 15em;" />&nbsp;&nbsp;%
1462 </td>
1463 </tr>
1464 <tr>
1465 <td>
1466 <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>
1467 </td>
1468 <td>
1469 <input type="text" id="peerTurnoverInterval" style="width: 15em;" />&nbsp;&nbsp;s
1470 </td>
1471 </tr>
1472 <tr>
1473 <td>
1474 <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>
1475 </td>
1476 <td>
1477 <input type="text" id="requestQueueSize" style="width: 15em;" />
1478 </td>
1479 </tr>
1480 <tr>
1481 <td>
1482 <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>
1483 </td>
1484 <td>
1485 <input type="text" id="dhtBootstrapNodes" placeholder="QBT_TR(Resets to default if empty)QBT_TR[CONTEXT=OptionsDialog]" style="width: 15em;" />
1486 </td>
1487 </tr>
1488 <tr id="rowI2pInboundQuantity">
1489 <td>
1490 <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>
1491 </td>
1492 <td>
1493 <input id="i2pInboundQuantity" type="number" min="1" max="16" onchange="qBittorrent.Preferences.numberInputLimiter(this);" style="width: 15em;" />
1494 </td>
1495 </tr>
1496 <tr id="rowI2pOutboundQuantity">
1497 <td>
1498 <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>
1499 </td>
1500 <td>
1501 <input id="i2pOutboundQuantity" type="number" min="1" max="16" onchange="qBittorrent.Preferences.numberInputLimiter(this);" style="width: 15em;" />
1502 </td>
1503 </tr>
1504 <tr id="rowI2pInboundLength">
1505 <td>
1506 <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>
1507 </td>
1508 <td>
1509 <input id="i2pInboundLength" type="number" min="0" max="7" onchange="qBittorrent.Preferences.numberInputLimiter(this);" style="width: 15em;" />
1510 </td>
1511 </tr>
1512 <tr id="rowI2pOutboundLength">
1513 <td>
1514 <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>
1515 </td>
1516 <td>
1517 <input id="i2pOutboundLength" type="number" min="0" max="7" onchange="qBittorrent.Preferences.numberInputLimiter(this);" style="width: 15em;" />
1518 </td>
1519 </tr>
1520 </table>
1521 </fieldset>
1522 </div>
1524 <div style="text-align: center; margin-top: 1em;"><input type="button" value="QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" onclick="qBittorrent.Preferences.applyPreferences();" /></div>
1526 <script>
1527 'use strict';
1529 if (window.qBittorrent === undefined) {
1530 window.qBittorrent = {};
1533 window.qBittorrent.Preferences = (function() {
1534 const exports = function() {
1535 return {
1536 numberInputLimiter: numberInputLimiter,
1537 updateFileLogEnabled: updateFileLogEnabled,
1538 updateFileLogBackupEnabled: updateFileLogBackupEnabled,
1539 updateFileLogDeleteEnabled: updateFileLogDeleteEnabled,
1540 updateTempDirEnabled: updateTempDirEnabled,
1541 updateExportDirEnabled: updateExportDirEnabled,
1542 updateExportDirFinEnabled: updateExportDirFinEnabled,
1543 addWatchFolder: addWatchFolder,
1544 updateExcludedFileNamesEnabled: updateExcludedFileNamesEnabled,
1545 changeWatchFolderSelect: changeWatchFolderSelect,
1546 updateMailNotification: updateMailNotification,
1547 updateMailAuthSettings: updateMailAuthSettings,
1548 updateAutoRun: updateAutoRun,
1549 updateAutoRunOnTorrentAdded: updateAutoRunOnTorrentAdded,
1550 generateRandomPort: generateRandomPort,
1551 updateMaxConnecEnabled: updateMaxConnecEnabled,
1552 updateMaxConnecPerTorrentEnabled: updateMaxConnecPerTorrentEnabled,
1553 updateMaxUploadsEnabled: updateMaxUploadsEnabled,
1554 updateMaxUploadsPerTorrentEnabled: updateMaxUploadsPerTorrentEnabled,
1555 updateI2PSettingsEnabled: updateI2PSettingsEnabled,
1556 updatePeerProxySettings: updatePeerProxySettings,
1557 updatePeerProxyAuthSettings: updatePeerProxyAuthSettings,
1558 updateFilterSettings: updateFilterSettings,
1559 updateSchedulingEnabled: updateSchedulingEnabled,
1560 updateQueueingSystem: updateQueueingSystem,
1561 updateSlowTorrentsSettings: updateSlowTorrentsSettings,
1562 updateMaxRatioTimeEnabled: updateMaxRatioTimeEnabled,
1563 updateAddTrackersEnabled: updateAddTrackersEnabled,
1564 updateHttpsSettings: updateHttpsSettings,
1565 updateBypasssAuthSettings: updateBypasssAuthSettings,
1566 updateAlternativeWebUISettings: updateAlternativeWebUISettings,
1567 updateHostHeaderValidationSettings: updateHostHeaderValidationSettings,
1568 updateWebUICustomHTTPHeadersSettings: updateWebUICustomHTTPHeadersSettings,
1569 updateWebUIReverseProxySettings: updateWebUIReverseProxySettings,
1570 updateDynDnsSettings: updateDynDnsSettings,
1571 updateWebuiLocaleSelect: updateWebuiLocaleSelect,
1572 registerDynDns: registerDynDns,
1573 applyPreferences: applyPreferences
1577 // hide entries
1578 const buildInfo = window.qBittorrent.Cache.buildInfo.get();
1580 const libtorrentVersion = window.qBittorrent.Misc.parseVersion(buildInfo.libtorrent);
1581 if (libtorrentVersion.valid) {
1582 if (libtorrentVersion.major >= 2) {
1583 $('rowDiskCache').style.display = 'none';
1584 $('rowDiskCacheExpiryInterval').style.display = 'none';
1585 $('rowCoalesceReadsAndWrites').style.display = 'none';
1587 else {
1588 $('fieldsetI2p').style.display = 'none';
1589 $('rowMemoryWorkingSetLimit').style.display = 'none';
1590 $('rowHashingThreads').style.display = 'none';
1591 $('rowDiskIOType').style.display = 'none';
1592 $('rowI2pInboundQuantity').style.display = 'none';
1593 $('rowI2pOutboundQuantity').style.display = 'none';
1594 $('rowI2pInboundLength').style.display = 'none';
1595 $('rowI2pOutboundLength').style.display = 'none';
1598 if (!((libtorrentVersion.major >= 2) && (libtorrentVersion.minor >= 0) && (libtorrentVersion.fix >= 6)))
1599 $('diskIOWriteModeWriteThrough').style.display = 'none';
1602 if ((buildInfo.platform !== 'macos') && (buildInfo.platform !== 'windows'))
1603 $('rowMarkOfTheWeb').style.display = 'none';
1605 // Behavior tab
1606 const numberInputLimiter = (input) => {
1607 const min = input.getAttribute("min");
1608 const max = input.getAttribute("max");
1610 if (min && input.value.toInt() < min.toInt())
1611 input.value = min;
1613 if (max && input.value.toInt() > max.toInt())
1614 input.value = max;
1617 const updateFileLogEnabled = function() {
1618 const isFileLogEnabled = $('filelog_checkbox').getProperty('checked');
1619 $('filelog_save_path_input').setProperty('disabled', !isFileLogEnabled);
1620 $('filelog_backup_checkbox').setProperty('disabled', !isFileLogEnabled);
1621 $('filelog_delete_old_checkbox').setProperty('disabled', !isFileLogEnabled);
1623 updateFileLogBackupEnabled();
1624 updateFileLogDeleteEnabled();
1627 const updateFileLogBackupEnabled = function() {
1628 const pros = $('filelog_backup_checkbox').getProperties('disabled', 'checked');
1629 $('filelog_max_size_input').setProperty('disabled', pros.disabled || !pros.checked);
1632 const updateFileLogDeleteEnabled = function() {
1633 const pros = $('filelog_delete_old_checkbox').getProperties('disabled', 'checked');
1634 $('filelog_age_input').setProperty('disabled', pros.disabled || !pros.checked);
1635 $('filelog_age_type_select').setProperty('disabled', pros.disabled || !pros.checked);
1638 // Downloads tab
1639 const watchedFoldersTable = new HtmlTable($("watched_folders_tab"));
1641 const updateTempDirEnabled = function() {
1642 const isTempDirEnabled = $('temppath_checkbox').getProperty('checked');
1643 $('temppath_text').setProperty('disabled', !isTempDirEnabled);
1646 const changeWatchFolderSelect = (item) => {
1647 if (item.value === "other") {
1648 item.nextElementSibling.hidden = false;
1649 item.nextElementSibling.value = 'QBT_TR(Type folder here)QBT_TR[CONTEXT=ScanFoldersModel]';
1650 item.nextElementSibling.select();
1652 else {
1653 item.nextElementSibling.hidden = true;
1654 const text = item.options[item.selectedIndex].textContent;
1655 item.nextElementSibling.value = text;
1659 const addWatchFolder = (folder = "", sel = "default_folder", other = "") => {
1660 const pos = $('watched_folders_tab').getChildren('tbody')[0].getChildren('tr').length;
1661 const myinput = "<input id='text_watch_" + pos + "' type='text' value='" + folder + "'>";
1662 const disableInput = (sel !== "other");
1663 const mycb = "<div class='select-watched-folder-editable'>"
1664 + "<select id ='cb_watch_" + pos + "' onchange='qBittorrent.Preferences.changeWatchFolderSelect(this)'>"
1665 + "<option value='watch_folder'>QBT_TR(Monitored folder)QBT_TR[CONTEXT=ScanFoldersModel]</option>"
1666 + "<option value='default_folder'>QBT_TR(Default save location)QBT_TR[CONTEXT=ScanFoldersModel]</option>"
1667 + "<option value='other'>QBT_TR(Other...)QBT_TR[CONTEXT=ScanFoldersModel]</option>"
1668 + "</select>"
1669 + "<input id='cb_watch_txt_" + pos + "' type='text' " + (disableInput ? "hidden " : "") + "/>"
1670 + "<img src='images/list-add.svg' id='addFolderImg_" + pos + "' alt='Add' style='padding-left:170px;width:16px;cursor:pointer;' onclick='qBittorrent.Preferences.addWatchFolder();' />"
1671 + "</div>";
1673 watchedFoldersTable.push([myinput, mycb]);
1674 $('cb_watch_' + pos).setProperty('value', sel);
1675 if (disableInput) {
1676 const elt = $('cb_watch_' + pos);
1677 other = elt.options[elt.selectedIndex].textContent;
1679 $('cb_watch_txt_' + pos).setProperty('value', other);
1681 // hide previous img
1682 if (pos > 0)
1683 $('addFolderImg_' + (pos - 1)).style.display = "none";
1686 const getWatchedFolders = () => {
1687 const nb_folders = $("watched_folders_tab").getChildren("tbody")[0].getChildren("tr").length;
1688 const folders = new Hash();
1689 for (let i = 0; i < nb_folders; ++i) {
1690 const fpath = $('text_watch_' + i).getProperty('value').trim();
1691 if (fpath.length > 0) {
1692 const sel = $('cb_watch_' + i).getProperty('value').trim();
1694 let other;
1695 if (sel === "other")
1696 other = $('cb_watch_txt_' + i).getProperty('value').trim();
1697 else
1698 other = (sel === "watch_folder") ? 0 : 1;
1700 folders.set(fpath, other);
1703 return folders;
1706 const updateExcludedFileNamesEnabled = function() {
1707 const isAExcludedFileNamesEnabled = $('excludedFileNamesCheckbox').getProperty('checked');
1708 $('excludedFileNamesTextarea').setProperty('disabled', !isAExcludedFileNamesEnabled);
1711 const updateExportDirEnabled = function() {
1712 const isExportDirEnabled = $('exportdir_checkbox').getProperty('checked');
1713 $('exportdir_text').setProperty('disabled', !isExportDirEnabled);
1716 const updateExportDirFinEnabled = function() {
1717 const isExportDirFinEnabled = $('exportdirfin_checkbox').getProperty('checked');
1718 $('exportdirfin_text').setProperty('disabled', !isExportDirFinEnabled);
1721 const updateMailNotification = function() {
1722 const isMailNotificationEnabled = $('mail_notification_checkbox').getProperty('checked');
1723 $('src_email_txt').setProperty('disabled', !isMailNotificationEnabled);
1724 $('dest_email_txt').setProperty('disabled', !isMailNotificationEnabled);
1725 $('smtp_server_txt').setProperty('disabled', !isMailNotificationEnabled);
1726 $('mail_ssl_checkbox').setProperty('disabled', !isMailNotificationEnabled);
1727 $('mail_auth_checkbox').setProperty('disabled', !isMailNotificationEnabled);
1729 if (!isMailNotificationEnabled) {
1730 $('mail_auth_checkbox').setProperty('checked', !isMailNotificationEnabled);
1731 updateMailAuthSettings();
1735 const updateMailAuthSettings = function() {
1736 const isMailAuthEnabled = $('mail_auth_checkbox').getProperty('checked');
1737 $('mail_username_text').setProperty('disabled', !isMailAuthEnabled);
1738 $('mail_password_text').setProperty('disabled', !isMailAuthEnabled);
1741 const updateAutoRunOnTorrentAdded = function() {
1742 const isAutoRunOnTorrentAddedEnabled = $('autorunOnTorrentAddedCheckbox').getProperty('checked');
1743 $('autorunOnTorrentAddedProgram').setProperty('disabled', !isAutoRunOnTorrentAddedEnabled);
1746 const updateAutoRun = function() {
1747 const isAutoRunEnabled = $('autorun_checkbox').getProperty('checked');
1748 $('autorunProg_txt').setProperty('disabled', !isAutoRunEnabled);
1751 // Connection tab
1753 const updateMaxConnecEnabled = function() {
1754 const isMaxConnecEnabled = $('max_connec_checkbox').getProperty('checked');
1755 $('max_connec_value').setProperty('disabled', !isMaxConnecEnabled);
1758 const updateMaxConnecPerTorrentEnabled = function() {
1759 const isMaxConnecPerTorrentEnabled = $('max_connec_per_torrent_checkbox').getProperty('checked');
1760 $('max_connec_per_torrent_value').setProperty('disabled', !isMaxConnecPerTorrentEnabled);
1763 const updateMaxUploadsEnabled = function() {
1764 const isMaxUploadsEnabled = $('max_uploads_checkbox').getProperty('checked');
1765 $('max_uploads_value').setProperty('disabled', !isMaxUploadsEnabled);
1768 const updateMaxUploadsPerTorrentEnabled = function() {
1769 const isMaxUploadsPerTorrentEnabled = $('max_uploads_per_torrent_checkbox').getProperty('checked');
1770 $('max_uploads_per_torrent_value').setProperty('disabled', !isMaxUploadsPerTorrentEnabled);
1773 const updateI2PSettingsEnabled = function() {
1774 const isI2PEnabled = $('i2pEnabledCheckbox').getProperty('checked');
1775 $('i2pAddress').setProperty('disabled', !isI2PEnabled);
1776 $('i2pPort').setProperty('disabled', !isI2PEnabled);
1777 $('i2pMixedMode').setProperty('disabled', !isI2PEnabled);
1780 const updatePeerProxySettings = function() {
1781 const proxyType = $('peer_proxy_type_select').getProperty('value');
1782 const isProxyDisabled = (proxyType === "None");
1783 const isProxySocks4 = (proxyType === "SOCKS4");
1785 $('peer_proxy_host_text').setProperty('disabled', isProxyDisabled);
1786 $('peer_proxy_port_value').setProperty('disabled', isProxyDisabled);
1788 $('peer_proxy_auth_checkbox').setProperty('disabled', (isProxyDisabled || isProxySocks4));
1789 $('proxy_bittorrent_checkbox').setProperty('disabled', isProxyDisabled);
1790 $('use_peer_proxy_checkbox').setProperty('disabled', (isProxyDisabled || !$('proxy_bittorrent_checkbox').getProperty('checked')));
1791 $('proxyHostnameLookupCheckbox').setProperty('disabled', (isProxyDisabled || isProxySocks4));
1792 $('proxy_rss_checkbox').setProperty('disabled', (isProxyDisabled || isProxySocks4));
1793 $('proxy_misc_checkbox').setProperty('disabled', (isProxyDisabled || isProxySocks4));
1795 updatePeerProxyAuthSettings();
1798 const updatePeerProxyAuthSettings = function() {
1799 const proxyType = $('peer_proxy_type_select').getProperty('value');
1800 const isProxyDisabled = (proxyType === "None");
1801 const isPeerProxyAuthEnabled = (!$('peer_proxy_auth_checkbox').getProperty('disabled') && $('peer_proxy_auth_checkbox').getProperty('checked'));
1802 $('peer_proxy_username_text').setProperty('disabled', (isProxyDisabled || !isPeerProxyAuthEnabled));
1803 $('peer_proxy_password_text').setProperty('disabled', (isProxyDisabled || !isPeerProxyAuthEnabled));
1806 const updateFilterSettings = function() {
1807 const isIPFilterEnabled = $('ipfilter_text_checkbox').getProperty('checked');
1808 $('ipfilter_text').setProperty('disabled', !isIPFilterEnabled);
1811 // Speed tab
1812 const updateSchedulingEnabled = function() {
1813 const isLimitSchedulingEnabled = $('limitSchedulingCheckbox').getProperty('checked');
1814 $('schedule_from_hour').setProperty('disabled', !isLimitSchedulingEnabled);
1815 $('schedule_from_min').setProperty('disabled', !isLimitSchedulingEnabled);
1816 $('schedule_to_hour').setProperty('disabled', !isLimitSchedulingEnabled);
1817 $('schedule_to_min').setProperty('disabled', !isLimitSchedulingEnabled);
1818 $('schedule_freq_select').setProperty('disabled', !isLimitSchedulingEnabled);
1821 // Bittorrent tab
1822 const updateQueueingSystem = function() {
1823 const isQueueingEnabled = $('queueing_checkbox').getProperty('checked');
1824 $('max_active_dl_value').setProperty('disabled', !isQueueingEnabled);
1825 $('max_active_up_value').setProperty('disabled', !isQueueingEnabled);
1826 $('max_active_to_value').setProperty('disabled', !isQueueingEnabled);
1827 $('dont_count_slow_torrents_checkbox').setProperty('disabled', !isQueueingEnabled);
1828 updateSlowTorrentsSettings();
1831 const updateSlowTorrentsSettings = function() {
1832 const isDontCountSlowTorrentsEnabled = (!$('dont_count_slow_torrents_checkbox').getProperty('disabled')) && $('dont_count_slow_torrents_checkbox').getProperty('checked');
1833 $('dl_rate_threshold').setProperty('disabled', !isDontCountSlowTorrentsEnabled);
1834 $('ul_rate_threshold').setProperty('disabled', !isDontCountSlowTorrentsEnabled);
1835 $('torrent_inactive_timer').setProperty('disabled', !isDontCountSlowTorrentsEnabled);
1838 const updateMaxRatioTimeEnabled = function() {
1839 const isMaxRatioEnabled = $('max_ratio_checkbox').getProperty('checked');
1840 $('max_ratio_value').setProperty('disabled', !isMaxRatioEnabled);
1842 const isMaxSeedingTimeEnabled = $('max_seeding_time_checkbox').getProperty('checked');
1843 $('max_seeding_time_value').setProperty('disabled', !isMaxSeedingTimeEnabled);
1845 const isMaxInactiveSeedingTimeEnabled = $('max_inactive_seeding_time_checkbox').getProperty('checked');
1846 $('max_inactive_seeding_time_value').setProperty('disabled', !isMaxInactiveSeedingTimeEnabled);
1848 $('max_ratio_act').setProperty('disabled', !(isMaxRatioEnabled || isMaxSeedingTimeEnabled || isMaxInactiveSeedingTimeEnabled));
1851 const updateAddTrackersEnabled = function() {
1852 const isAddTrackersEnabled = $('add_trackers_checkbox').getProperty('checked');
1853 $('add_trackers_textarea').setProperty('disabled', !isAddTrackersEnabled);
1856 // Web UI tab
1857 const updateHttpsSettings = function() {
1858 const isUseHttpsEnabled = $('use_https_checkbox').getProperty('checked');
1859 $('ssl_cert_text').setProperty('disabled', !isUseHttpsEnabled);
1860 $('ssl_key_text').setProperty('disabled', !isUseHttpsEnabled);
1861 $('secureCookieCheckbox').setProperty('disabled', !isUseHttpsEnabled);
1864 const updateBypasssAuthSettings = function() {
1865 const isBypassAuthSubnetWhitelistEnabled = $('bypass_auth_subnet_whitelist_checkbox').getProperty('checked');
1866 $('bypass_auth_subnet_whitelist_textarea').setProperty('disabled', !isBypassAuthSubnetWhitelistEnabled);
1869 const updateAlternativeWebUISettings = function() {
1870 const isUseAlternativeWebUIEnabled = $('use_alt_webui_checkbox').getProperty('checked');
1871 $('webui_files_location_textarea').setProperty('disabled', !isUseAlternativeWebUIEnabled);
1874 const updateHostHeaderValidationSettings = function() {
1875 const isHostHeaderValidationEnabled = $('host_header_validation_checkbox').getProperty('checked');
1876 $('webui_domain_textarea').setProperty('disabled', !isHostHeaderValidationEnabled);
1879 const updateWebUICustomHTTPHeadersSettings = function() {
1880 const isEnabled = $('webUIUseCustomHTTPHeadersCheckbox').getProperty('checked');
1881 $('webUICustomHTTPHeadersTextarea').setProperty('disabled', !isEnabled);
1884 const updateWebUIReverseProxySettings = function() {
1885 const isEnabled = $('webUIReverseProxySupportCheckbox').getProperty('checked');
1886 $('webUIReverseProxiesListTextarea').setProperty('disabled', !isEnabled);
1889 const updateDynDnsSettings = function() {
1890 const isDynDnsEnabled = $('use_dyndns_checkbox').getProperty('checked');
1891 $('dyndns_select').setProperty('disabled', !isDynDnsEnabled);
1892 $('dyndns_domain_text').setProperty('disabled', !isDynDnsEnabled);
1893 $('dyndns_username_text').setProperty('disabled', !isDynDnsEnabled);
1894 $('dyndns_password_text').setProperty('disabled', !isDynDnsEnabled);
1897 const registerDynDns = function() {
1898 if ($('dyndns_select').getProperty('value').toInt() == 1) {
1899 window.open("http://www.no-ip.com/services/managed_dns/free_dynamic_dns.html", "NO-IP Registration");
1901 else {
1902 window.open("https://www.dyndns.com/account/services/hosts/add.html", "DynDNS Registration");
1906 const generateRandomPort = function() {
1907 const min = 1024;
1908 const max = 65535;
1909 const port = Math.floor(Math.random() * (max - min + 1) + min);
1910 $('port_value').setProperty('value', port);
1913 const time_padding = function(val) {
1914 let ret = val.toString();
1915 if (ret.length == 1)
1916 ret = '0' + ret;
1917 return ret;
1920 // Advanced Tab
1921 const updateNetworkInterfaces = function(default_iface, default_iface_name) {
1922 const url = 'api/v2/app/networkInterfaceList';
1923 $('networkInterface').getChildren().each(c => c.destroy());
1924 new Request.JSON({
1925 url: url,
1926 method: 'get',
1927 noCache: true,
1928 onFailure: function() {
1929 alert("Could not contact qBittorrent");
1931 onSuccess: function(ifaces) {
1932 if (!Array.isArray(ifaces))
1933 return;
1935 // add the current network interface to the options if needed
1936 if (default_iface && !ifaces.some((item) => item.value === default_iface))
1937 ifaces.push({ name: default_iface_name || default_iface, value: default_iface });
1939 $('networkInterface').options.add(new Option('QBT_TR(Any interface)QBT_TR[CONTEXT=OptionsDialog]', ''));
1940 ifaces.forEach(function(item, index) {
1941 $('networkInterface').options.add(new Option(item.name, item.value));
1943 $('networkInterface').setProperty('value', default_iface);
1945 }).send();
1948 const updateInterfaceAddresses = function(iface, default_addr) {
1949 const url = 'api/v2/app/networkInterfaceAddressList';
1950 $('optionalIPAddressToBind').getChildren().each(c => c.destroy());
1951 new Request.JSON({
1952 url: url,
1953 method: 'get',
1954 noCache: true,
1955 data: {
1956 'iface': iface
1958 onFailure: function() {
1959 alert("Could not contact qBittorrent");
1961 onSuccess: function(addresses) {
1962 if (!addresses)
1963 return;
1965 $('optionalIPAddressToBind').options.add(new Option('QBT_TR(All addresses)QBT_TR[CONTEXT=OptionDialog]', ''));
1966 $('optionalIPAddressToBind').options.add(new Option('QBT_TR(All IPv4 addresses)QBT_TR[CONTEXT=OptionDialog]', '0.0.0.0'));
1967 $('optionalIPAddressToBind').options.add(new Option('QBT_TR(All IPv6 addresses)QBT_TR[CONTEXT=OptionDialog]', '::'));
1968 addresses.forEach(function(item, index) {
1969 $('optionalIPAddressToBind').options.add(new Option(item, item));
1971 $('optionalIPAddressToBind').setProperty('value', default_addr);
1973 }).send();
1976 const updateWebuiLocaleSelect = (selected) => {
1977 let languages = [];
1978 for (let i = 0; i < $('locale_select').options.length; i++)
1979 languages.push($('locale_select').options[i].value);
1981 if (!languages.includes(selected)) {
1982 const lang = selected.slice(0, selected.indexOf('_'));
1983 selected = languages.includes(lang) ? lang : 'en';
1985 $('locale_select').setProperty('value', selected);
1988 const loadPreferences = function() {
1989 window.parent.qBittorrent.Cache.preferences.init({
1990 onSuccess: (pref) => {
1991 // Behavior tab
1992 $('filelog_checkbox').setProperty('checked', pref.file_log_enabled);
1993 $('filelog_save_path_input').setProperty('value', pref.file_log_path);
1994 $('filelog_backup_checkbox').setProperty('checked', pref.file_log_backup_enabled);
1995 $('filelog_max_size_input').setProperty('value', pref.file_log_max_size);
1996 $('filelog_delete_old_checkbox').setProperty('checked', pref.file_log_delete_old);
1997 $('filelog_age_input').setProperty('value', pref.file_log_age);
1998 $('filelog_age_type_select').setProperty('value', pref.file_log_age_type);
1999 updateFileLogEnabled();
2001 // Downloads tab
2002 // When adding a torrent
2003 let index = 0;
2004 switch (pref.torrent_content_layout) {
2005 case "Original":
2006 index = 0;
2007 break;
2008 case "Subfolder":
2009 index = 1;
2010 break;
2011 case "NoSubfolder":
2012 index = 2;
2013 break;
2015 $('contentlayout_select').getChildren('option')[index].selected = true;
2016 $('addToTopOfQueueCheckbox').setProperty('checked', pref.add_to_top_of_queue);
2017 $('dontstartdownloads_checkbox').setProperty('checked', pref.start_paused_enabled);
2018 switch (pref.torrent_stop_condition) {
2019 case "None":
2020 index = 0;
2021 break;
2022 case "MetadataReceived":
2023 index = 1;
2024 break;
2025 case "FilesChecked":
2026 index = 2;
2027 break;
2029 $('stopConditionSelect').getChildren('option')[index].selected = true;
2030 $('deletetorrentfileafter_checkbox').setProperty('checked', pref.auto_delete_mode);
2032 $('preallocateall_checkbox').setProperty('checked', pref.preallocate_all);
2033 $('appendext_checkbox').setProperty('checked', pref.incomplete_files_ext);
2034 $('unwantedfolder_checkbox').setProperty('checked', pref.use_unwanted_folder);
2036 // Saving Management
2037 $('default_tmm_combobox').setProperty('value', pref.auto_tmm_enabled);
2038 $('torrent_changed_tmm_combobox').setProperty('value', pref.torrent_changed_tmm_enabled);
2039 $('save_path_changed_tmm_combobox').setProperty('value', pref.save_path_changed_tmm_enabled);
2040 $('category_changed_tmm_combobox').setProperty('value', pref.category_changed_tmm_enabled);
2041 $('use_subcategories_checkbox').setProperty('checked', pref.use_subcategories);
2042 $('savepath_text').setProperty('value', pref.save_path);
2043 $('temppath_checkbox').setProperty('checked', pref.temp_path_enabled);
2044 $('temppath_text').setProperty('value', pref.temp_path);
2045 updateTempDirEnabled();
2046 if (pref.export_dir != '') {
2047 $('exportdir_checkbox').setProperty('checked', true);
2048 $('exportdir_text').setProperty('value', pref.export_dir);
2050 else {
2051 $('exportdir_checkbox').setProperty('checked', false);
2052 $('exportdir_text').setProperty('value', '');
2054 updateExportDirEnabled();
2055 if (pref.export_dir_fin != '') {
2056 $('exportdirfin_checkbox').setProperty('checked', true);
2057 $('exportdirfin_text').setProperty('value', pref.export_dir_fin);
2059 else {
2060 $('exportdirfin_checkbox').setProperty('checked', false);
2061 $('exportdirfin_text').setProperty('value', '');
2063 updateExportDirFinEnabled();
2065 // Automatically add torrents from
2066 for (const folder in pref.scan_dirs) {
2067 if (!Object.hasOwn(pref.scan_dirs, folder))
2068 continue;
2070 const folderType = pref.scan_dirs[folder];
2071 let sel = "";
2072 let other = "";
2073 if (typeof folderType === "number") {
2074 sel = (folderType === 0) ? "watch_folder" : "default_folder";
2076 else {
2077 sel = "other";
2078 other = folderType;
2080 addWatchFolder(folder, sel, other);
2082 addWatchFolder();
2084 // Excluded file names
2085 $('excludedFileNamesCheckbox').setProperty('checked', pref.excluded_file_names_enabled);
2086 $('excludedFileNamesTextarea').setProperty('value', pref.excluded_file_names);
2088 // Email notification upon download completion
2089 $('mail_notification_checkbox').setProperty('checked', pref.mail_notification_enabled);
2090 $('src_email_txt').setProperty('value', pref.mail_notification_sender);
2091 $('dest_email_txt').setProperty('value', pref.mail_notification_email);
2092 $('smtp_server_txt').setProperty('value', pref.mail_notification_smtp);
2093 $('mail_ssl_checkbox').setProperty('checked', pref.mail_notification_ssl_enabled);
2094 $('mail_auth_checkbox').setProperty('checked', pref.mail_notification_auth_enabled);
2095 $('mail_username_text').setProperty('value', pref.mail_notification_username);
2096 $('mail_password_text').setProperty('value', pref.mail_notification_password);
2097 updateMailNotification();
2098 updateMailAuthSettings();
2100 // Run an external program on torrent added
2101 $('autorunOnTorrentAddedCheckbox').setProperty('checked', pref.autorun_on_torrent_added_enabled);
2102 $('autorunOnTorrentAddedProgram').setProperty('value', pref.autorun_on_torrent_added_program);
2103 updateAutoRunOnTorrentAdded();
2104 // Run an external program on torrent finished
2105 $('autorun_checkbox').setProperty('checked', pref.autorun_enabled);
2106 $('autorunProg_txt').setProperty('value', pref.autorun_program);
2107 updateAutoRun();
2109 // Connection tab
2110 // Listening Port
2111 $('port_value').setProperty('value', pref.listen_port.toInt());
2112 $('upnp_checkbox').setProperty('checked', pref.upnp);
2114 // Connections Limits
2115 const max_connec = pref.max_connec.toInt();
2116 if (max_connec <= 0) {
2117 $('max_connec_checkbox').setProperty('checked', false);
2118 $('max_connec_value').setProperty('value', 500);
2120 else {
2121 $('max_connec_checkbox').setProperty('checked', true);
2122 $('max_connec_value').setProperty('value', max_connec);
2124 updateMaxConnecEnabled();
2125 const max_connec_per_torrent = pref.max_connec_per_torrent.toInt();
2126 if (max_connec_per_torrent <= 0) {
2127 $('max_connec_per_torrent_checkbox').setProperty('checked', false);
2128 $('max_connec_per_torrent_value').setProperty('value', 100);
2130 else {
2131 $('max_connec_per_torrent_checkbox').setProperty('checked', true);
2132 $('max_connec_per_torrent_value').setProperty('value', max_connec_per_torrent);
2134 updateMaxConnecPerTorrentEnabled();
2135 const max_uploads = pref.max_uploads.toInt();
2136 if (max_uploads <= 0) {
2137 $('max_uploads_checkbox').setProperty('checked', false);
2138 $('max_uploads_value').setProperty('value', 8);
2140 else {
2141 $('max_uploads_checkbox').setProperty('checked', true);
2142 $('max_uploads_value').setProperty('value', max_uploads);
2144 updateMaxUploadsEnabled();
2145 const max_uploads_per_torrent = pref.max_uploads_per_torrent.toInt();
2146 if (max_uploads_per_torrent <= 0) {
2147 $('max_uploads_per_torrent_checkbox').setProperty('checked', false);
2148 $('max_uploads_per_torrent_value').setProperty('value', 4);
2150 else {
2151 $('max_uploads_per_torrent_checkbox').setProperty('checked', true);
2152 $('max_uploads_per_torrent_value').setProperty('value', max_uploads_per_torrent);
2154 updateMaxUploadsPerTorrentEnabled();
2156 // I2P
2157 $('i2pEnabledCheckbox').setProperty('checked', pref.i2p_enabled);
2158 $('i2pAddress').setProperty('value', pref.i2p_address);
2159 $('i2pPort').setProperty('value', pref.i2p_port);
2160 $('i2pMixedMode').setProperty('checked', pref.i2p_mixed_mode);
2161 updateI2PSettingsEnabled();
2163 // Proxy Server
2164 $('peer_proxy_type_select').setProperty('value', pref.proxy_type);
2165 $('peer_proxy_host_text').setProperty('value', pref.proxy_ip);
2166 $('peer_proxy_port_value').setProperty('value', pref.proxy_port);
2167 $('peer_proxy_auth_checkbox').setProperty('checked', pref.proxy_auth_enabled);
2168 $('peer_proxy_username_text').setProperty('value', pref.proxy_username);
2169 $('peer_proxy_password_text').setProperty('value', pref.proxy_password);
2170 $('proxyHostnameLookupCheckbox').setProperty('checked', pref.proxy_hostname_lookup);
2171 $('proxy_bittorrent_checkbox').setProperty('checked', pref.proxy_bittorrent);
2172 $('use_peer_proxy_checkbox').setProperty('checked', pref.proxy_peer_connections);
2173 $('proxy_rss_checkbox').setProperty('checked', pref.proxy_rss);
2174 $('proxy_misc_checkbox').setProperty('checked', pref.proxy_misc);
2175 updatePeerProxySettings();
2177 // IP Filtering
2178 $('ipfilter_text_checkbox').setProperty('checked', pref.ip_filter_enabled);
2179 $('ipfilter_text').setProperty('value', pref.ip_filter_path);
2180 $('ipfilter_trackers_checkbox').setProperty('checked', pref.ip_filter_trackers);
2181 $('banned_IPs_textarea').setProperty('value', pref.banned_IPs);
2182 updateFilterSettings();
2184 // Speed tab
2185 // Global Rate Limits
2186 $('up_limit_value').setProperty('value', (pref.up_limit.toInt() / 1024));
2187 $('dl_limit_value').setProperty('value', (pref.dl_limit.toInt() / 1024));
2188 // Alternative Global Rate Limits
2189 $('alt_up_limit_value').setProperty('value', (pref.alt_up_limit.toInt() / 1024));
2190 $('alt_dl_limit_value').setProperty('value', (pref.alt_dl_limit.toInt() / 1024));
2192 $('enable_protocol_combobox').setProperty('value', pref.bittorrent_protocol);
2193 $('limit_utp_rate_checkbox').setProperty('checked', pref.limit_utp_rate);
2194 $('limit_tcp_overhead_checkbox').setProperty('checked', pref.limit_tcp_overhead);
2195 $('limit_lan_peers_checkbox').setProperty('checked', pref.limit_lan_peers);
2197 // Scheduling
2198 $('limitSchedulingCheckbox').setProperty('checked', pref.scheduler_enabled);
2199 $('schedule_from_hour').setProperty('value', time_padding(pref.schedule_from_hour));
2200 $('schedule_from_min').setProperty('value', time_padding(pref.schedule_from_min));
2201 $('schedule_to_hour').setProperty('value', time_padding(pref.schedule_to_hour));
2202 $('schedule_to_min').setProperty('value', time_padding(pref.schedule_to_min));
2203 $('schedule_freq_select').setProperty('value', pref.scheduler_days);
2204 updateSchedulingEnabled();
2206 // Bittorrent tab
2207 // Privacy
2208 $('dht_checkbox').setProperty('checked', pref.dht);
2209 $('pex_checkbox').setProperty('checked', pref.pex);
2210 $('lsd_checkbox').setProperty('checked', pref.lsd);
2211 const encryption = pref.encryption.toInt();
2212 $('encryption_select').getChildren('option')[encryption].selected = true;
2213 $('anonymous_mode_checkbox').setProperty('checked', pref.anonymous_mode);
2215 $('maxActiveCheckingTorrents').setProperty('value', pref.max_active_checking_torrents);
2217 // Torrent Queueing
2218 $('queueing_checkbox').setProperty('checked', pref.queueing_enabled);
2219 $('max_active_dl_value').setProperty('value', pref.max_active_downloads.toInt());
2220 $('max_active_up_value').setProperty('value', pref.max_active_uploads.toInt());
2221 $('max_active_to_value').setProperty('value', pref.max_active_torrents.toInt());
2222 $('dont_count_slow_torrents_checkbox').setProperty('checked', pref.dont_count_slow_torrents);
2223 $('dl_rate_threshold').setProperty('value', pref.slow_torrent_dl_rate_threshold.toInt());
2224 $('ul_rate_threshold').setProperty('value', pref.slow_torrent_ul_rate_threshold.toInt());
2225 $('torrent_inactive_timer').setProperty('value', pref.slow_torrent_inactive_timer.toInt());
2226 updateQueueingSystem();
2228 // Share Limiting
2229 $('max_ratio_checkbox').setProperty('checked', pref.max_ratio_enabled);
2230 $('max_ratio_value').setProperty('value', (pref.max_ratio_enabled ? pref.max_ratio : 1));
2231 $('max_seeding_time_checkbox').setProperty('checked', pref.max_seeding_time_enabled);
2232 $('max_seeding_time_value').setProperty('value', (pref.max_seeding_time_enabled ? pref.max_seeding_time.toInt() : 1440));
2233 $('max_inactive_seeding_time_checkbox').setProperty('checked', pref.max_inactive_seeding_time_enabled);
2234 $('max_inactive_seeding_time_value').setProperty('value', (pref.max_inactive_seeding_time_enabled ? pref.max_inactive_seeding_time.toInt() : 1440));
2235 let maxRatioAct = 0;
2236 switch (pref.max_ratio_act.toInt()) {
2237 case 0: // Pause
2238 default:
2239 maxRatioAct = 0;
2240 break;
2241 case 1: // Remove
2242 maxRatioAct = 1;
2243 break;
2244 case 2: // Enable super seeding
2245 maxRatioAct = 3;
2246 break;
2247 case 3: // Remove torrent and files
2248 maxRatioAct = 2;
2249 break;
2251 $('max_ratio_act').getChildren('option')[maxRatioAct].selected = true;
2252 updateMaxRatioTimeEnabled();
2254 // Add trackers
2255 $('add_trackers_checkbox').setProperty('checked', pref.add_trackers_enabled);
2256 $('add_trackers_textarea').setProperty('value', pref.add_trackers);
2257 updateAddTrackersEnabled();
2259 // RSS Tab
2260 $('enable_fetching_rss_feeds_checkbox').setProperty('checked', pref.rss_processing_enabled);
2261 $('feed_refresh_interval').setProperty('value', pref.rss_refresh_interval);
2262 $('feedFetchDelay').setProperty('value', pref.rss_fetch_delay);
2263 $('maximum_article_number').setProperty('value', pref.rss_max_articles_per_feed);
2264 $('enable_auto_downloading_rss_torrents_checkbox').setProperty('checked', pref.rss_auto_downloading_enabled);
2265 $('downlock_repack_proper_episodes').setProperty('checked', pref.rss_download_repack_proper_episodes);
2266 $('rss_filter_textarea').setProperty('value', pref.rss_smart_episode_filters);
2268 // Web UI tab
2269 // Language
2270 updateWebuiLocaleSelect(pref.locale);
2271 $('performanceWarning').setProperty('checked', pref.performance_warning);
2273 // HTTP Server
2274 $('webui_domain_textarea').setProperty('value', pref.web_ui_domain_list);
2275 $('webui_address_value').setProperty('value', pref.web_ui_address);
2276 $('webui_port_value').setProperty('value', pref.web_ui_port);
2277 $('webui_upnp_checkbox').setProperty('checked', pref.web_ui_upnp);
2278 $('use_https_checkbox').setProperty('checked', pref.use_https);
2279 $('ssl_cert_text').setProperty('value', pref.web_ui_https_cert_path);
2280 $('ssl_key_text').setProperty('value', pref.web_ui_https_key_path);
2281 updateHttpsSettings();
2283 // Authentication
2284 $('webui_username_text').setProperty('value', pref.web_ui_username);
2285 $('bypass_local_auth_checkbox').setProperty('checked', pref.bypass_local_auth);
2286 $('bypass_auth_subnet_whitelist_checkbox').setProperty('checked', pref.bypass_auth_subnet_whitelist_enabled);
2287 $('bypass_auth_subnet_whitelist_textarea').setProperty('value', pref.bypass_auth_subnet_whitelist);
2288 updateBypasssAuthSettings();
2289 $('webUIMaxAuthFailCountInput').setProperty('value', pref.web_ui_max_auth_fail_count.toInt());
2290 $('webUIBanDurationInput').setProperty('value', pref.web_ui_ban_duration.toInt());
2291 $('webUISessionTimeoutInput').setProperty('value', pref.web_ui_session_timeout.toInt());
2293 // Use alternative Web UI
2294 $('use_alt_webui_checkbox').setProperty('checked', pref.alternative_webui_enabled);
2295 $('webui_files_location_textarea').setProperty('value', pref.alternative_webui_path);
2296 updateAlternativeWebUISettings();
2298 // Security
2299 $('clickjacking_protection_checkbox').setProperty('checked', pref.web_ui_clickjacking_protection_enabled);
2300 $('csrf_protection_checkbox').setProperty('checked', pref.web_ui_csrf_protection_enabled);
2301 $('secureCookieCheckbox').setProperty('checked', pref.web_ui_secure_cookie_enabled);
2302 $('host_header_validation_checkbox').setProperty('checked', pref.web_ui_host_header_validation_enabled);
2303 updateHostHeaderValidationSettings();
2305 // Custom HTTP headers
2306 $('webUIUseCustomHTTPHeadersCheckbox').setProperty('checked', pref.web_ui_use_custom_http_headers_enabled);
2307 $('webUICustomHTTPHeadersTextarea').setProperty('value', pref.web_ui_custom_http_headers);
2308 updateWebUICustomHTTPHeadersSettings();
2310 // Reverse Proxy
2311 $('webUIReverseProxySupportCheckbox').setProperty('checked', pref.web_ui_reverse_proxy_enabled);
2312 $('webUIReverseProxiesListTextarea').setProperty('value', pref.web_ui_reverse_proxies_list);
2313 updateWebUIReverseProxySettings();
2315 // Update my dynamic domain name
2316 $('use_dyndns_checkbox').setProperty('checked', pref.dyndns_enabled);
2317 $('dyndns_select').setProperty('value', pref.dyndns_service);
2318 $('dyndns_domain_text').setProperty('value', pref.dyndns_domain);
2319 $('dyndns_username_text').setProperty('value', pref.dyndns_username);
2320 $('dyndns_password_text').setProperty('value', pref.dyndns_password);
2321 updateDynDnsSettings();
2323 // Advanced settings
2324 // qBittorrent section
2325 $('resumeDataStorageType').setProperty('value', pref.resume_data_storage_type);
2326 $('memoryWorkingSetLimit').setProperty('value', pref.memory_working_set_limit);
2327 updateNetworkInterfaces(pref.current_network_interface, pref.current_interface_name);
2328 updateInterfaceAddresses(pref.current_network_interface, pref.current_interface_address);
2329 $('saveResumeDataInterval').setProperty('value', pref.save_resume_data_interval);
2330 $('torrentFileSizeLimit').setProperty('value', (pref.torrent_file_size_limit / 1024 / 1024));
2331 $('recheckTorrentsOnCompletion').setProperty('checked', pref.recheck_completed_torrents);
2332 $('refreshInterval').setProperty('value', pref.refresh_interval);
2333 $('resolvePeerCountries').setProperty('checked', pref.resolve_peer_countries);
2334 $('reannounceWhenAddressChanged').setProperty('checked', pref.reannounce_when_address_changed);
2335 // libtorrent section
2336 $('bdecodeDepthLimit').setProperty('value', pref.bdecode_depth_limit);
2337 $('bdecodeTokenLimit').setProperty('value', pref.bdecode_token_limit);
2338 $('asyncIOThreads').setProperty('value', pref.async_io_threads);
2339 $('hashingThreads').setProperty('value', pref.hashing_threads);
2340 $('filePoolSize').setProperty('value', pref.file_pool_size);
2341 $('outstandMemoryWhenCheckingTorrents').setProperty('value', pref.checking_memory_use);
2342 $('diskCache').setProperty('value', pref.disk_cache);
2343 $('diskCacheExpiryInterval').setProperty('value', pref.disk_cache_ttl);
2344 $('diskQueueSize').setProperty('value', (pref.disk_queue_size / 1024));
2345 $('diskIOType').setProperty('value', pref.disk_io_type);
2346 $('diskIOReadMode').setProperty('value', pref.disk_io_read_mode);
2347 $('diskIOWriteMode').setProperty('value', pref.disk_io_write_mode);
2348 $('coalesceReadsAndWrites').setProperty('checked', pref.enable_coalesce_read_write);
2349 $('pieceExtentAffinity').setProperty('checked', pref.enable_piece_extent_affinity);
2350 $('sendUploadPieceSuggestions').setProperty('checked', pref.enable_upload_suggestions);
2351 $('sendBufferWatermark').setProperty('value', pref.send_buffer_watermark);
2352 $('sendBufferLowWatermark').setProperty('value', pref.send_buffer_low_watermark);
2353 $('sendBufferWatermarkFactor').setProperty('value', pref.send_buffer_watermark_factor);
2354 $('connectionSpeed').setProperty('value', pref.connection_speed);
2355 $('socketSendBufferSize').setProperty('value', (pref.socket_send_buffer_size / 1024));
2356 $('socketReceiveBufferSize').setProperty('value', (pref.socket_receive_buffer_size / 1024));
2357 $('socketBacklogSize').setProperty('value', pref.socket_backlog_size);
2358 $('outgoingPortsMin').setProperty('value', pref.outgoing_ports_min);
2359 $('outgoingPortsMax').setProperty('value', pref.outgoing_ports_max);
2360 $('UPnPLeaseDuration').setProperty('value', pref.upnp_lease_duration);
2361 $('peerToS').setProperty('value', pref.peer_tos);
2362 $('utpTCPMixedModeAlgorithm').setProperty('value', pref.utp_tcp_mixed_mode);
2363 $('IDNSupportCheckbox').setProperty('checked', pref.idn_support_enabled);
2364 $('allowMultipleConnectionsFromTheSameIPAddress').setProperty('checked', pref.enable_multi_connections_from_same_ip);
2365 $('validateHTTPSTrackerCertificate').setProperty('checked', pref.validate_https_tracker_certificate);
2366 $('mitigateSSRF').setProperty('checked', pref.ssrf_mitigation);
2367 $('blockPeersOnPrivilegedPorts').setProperty('checked', pref.block_peers_on_privileged_ports);
2368 $('enableEmbeddedTracker').setProperty('checked', pref.enable_embedded_tracker);
2369 $('embeddedTrackerPort').setProperty('value', pref.embedded_tracker_port);
2370 $('embeddedTrackerPortForwarding').setProperty('checked', pref.embedded_tracker_port_forwarding);
2371 $('markOfTheWeb').setProperty('checked', pref.mark_of_the_web);
2372 $('pythonExecutablePath').setProperty('value', pref.python_executable_path);
2373 $('uploadSlotsBehavior').setProperty('value', pref.upload_slots_behavior);
2374 $('uploadChokingAlgorithm').setProperty('value', pref.upload_choking_algorithm);
2375 $('announceAllTrackers').setProperty('checked', pref.announce_to_all_trackers);
2376 $('announceAllTiers').setProperty('checked', pref.announce_to_all_tiers);
2377 $('announceIP').setProperty('value', pref.announce_ip);
2378 $('maxConcurrentHTTPAnnounces').setProperty('value', pref.max_concurrent_http_announces);
2379 $('stopTrackerTimeout').setProperty('value', pref.stop_tracker_timeout);
2380 $('peerTurnover').setProperty('value', pref.peer_turnover);
2381 $('peerTurnoverCutoff').setProperty('value', pref.peer_turnover_cutoff);
2382 $('peerTurnoverInterval').setProperty('value', pref.peer_turnover_interval);
2383 $('requestQueueSize').setProperty('value', pref.request_queue_size);
2384 $('dhtBootstrapNodes').setProperty('value', pref.dht_bootstrap_nodes);
2385 $('i2pInboundQuantity').setProperty('value', pref.i2p_inbound_quantity);
2386 $('i2pOutboundQuantity').setProperty('value', pref.i2p_outbound_quantity);
2387 $('i2pInboundLength').setProperty('value', pref.i2p_inbound_length);
2388 $('i2pOutboundLength').setProperty('value', pref.i2p_outbound_length);
2393 const applyPreferences = function() {
2394 const settings = {};
2395 // Validate form data
2397 // Behavior tab
2398 settings['file_log_enabled'] = $('filelog_checkbox').getProperty('checked');
2399 settings['file_log_path'] = $('filelog_save_path_input').getProperty('value');
2400 settings['file_log_backup_enabled'] = $('filelog_backup_checkbox').getProperty('checked');
2401 settings['file_log_max_size'] = Number($('filelog_max_size_input').getProperty('value'));
2402 settings['file_log_delete_old'] = $('filelog_delete_old_checkbox').getProperty('checked');
2403 settings['file_log_age'] = Number($('filelog_age_input').getProperty('value'));
2404 settings['file_log_age_type'] = Number($('filelog_age_type_select').getProperty('value'));
2406 // Downloads tab
2407 // When adding a torrent
2408 settings['torrent_content_layout'] = $('contentlayout_select').getSelected()[0].getProperty('value');
2409 settings['add_to_top_of_queue'] = $('addToTopOfQueueCheckbox').getProperty('checked');
2410 settings['start_paused_enabled'] = $('dontstartdownloads_checkbox').getProperty('checked');
2411 settings['torrent_stop_condition'] = $('stopConditionSelect').getSelected()[0].getProperty('value');
2412 settings['auto_delete_mode'] = Number($('deletetorrentfileafter_checkbox').getProperty('checked'));
2414 settings['preallocate_all'] = $('preallocateall_checkbox').getProperty('checked');
2415 settings['incomplete_files_ext'] = $('appendext_checkbox').getProperty('checked');
2416 settings['use_unwanted_folder'] = $('unwantedfolder_checkbox').getProperty('checked');
2418 // Saving Management
2419 settings['auto_tmm_enabled'] = ($('default_tmm_combobox').getProperty('value') === 'true');
2420 settings['torrent_changed_tmm_enabled'] = ($('torrent_changed_tmm_combobox').getProperty('value') === 'true');
2421 settings['save_path_changed_tmm_enabled'] = ($('save_path_changed_tmm_combobox').getProperty('value') === 'true');
2422 settings['category_changed_tmm_enabled'] = ($('category_changed_tmm_combobox').getProperty('value') === 'true');
2423 settings['use_subcategories'] = $('use_subcategories_checkbox').getProperty('checked');
2424 settings['save_path'] = $('savepath_text').getProperty('value');
2425 settings['temp_path_enabled'] = $('temppath_checkbox').getProperty('checked');
2426 settings['temp_path'] = $('temppath_text').getProperty('value');
2427 if ($('exportdir_checkbox').getProperty('checked'))
2428 settings['export_dir'] = $('exportdir_text').getProperty('value');
2429 else
2430 settings['export_dir'] = '';
2431 if ($('exportdirfin_checkbox').getProperty('checked'))
2432 settings['export_dir_fin'] = $('exportdirfin_text').getProperty('value');
2433 else
2434 settings['export_dir_fin'] = '';
2436 // Automatically add torrents from
2437 settings['scan_dirs'] = getWatchedFolders();
2439 // Excluded file names
2440 settings['excluded_file_names_enabled'] = $('excludedFileNamesCheckbox').getProperty('checked');
2441 settings['excluded_file_names'] = $('excludedFileNamesTextarea').getProperty('value');
2443 // Email notification upon download completion
2444 settings['mail_notification_enabled'] = $('mail_notification_checkbox').getProperty('checked');
2445 settings['mail_notification_sender'] = $('src_email_txt').getProperty('value');
2446 settings['mail_notification_email'] = $('dest_email_txt').getProperty('value');
2447 settings['mail_notification_smtp'] = $('smtp_server_txt').getProperty('value');
2448 settings['mail_notification_ssl_enabled'] = $('mail_ssl_checkbox').getProperty('checked');
2449 settings['mail_notification_auth_enabled'] = $('mail_auth_checkbox').getProperty('checked');
2450 settings['mail_notification_username'] = $('mail_username_text').getProperty('value');
2451 settings['mail_notification_password'] = $('mail_password_text').getProperty('value');
2453 // Run an external program on torrent added
2454 settings['autorun_on_torrent_added_enabled'] = $('autorunOnTorrentAddedCheckbox').getProperty('checked');
2455 settings['autorun_on_torrent_added_program'] = $('autorunOnTorrentAddedProgram').getProperty('value');
2456 // Run an external program on torrent finished
2457 settings['autorun_enabled'] = $('autorun_checkbox').getProperty('checked');
2458 settings['autorun_program'] = $('autorunProg_txt').getProperty('value');
2460 // Connection tab
2461 // Listening Port
2462 const listen_port = $('port_value').getProperty('value').toInt();
2463 if (isNaN(listen_port) || (listen_port < 0) || (listen_port > 65535)) {
2464 alert("QBT_TR(The port used for incoming connections must be between 0 and 65535.)QBT_TR[CONTEXT=HttpServer]");
2465 return;
2467 settings['listen_port'] = listen_port;
2468 settings['upnp'] = $('upnp_checkbox').getProperty('checked');
2470 // Connections Limits
2471 let max_connec = -1;
2472 if ($('max_connec_checkbox').getProperty('checked')) {
2473 max_connec = $('max_connec_value').getProperty('value').toInt();
2474 if (isNaN(max_connec) || max_connec <= 0) {
2475 alert("QBT_TR(Maximum number of connections limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2476 return;
2479 settings['max_connec'] = max_connec;
2480 let max_connec_per_torrent = -1;
2481 if ($('max_connec_per_torrent_checkbox').getProperty('checked')) {
2482 max_connec_per_torrent = $('max_connec_per_torrent_value').getProperty('value').toInt();
2483 if (isNaN(max_connec_per_torrent) || max_connec_per_torrent <= 0) {
2484 alert("QBT_TR(Maximum number of connections per torrent limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2485 return;
2488 settings['max_connec_per_torrent'] = max_connec_per_torrent;
2489 let max_uploads = -1;
2490 if ($('max_uploads_checkbox').getProperty('checked')) {
2491 max_uploads = $('max_uploads_value').getProperty('value').toInt();
2492 if (isNaN(max_uploads) || max_uploads <= 0) {
2493 alert("QBT_TR(Global number of upload slots limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2494 return;
2497 settings['max_uploads'] = max_uploads;
2498 let max_uploads_per_torrent = -1;
2499 if ($('max_uploads_per_torrent_checkbox').getProperty('checked')) {
2500 max_uploads_per_torrent = $('max_uploads_per_torrent_value').getProperty('value').toInt();
2501 if (isNaN(max_uploads_per_torrent) || max_uploads_per_torrent <= 0) {
2502 alert("QBT_TR(Maximum number of upload slots per torrent limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2503 return;
2506 settings['max_uploads_per_torrent'] = max_uploads_per_torrent;
2508 // I2P
2509 settings['i2p_enabled'] = $('i2pEnabledCheckbox').getProperty('checked');
2510 settings['i2p_address'] = $('i2pAddress').getProperty('value');
2511 settings['i2p_port'] = $('i2pPort').getProperty('value').toInt();
2512 settings['i2p_mixed_mode'] = $('i2pMixedMode').getProperty('checked');
2514 // Proxy Server
2515 settings['proxy_type'] = $('peer_proxy_type_select').getProperty('value');
2516 settings['proxy_ip'] = $('peer_proxy_host_text').getProperty('value');
2517 settings['proxy_port'] = $('peer_proxy_port_value').getProperty('value').toInt();
2518 settings['proxy_auth_enabled'] = $('peer_proxy_auth_checkbox').getProperty('checked');
2519 settings['proxy_username'] = $('peer_proxy_username_text').getProperty('value');
2520 settings['proxy_password'] = $('peer_proxy_password_text').getProperty('value');
2521 settings['proxy_hostname_lookup'] = $('proxyHostnameLookupCheckbox').getProperty('checked');
2522 settings['proxy_bittorrent'] = $('proxy_bittorrent_checkbox').getProperty('checked');
2523 settings['proxy_peer_connections'] = $('use_peer_proxy_checkbox').getProperty('checked');
2524 settings['proxy_rss'] = $('proxy_rss_checkbox').getProperty('checked');
2525 settings['proxy_misc'] = $('proxy_misc_checkbox').getProperty('checked');
2527 // IP Filtering
2528 settings['ip_filter_enabled'] = $('ipfilter_text_checkbox').getProperty('checked');
2529 settings['ip_filter_path'] = $('ipfilter_text').getProperty('value');
2530 settings['ip_filter_trackers'] = $('ipfilter_trackers_checkbox').getProperty('checked');
2531 settings['banned_IPs'] = $('banned_IPs_textarea').getProperty('value');
2533 // Speed tab
2534 // Global Rate Limits
2535 const up_limit = $('up_limit_value').getProperty('value').toInt() * 1024;
2536 if (isNaN(up_limit) || up_limit < 0) {
2537 alert("QBT_TR(Global upload rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2538 return;
2540 settings['up_limit'] = up_limit;
2542 const dl_limit = $('dl_limit_value').getProperty('value').toInt() * 1024;
2543 if (isNaN(dl_limit) || dl_limit < 0) {
2544 alert("QBT_TR(Global download rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2545 return;
2547 settings['dl_limit'] = dl_limit;
2549 // Alternative Global Rate Limits
2550 const alt_up_limit = $('alt_up_limit_value').getProperty('value').toInt() * 1024;
2551 if (isNaN(alt_up_limit) || alt_up_limit < 0) {
2552 alert("QBT_TR(Alternative upload rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2553 return;
2555 settings['alt_up_limit'] = alt_up_limit;
2557 const alt_dl_limit = $('alt_dl_limit_value').getProperty('value').toInt() * 1024;
2558 if (isNaN(alt_dl_limit) || alt_dl_limit < 0) {
2559 alert("QBT_TR(Alternative download rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
2560 return;
2562 settings['alt_dl_limit'] = alt_dl_limit;
2564 settings['bittorrent_protocol'] = Number($('enable_protocol_combobox').getProperty('value'));
2565 settings['limit_utp_rate'] = $('limit_utp_rate_checkbox').getProperty('checked');
2566 settings['limit_tcp_overhead'] = $('limit_tcp_overhead_checkbox').getProperty('checked');
2567 settings['limit_lan_peers'] = $('limit_lan_peers_checkbox').getProperty('checked');
2569 // Scheduler
2570 const scheduling_enabled = $('limitSchedulingCheckbox').getProperty('checked');
2571 settings['scheduler_enabled'] = scheduling_enabled;
2572 if (scheduling_enabled) {
2573 settings['schedule_from_hour'] = $('schedule_from_hour').getProperty('value').toInt();
2574 settings['schedule_from_min'] = $('schedule_from_min').getProperty('value').toInt();
2575 settings['schedule_to_hour'] = $('schedule_to_hour').getProperty('value').toInt();
2576 settings['schedule_to_min'] = $('schedule_to_min').getProperty('value').toInt();
2577 settings['scheduler_days'] = $('schedule_freq_select').getProperty('value').toInt();
2580 // Bittorrent tab
2581 // Privacy
2582 settings['dht'] = $('dht_checkbox').getProperty('checked');
2583 settings['pex'] = $('pex_checkbox').getProperty('checked');
2584 settings['lsd'] = $('lsd_checkbox').getProperty('checked');
2585 settings['encryption'] = Number($('encryption_select').getSelected()[0].getProperty('value'));
2586 settings['anonymous_mode'] = $('anonymous_mode_checkbox').getProperty('checked');
2588 settings['max_active_checking_torrents'] = Number($('maxActiveCheckingTorrents').getProperty('value'));
2590 // Torrent Queueing
2591 settings['queueing_enabled'] = $('queueing_checkbox').getProperty('checked');
2592 if ($('queueing_checkbox').getProperty('checked')) {
2593 const max_active_downloads = $('max_active_dl_value').getProperty('value').toInt();
2594 if (isNaN(max_active_downloads) || max_active_downloads < -1) {
2595 alert("QBT_TR(Maximum active downloads must be greater than -1.)QBT_TR[CONTEXT=HttpServer]");
2596 return;
2598 settings['max_active_downloads'] = max_active_downloads;
2599 const max_active_uploads = $('max_active_up_value').getProperty('value').toInt();
2600 if (isNaN(max_active_uploads) || max_active_uploads < -1) {
2601 alert("QBT_TR(Maximum active uploads must be greater than -1.)QBT_TR[CONTEXT=HttpServer]");
2602 return;
2604 settings['max_active_uploads'] = max_active_uploads;
2605 const max_active_torrents = $('max_active_to_value').getProperty('value').toInt();
2606 if (isNaN(max_active_torrents) || max_active_torrents < -1) {
2607 alert("QBT_TR(Maximum active torrents must be greater than -1.)QBT_TR[CONTEXT=HttpServer]");
2608 return;
2610 settings['max_active_torrents'] = max_active_torrents;
2611 settings['dont_count_slow_torrents'] = $('dont_count_slow_torrents_checkbox').getProperty('checked');
2612 const dl_rate_threshold = $('dl_rate_threshold').getProperty('value').toInt();
2613 if (isNaN(dl_rate_threshold) || (dl_rate_threshold < 1)) {
2614 alert("QBT_TR(Download rate threshold must be greater than 0.)QBT_TR[CONTEXT=HttpServer]");
2615 return;
2617 settings['slow_torrent_dl_rate_threshold'] = dl_rate_threshold;
2618 const ul_rate_threshold = $('ul_rate_threshold').getProperty('value').toInt();
2619 if (isNaN(ul_rate_threshold) || (ul_rate_threshold < 1)) {
2620 alert("QBT_TR(Upload rate threshold must be greater than 0.)QBT_TR[CONTEXT=HttpServer]");
2621 return;
2623 settings['slow_torrent_ul_rate_threshold'] = ul_rate_threshold;
2624 const torrent_inactive_timer = $('torrent_inactive_timer').getProperty('value').toInt();
2625 if (isNaN(torrent_inactive_timer) || (torrent_inactive_timer < 1)) {
2626 alert("QBT_TR(Torrent inactivity timer must be greater than 0.)QBT_TR[CONTEXT=HttpServer]");
2627 return;
2629 settings['slow_torrent_inactive_timer'] = torrent_inactive_timer;
2632 // Share Ratio Limiting
2633 let max_ratio = -1;
2634 if ($('max_ratio_checkbox').getProperty('checked')) {
2635 max_ratio = $('max_ratio_value').getProperty('value').toFloat();
2636 if (isNaN(max_ratio) || (max_ratio < 0) || (max_ratio > 9998)) {
2637 alert("QBT_TR(Share ratio limit must be between 0 and 9998.)QBT_TR[CONTEXT=HttpServer]");
2638 return;
2641 settings['max_ratio_enabled'] = $('max_ratio_checkbox').getProperty('checked');
2642 settings['max_ratio'] = max_ratio;
2644 let max_seeding_time = -1;
2645 if ($('max_seeding_time_checkbox').getProperty('checked')) {
2646 max_seeding_time = $('max_seeding_time_value').getProperty('value').toInt();
2647 if (isNaN(max_seeding_time) || (max_seeding_time < 0) || (max_seeding_time > 525600)) {
2648 alert("QBT_TR(Seeding time limit must be between 0 and 525600 minutes.)QBT_TR[CONTEXT=HttpServer]");
2649 return;
2652 settings['max_seeding_time_enabled'] = $('max_seeding_time_checkbox').getProperty('checked');
2653 settings['max_seeding_time'] = max_seeding_time;
2654 settings['max_ratio_act'] = $('max_ratio_act').getProperty('value').toInt();
2656 let max_inactive_seeding_time = -1;
2657 if ($('max_inactive_seeding_time_checkbox').getProperty('checked')) {
2658 max_inactive_seeding_time = $('max_inactive_seeding_time_value').getProperty('value').toInt();
2659 if (isNaN(max_inactive_seeding_time) || (max_inactive_seeding_time < 0) || (max_inactive_seeding_time > 525600)) {
2660 alert("QBT_TR(Seeding time limit must be between 0 and 525600 minutes.)QBT_TR[CONTEXT=HttpServer]");
2661 return;
2664 settings['max_inactive_seeding_time_enabled'] = $('max_inactive_seeding_time_checkbox').getProperty('checked');
2665 settings['max_inactive_seeding_time'] = max_inactive_seeding_time;
2666 settings['max_ratio_act'] = $('max_ratio_act').getProperty('value').toInt();
2668 // Add trackers
2669 settings['add_trackers_enabled'] = $('add_trackers_checkbox').getProperty('checked');
2670 settings['add_trackers'] = $('add_trackers_textarea').getProperty('value');
2672 // RSS Tab
2673 settings['rss_processing_enabled'] = $('enable_fetching_rss_feeds_checkbox').getProperty('checked');
2674 settings['rss_refresh_interval'] = Number($('feed_refresh_interval').getProperty('value'));
2675 settings['rss_fetch_delay'] = Number($('feedFetchDelay').getProperty('value'));
2676 settings['rss_max_articles_per_feed'] = Number($('maximum_article_number').getProperty('value'));
2677 settings['rss_auto_downloading_enabled'] = $('enable_auto_downloading_rss_torrents_checkbox').getProperty('checked');
2678 settings['rss_download_repack_proper_episodes'] = $('downlock_repack_proper_episodes').getProperty('checked');
2679 settings['rss_smart_episode_filters'] = $('rss_filter_textarea').getProperty('value');
2681 // Web UI tab
2682 // Language
2683 settings['locale'] = $('locale_select').getProperty('value');
2684 settings['performance_warning'] = $('performanceWarning').getProperty('checked');
2686 // HTTP Server
2687 settings['web_ui_domain_list'] = $('webui_domain_textarea').getProperty('value');
2688 const web_ui_address = $('webui_address_value').getProperty('value').toString();
2689 const web_ui_port = $('webui_port_value').getProperty('value').toInt();
2690 if (isNaN(web_ui_port) || web_ui_port < 1 || web_ui_port > 65535) {
2691 alert("QBT_TR(The port used for the Web UI must be between 1 and 65535.)QBT_TR[CONTEXT=HttpServer]");
2692 return;
2694 settings['web_ui_address'] = web_ui_address;
2695 settings['web_ui_port'] = web_ui_port;
2696 settings['web_ui_upnp'] = $('webui_upnp_checkbox').getProperty('checked');
2698 const useHTTPS = $('use_https_checkbox').getProperty('checked');
2699 settings['use_https'] = useHTTPS;
2701 const httpsCertificate = $('ssl_cert_text').getProperty('value');
2702 settings['web_ui_https_cert_path'] = httpsCertificate;
2703 if (useHTTPS && (httpsCertificate.length === 0)) {
2704 alert("QBT_TR(HTTPS certificate should not be empty)QBT_TR[CONTEXT=OptionsDialog]");
2705 return;
2708 const httpsKey = $('ssl_key_text').getProperty('value');
2709 settings['web_ui_https_key_path'] = httpsKey;
2710 if (useHTTPS && (httpsKey.length === 0)) {
2711 alert("QBT_TR(HTTPS key should not be empty)QBT_TR[CONTEXT=OptionsDialog]");
2712 return;
2715 // Authentication
2716 const web_ui_username = $('webui_username_text').getProperty('value');
2717 if (web_ui_username.length < 3) {
2718 alert("QBT_TR(The Web UI username must be at least 3 characters long.)QBT_TR[CONTEXT=OptionsDialog]");
2719 return;
2721 const web_ui_password = $('webui_password_text').getProperty('value');
2722 if ((0 < web_ui_password.length) && (web_ui_password.length < 6)) {
2723 alert("QBT_TR(The Web UI password must be at least 6 characters long.)QBT_TR[CONTEXT=OptionsDialog]");
2724 return;
2727 settings['web_ui_username'] = web_ui_username;
2728 if (web_ui_password.length > 0)
2729 settings['web_ui_password'] = web_ui_password;
2730 settings['bypass_local_auth'] = $('bypass_local_auth_checkbox').getProperty('checked');
2731 settings['bypass_auth_subnet_whitelist_enabled'] = $('bypass_auth_subnet_whitelist_checkbox').getProperty('checked');
2732 settings['bypass_auth_subnet_whitelist'] = $('bypass_auth_subnet_whitelist_textarea').getProperty('value');
2733 settings['web_ui_max_auth_fail_count'] = Number($('webUIMaxAuthFailCountInput').getProperty('value'));
2734 settings['web_ui_ban_duration'] = Number($('webUIBanDurationInput').getProperty('value'));
2735 settings['web_ui_session_timeout'] = Number($('webUISessionTimeoutInput').getProperty('value'));
2737 // Use alternative Web UI
2738 const alternative_webui_enabled = $('use_alt_webui_checkbox').getProperty('checked');
2739 const webui_files_location_textarea = $('webui_files_location_textarea').getProperty('value');
2740 if (alternative_webui_enabled && (webui_files_location_textarea.trim() === "")) {
2741 alert("QBT_TR(The alternative Web UI files location cannot be blank.)QBT_TR[CONTEXT=OptionsDialog]");
2742 return;
2744 settings['alternative_webui_enabled'] = alternative_webui_enabled;
2745 settings['alternative_webui_path'] = webui_files_location_textarea;
2747 // Security
2748 settings['web_ui_clickjacking_protection_enabled'] = $('clickjacking_protection_checkbox').getProperty('checked');
2749 settings['web_ui_csrf_protection_enabled'] = $('csrf_protection_checkbox').getProperty('checked');
2750 settings['web_ui_secure_cookie_enabled'] = $('secureCookieCheckbox').getProperty('checked');
2751 settings['web_ui_host_header_validation_enabled'] = $('host_header_validation_checkbox').getProperty('checked');
2753 // Custom HTTP headers
2754 settings['web_ui_use_custom_http_headers_enabled'] = $('webUIUseCustomHTTPHeadersCheckbox').getProperty('checked');
2755 settings['web_ui_custom_http_headers'] = $('webUICustomHTTPHeadersTextarea').getProperty('value');
2757 // Reverse Proxy
2758 settings['web_ui_reverse_proxy_enabled'] = $('webUIReverseProxySupportCheckbox').getProperty('checked');
2759 settings['web_ui_reverse_proxies_list'] = $('webUIReverseProxiesListTextarea').getProperty('value');
2761 // Update my dynamic domain name
2762 settings['dyndns_enabled'] = $('use_dyndns_checkbox').getProperty('checked');
2763 settings['dyndns_service'] = Number($('dyndns_select').getProperty('value'));
2764 settings['dyndns_domain'] = $('dyndns_domain_text').getProperty('value');
2765 settings['dyndns_username'] = $('dyndns_username_text').getProperty('value');
2766 settings['dyndns_password'] = $('dyndns_password_text').getProperty('value');
2768 // Update advanced settings
2769 // qBittorrent section
2770 settings['resume_data_storage_type'] = $('resumeDataStorageType').getProperty('value');
2771 settings['memory_working_set_limit'] = Number($('memoryWorkingSetLimit').getProperty('value'));
2772 settings['current_network_interface'] = $('networkInterface').getProperty('value');
2773 settings['current_interface_address'] = $('optionalIPAddressToBind').getProperty('value');
2774 settings['save_resume_data_interval'] = Number($('saveResumeDataInterval').getProperty('value'));
2775 settings['torrent_file_size_limit'] = ($('torrentFileSizeLimit').getProperty('value') * 1024 * 1024);
2776 settings['recheck_completed_torrents'] = $('recheckTorrentsOnCompletion').getProperty('checked');
2777 settings['refresh_interval'] = Number($('refreshInterval').getProperty('value'));
2778 settings['resolve_peer_countries'] = $('resolvePeerCountries').getProperty('checked');
2779 settings['reannounce_when_address_changed'] = $('reannounceWhenAddressChanged').getProperty('checked');
2781 // libtorrent section
2782 settings['bdecode_depth_limit'] = Number($('bdecodeDepthLimit').getProperty('value'));
2783 settings['bdecode_token_limit'] = Number($('bdecodeTokenLimit').getProperty('value'));
2784 settings['async_io_threads'] = Number($('asyncIOThreads').getProperty('value'));
2785 settings['hashing_threads'] = Number($('hashingThreads').getProperty('value'));
2786 settings['file_pool_size'] = Number($('filePoolSize').getProperty('value'));
2787 settings['checking_memory_use'] = Number($('outstandMemoryWhenCheckingTorrents').getProperty('value'));
2788 settings['disk_cache'] = Number($('diskCache').getProperty('value'));
2789 settings['disk_cache_ttl'] = Number($('diskCacheExpiryInterval').getProperty('value'));
2790 settings['disk_queue_size'] = (Number($('diskQueueSize').getProperty('value')) * 1024);
2791 settings['disk_io_type'] = Number($('diskIOType').getProperty('value'));
2792 settings['disk_io_read_mode'] = Number($('diskIOReadMode').getProperty('value'));
2793 settings['disk_io_write_mode'] = Number($('diskIOWriteMode').getProperty('value'));
2794 settings['enable_coalesce_read_write'] = $('coalesceReadsAndWrites').getProperty('checked');
2795 settings['enable_piece_extent_affinity'] = $('pieceExtentAffinity').getProperty('checked');
2796 settings['enable_upload_suggestions'] = $('sendUploadPieceSuggestions').getProperty('checked');
2797 settings['send_buffer_watermark'] = Number($('sendBufferWatermark').getProperty('value'));
2798 settings['send_buffer_low_watermark'] = Number($('sendBufferLowWatermark').getProperty('value'));
2799 settings['send_buffer_watermark_factor'] = Number($('sendBufferWatermarkFactor').getProperty('value'));
2800 settings['connection_speed'] = Number($('connectionSpeed').getProperty('value'));
2801 settings['socket_send_buffer_size'] = ($('socketSendBufferSize').getProperty('value') * 1024);
2802 settings['socket_receive_buffer_size'] = ($('socketReceiveBufferSize').getProperty('value') * 1024);
2803 settings['socket_backlog_size'] = Number($('socketBacklogSize').getProperty('value'));
2804 settings['outgoing_ports_min'] = Number($('outgoingPortsMin').getProperty('value'));
2805 settings['outgoing_ports_max'] = Number($('outgoingPortsMax').getProperty('value'));
2806 settings['upnp_lease_duration'] = Number($('UPnPLeaseDuration').getProperty('value'));
2807 settings['peer_tos'] = Number($('peerToS').getProperty('value'));
2808 settings['utp_tcp_mixed_mode'] = Number($('utpTCPMixedModeAlgorithm').getProperty('value'));
2809 settings['idn_support_enabled'] = $('IDNSupportCheckbox').getProperty('checked');
2810 settings['enable_multi_connections_from_same_ip'] = $('allowMultipleConnectionsFromTheSameIPAddress').getProperty('checked');
2811 settings['validate_https_tracker_certificate'] = $('validateHTTPSTrackerCertificate').getProperty('checked');
2812 settings['ssrf_mitigation'] = $('mitigateSSRF').getProperty('checked');
2813 settings['block_peers_on_privileged_ports'] = $('blockPeersOnPrivilegedPorts').getProperty('checked');
2814 settings['enable_embedded_tracker'] = $('enableEmbeddedTracker').getProperty('checked');
2815 settings['embedded_tracker_port'] = Number($('embeddedTrackerPort').getProperty('value'));
2816 settings['embedded_tracker_port_forwarding'] = $('embeddedTrackerPortForwarding').getProperty('checked');
2817 settings['mark_of_the_web'] = $('markOfTheWeb').getProperty('checked');
2818 settings['python_executable_path'] = $('pythonExecutablePath').getProperty('value');
2819 settings['upload_slots_behavior'] = Number($('uploadSlotsBehavior').getProperty('value'));
2820 settings['upload_choking_algorithm'] = Number($('uploadChokingAlgorithm').getProperty('value'));
2821 settings['announce_to_all_trackers'] = $('announceAllTrackers').getProperty('checked');
2822 settings['announce_to_all_tiers'] = $('announceAllTiers').getProperty('checked');
2823 settings['announce_ip'] = $('announceIP').getProperty('value');
2824 settings['max_concurrent_http_announces'] = Number($('maxConcurrentHTTPAnnounces').getProperty('value'));
2825 settings['stop_tracker_timeout'] = Number($('stopTrackerTimeout').getProperty('value'));
2826 settings['peer_turnover'] = Number($('peerTurnover').getProperty('value'));
2827 settings['peer_turnover_cutoff'] = Number($('peerTurnoverCutoff').getProperty('value'));
2828 settings['peer_turnover_interval'] = Number($('peerTurnoverInterval').getProperty('value'));
2829 settings['request_queue_size'] = Number($('requestQueueSize').getProperty('value'));
2830 settings['dht_bootstrap_nodes'] = $('dhtBootstrapNodes').getProperty('value');
2831 settings['i2p_inbound_quantity'] = Number($('i2pInboundQuantity').getProperty('value'));
2832 settings['i2p_outbound_quantity'] = Number($('i2pOutboundQuantity').getProperty('value'));
2833 settings['i2p_inbound_length'] = Number($('i2pInboundLength').getProperty('value'));
2834 settings['i2p_outbound_length'] = Number($('i2pOutboundLength').getProperty('value'));
2836 // Send it to qBT
2837 window.parent.qBittorrent.Cache.preferences.set({
2838 data: settings,
2839 onFailure: function() {
2840 alert("QBT_TR(Unable to save program preferences, qBittorrent is probably unreachable.)QBT_TR[CONTEXT=HttpServer]");
2841 window.parent.qBittorrent.Client.closeWindows();
2843 onSuccess: function() {
2844 // Close window
2845 window.parent.location.reload();
2846 window.parent.qBittorrent.Client.closeWindows();
2851 $('networkInterface').addEvent('change', function() {
2852 updateInterfaceAddresses($(this).getProperty('value'), '');
2855 loadPreferences();
2857 return exports();
2858 })();
2860 Object.freeze(window.qBittorrent.Preferences);
2861 </script>