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