Move WebUI views into separate folder
[qBittorrent.git] / src / webui / www / private / views / preferences.html
blob14869feb28e0e0319117cf82f9f00e4cca624589
1 <div id="DownloadsTab" class="PrefTab">
2 <fieldset class="settings">
3 <legend>QBT_TR(When adding a torrent)QBT_TR[CONTEXT=OptionsDialog]</legend>
4 <div class="formRow">
5 <input type="checkbox" id="createsubfolder_checkbox" />
6 <label for="createsubfolder_checkbox">QBT_TR(Create subfolder for torrents with multiple files)QBT_TR[CONTEXT=OptionsDialog]</label>
7 </div>
8 <div class="formRow">
9 <input type="checkbox" id="dontstartdownloads_checkbox" />
10 <label for="dontstartauto_checkbox">QBT_TR(Do not start the download automatically)QBT_TR[CONTEXT=OptionsDialog]</label>
11 </div>
12 <div class="formRow">
13 <input type="checkbox" id="deletetorrentfileafter_checkbox" />
14 <label for="deletetorrentafter_checkbox">QBT_TR(Delete .torrent files afterwards)QBT_TR[CONTEXT=OptionsDialog]</label>
15 </div>
16 </fieldset>
18 <div class="formRow">
19 <input type="checkbox" id="preallocateall_checkbox" />
20 <label for="preallocateall_checkbox">QBT_TR(Pre-allocate disk space for all files)QBT_TR[CONTEXT=OptionsDialog]</label>
21 </div>
22 <div class="formRow">
23 <span id="appendexttr">
24 <input type="checkbox" id="appendext_checkbox"/>
25 <label for="appendext_checkbox">QBT_TR(Append .!qB extension to incomplete files)QBT_TR[CONTEXT=OptionsDialog]</label>
26 </span>
27 </div>
29 <fieldset class="settings">
30 <legend>QBT_TR(Saving Management)QBT_TR[CONTEXT=HttpServer]</legend>
31 <table>
32 <tr>
33 <td>
34 <label>QBT_TR(Default Torrent Management Mode:)QBT_TR[CONTEXT=OptionsDialog]</label>
35 </td>
36 <td>
37 <select id="default_tmm_combobox">
38 <option value="false" selected>QBT_TR(Manual)QBT_TR[CONTEXT=OptionsDialog]</option>
39 <option value="true">QBT_TR(Automatic)QBT_TR[CONTEXT=OptionsDialog]</option>
40 </select>
41 </td>
42 </tr>
43 <tr>
44 <td>
45 <label>QBT_TR(When Torrent Category changed:)QBT_TR[CONTEXT=OptionsDialog]</label>
46 </td>
47 <td>
48 <select id="torrent_changed_tmm_combobox">
49 <option value="true">QBT_TR(Relocate torrent)QBT_TR[CONTEXT=OptionsDialog]</option>
50 <option value="false" selected>QBT_TR(Switch torrent to Manual Mode)QBT_TR[CONTEXT=OptionsDialog]</option>
51 </select>
52 </td>
53 </tr>
54 <tr>
55 <td>
56 <label>QBT_TR(When Default Save Path changed:)QBT_TR[CONTEXT=OptionsDialog]</label>
57 </td>
58 <td>
59 <select id="save_path_changed_tmm_combobox">
60 <option value="true">QBT_TR(Relocate affected torrents)QBT_TR[CONTEXT=OptionsDialog]</option>
61 <option value="false" selected>QBT_TR(Switch affected torrents to Manual Mode)QBT_TR[CONTEXT=OptionsDialog]</option>
62 </select>
63 </td>
64 </tr>
65 <tr>
66 <td>
67 <label>QBT_TR(When Category Save Path changed:)QBT_TR[CONTEXT=OptionsDialog]</label>
68 </td>
69 <td>
70 <select id="category_changed_tmm_combobox">
71 <option value="true">QBT_TR(Relocate affected torrents)QBT_TR[CONTEXT=OptionsDialog]</option>
72 <option value="false" selected>QBT_TR(Switch affected torrents to Manual Mode)QBT_TR[CONTEXT=OptionsDialog]</option>
73 </select>
74 </td>
75 </tr>
76 </table>
77 <table>
78 <tr>
79 <td>
80 <label for="savepath_text">QBT_TR(Default Save Path:)QBT_TR[CONTEXT=OptionsDialog]</label>
81 </td>
82 <td>
83 <input type="text" id="savepath_text" autocorrect="off" autocapitalize="none" />
84 </td>
85 </tr>
86 <tr>
87 <td>
88 <input type="checkbox" id="temppath_checkbox" onclick="updateTempDirEnabled();" />
89 <label for="temppath_checkbox">QBT_TR(Keep incomplete torrents in:)QBT_TR[CONTEXT=OptionsDialog]</label>
90 </td>
91 <td>
92 <input type="text" id="temppath_text" autocorrect="off" autocapitalize="none" />
93 </td>
94 </tr>
95 <tr>
96 <td>
97 <input type="checkbox" id="exportdir_checkbox" onclick="updateExportDirEnabled();" />
98 <label for="exportdir_checkbox">QBT_TR(Copy .torrent files to:)QBT_TR[CONTEXT=OptionsDialog]</label>
99 </td>
100 <td>
101 <input type="text" id="exportdir_text" autocorrect="off" autocapitalize="none" />
102 </td>
103 </tr>
104 <tr>
105 <td>
106 <input type="checkbox" id="exportdirfin_checkbox" onclick="updateExportDirFinEnabled();" />
107 <label for="exportdirfin_checkbox">QBT_TR(Copy .torrent files for finished downloads to:)QBT_TR[CONTEXT=OptionsDialog]</label>
108 </td>
109 <td>
110 <input type="text" id="exportdirfin_text" autocorrect="off" autocapitalize="none" />
111 </td>
112 </tr>
113 </table>
114 </fieldset>
116 <fieldset class="settings">
117 <legend>QBT_TR(Automatically add torrents from:)QBT_TR[CONTEXT=OptionsDialog]</legend>
118 <table id="watched_folders_tab" style="border: 1px solid black;">
119 <thead>
120 <tr>
121 <th>QBT_TR(Monitored Folder)QBT_TR[CONTEXT=ScanFoldersModel]</th>
122 <th>QBT_TR(Override Save Location)QBT_TR[CONTEXT=ScanFoldersModel]</th>
123 </tr>
124 </thead>
125 <tbody></tbody>
126 <tfoot>
127 <tr>
128 <td style="padding-top:4px;"><input type="text" id="new_watch_folder_txt" autocorrect="off" autocapitalize="none" /></td>
129 <td style="padding-top:4px;">
130 <div class="select-watched-folder-editable">
131 <select id="new_watch_folder_select" onchange="changeWatchFolderSelect(this)">
132 <option selected value="watch_folder">QBT_TR(Monitored folder)QBT_TR[CONTEXT=ScanFoldersModel]</option>
133 <option value="default_folder">QBT_TR(Default save location)QBT_TR[CONTEXT=ScanFoldersModel]</option>
134 <option value="other">QBT_TR(Other...)QBT_TR[CONTEXT=HttpServer]</option>
135 </select>
136 <input id="new_watch_folder_other_txt" type="text" value="QBT_TR(Monitored folder)QBT_TR[CONTEXT=ScanFoldersModel]" hidden />
137 <img src="images/qbt-theme/list-add.svg" alt="Add" style="padding-left:170px;width:16px;cursor:pointer;" onclick="addWatchFolder();" />
138 </div>
139 </td>
140 </tr>
141 </tfoot>
142 </table>
143 </fieldset>
145 <fieldset class="settings">
146 <legend>
147 <input type="checkbox" id="mail_notification_checkbox" onclick="updateMailNotification();" />
148 <label for="mail_notification_checkbox">QBT_TR(Email notification upon download completion)QBT_TR[CONTEXT=OptionsDialog]</label>
149 </legend>
150 <table>
151 <tr>
152 <td>
153 <label for="src_email_txt">QBT_TR(From:)QBT_TR[CONTEXT=OptionsDialog]</label>
154 </td>
155 <td>
156 <input type="text" id="src_email_txt" />
157 </td>
158 </tr>
159 <tr>
160 <td>
161 <label for="dest_email_txt">QBT_TR(To:)QBT_TR[CONTEXT=OptionsDialog]</label>
162 </td>
163 <td>
164 <input type="text" id="dest_email_txt" />
165 </td>
166 </tr>
167 <tr>
168 <td>
169 <label for="smtp_server_txt">QBT_TR(SMTP server:)QBT_TR[CONTEXT=OptionsDialog]</label>
170 </td>
171 <td>
172 <input type="text" id="smtp_server_txt" />
173 </td>
174 </tr>
175 </table>
176 <div class="formRow">
177 <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>
178 </div>
179 <fieldset class="settings">
180 <legend>
181 <input type="checkbox" id="mail_auth_checkbox" onclick="updateMailAuthSettings();" />
182 <label for="mail_auth_checkbox">QBT_TR(Authentication)QBT_TR[CONTEXT=OptionsDialog]</label>
183 </legend>
184 <table>
185 <tr>
186 <td>
187 <label for="mail_username_text">QBT_TR(Username:)QBT_TR[CONTEXT=OptionsDialog]</label>
188 </td>
189 <td>
190 <input type="text" id="mail_username_text" />
191 </td>
192 </tr>
193 <tr>
194 <td>
195 <label for="mail_password_text">QBT_TR(Password:)QBT_TR[CONTEXT=OptionsDialog]</label>
196 </td>
197 <td>
198 <input type="password" id="mail_password_text" />
199 </td>
200 </tr>
201 </table>
202 </fieldset>
203 </fieldset>
205 <fieldset class="settings">
206 <legend>
207 <input type="checkbox" id="autorun_checkbox" onclick="updateAutoRun();" />
208 <label for="autorun_checkbox">QBT_TR(Run external program on torrent completion)QBT_TR[CONTEXT=OptionsDialog]</label>
209 </legend>
210 <div class="formRow">
211 <input type="text" id="autorunProg_txt" style="width: 400px;" />
212 </div>
213 <div style="font-style: italic;">QBT_TR(Supported parameters (case sensitive):)QBT_TR[CONTEXT=OptionsDialog]
214 <ul>
215 <li>QBT_TR(%N: Torrent name)QBT_TR[CONTEXT=OptionsDialog]</li>
216 <li>QBT_TR(%L: Category)QBT_TR[CONTEXT=OptionsDialog]</li>
217 <li>QBT_TR(%G: Tags (separated by comma))QBT_TR[CONTEXT=OptionsDialog]</li>
218 <li>QBT_TR(%F: Content path (same as root path for multifile torrent))QBT_TR[CONTEXT=OptionsDialog]</li>
219 <li>QBT_TR(%R: Root path (first torrent subdirectory path))QBT_TR[CONTEXT=OptionsDialog]</li>
220 <li>QBT_TR(%D: Save path)QBT_TR[CONTEXT=OptionsDialog]</li>
221 <li>QBT_TR(%C: Number of files)QBT_TR[CONTEXT=OptionsDialog]</li>
222 <li>QBT_TR(%Z: Torrent size (bytes))QBT_TR[CONTEXT=OptionsDialog]</li>
223 <li>QBT_TR(%T: Current tracker)QBT_TR[CONTEXT=OptionsDialog]</li>
224 <li>QBT_TR(%I: Info hash)QBT_TR[CONTEXT=OptionsDialog]</li>
225 </ul>
226 QBT_TR(Tip: Encapsulate parameter with quotation marks to avoid text being cut off at whitespace (e.g., "%N"))QBT_TR[CONTEXT=OptionsDialog]
227 </div>
228 </fieldset>
229 </div>
231 <div id="ConnectionTab" class="PrefTab invisible">
232 <div class="formRow">
233 <label>QBT_TR(Enabled protocol:)QBT_TR[CONTEXT=OptionsDialog]</label>
234 <select id="enable_protocol_combobox">
235 <option value="0" selected>QBT_TR(TCP and μTP)QBT_TR[CONTEXT=OptionsDialog]</option>
236 <option value="1">TCP</option>
237 <option value="2">μTP</option>
238 </select>
239 </div>
240 <fieldset class="settings">
241 <legend>QBT_TR(Listening Port)QBT_TR[CONTEXT=OptionsDialog]</legend>
242 <div class="formRow">
243 <label for="port_value">QBT_TR(Port used for incoming connections:)QBT_TR[CONTEXT=OptionsDialog]</label>
244 <input type="text" id="port_value" style="width: 4em;" />
245 <button style="margin-left: 1em;" onclick="generateRandomPort();">Random</button>
246 </div>
247 <div class="formRow">
248 <input type="checkbox" id="upnp_checkbox" />
249 <label for="upnp_checkbox">QBT_TR(Use UPnP / NAT-PMP port forwarding from my router)QBT_TR[CONTEXT=OptionsDialog]</label>
250 </div>
251 <div class="formRow">
252 <input type="checkbox" id="random_port_checkbox" />
253 <label for="random_port_checkbox">QBT_TR(Use different port on each startup)QBT_TR[CONTEXT=OptionsDialog]</label>
254 </div>
255 </fieldset>
257 <fieldset class="settings">
258 <legend>QBT_TR(Connections Limits)QBT_TR[CONTEXT=OptionsDialog]</legend>
259 <table>
260 <tr>
261 <td>
262 <input type="checkbox" id="max_connec_checkbox" onclick="updateMaxConnecEnabled();" />
263 <label for="max_connec_checkbox">QBT_TR(Global maximum number of connections:)QBT_TR[CONTEXT=OptionsDialog]</label>
264 </td>
265 <td><input type="text" id="max_connec_value" style="width: 4em;" /></td>
266 </tr>
267 <tr>
268 <td>
269 <input type="checkbox" id="max_connec_per_torrent_checkbox" onclick="updateMaxConnecPerTorrentEnabled();" />
270 <label for="max_connec_per_torrent_checkbox">QBT_TR(Maximum number of connections per torrent:)QBT_TR[CONTEXT=OptionsDialog]</label>
271 </td>
272 <td><input type="text" id="max_connec_per_torrent_value" style="width: 4em;" /></td>
273 </tr>
274 <tr>
275 <td>
276 <input type="checkbox" id="max_uploads_checkbox" onclick="updateMaxUploadsEnabled();" />
277 <label for="max_uploads_checkbox">QBT_TR(Global maximum number of upload slots:)QBT_TR[CONTEXT=OptionsDialog]</label>
278 </td>
279 <td><input type="text" id="max_uploads_value" style="width: 4em;" /></td>
280 </tr>
281 <tr>
282 <td>
283 <input type="checkbox" id="max_uploads_per_torrent_checkbox" onclick="updateMaxUploadsPerTorrentEnabled();" />
284 <label for="max_uploads_per_torrent_checkbox">QBT_TR(Maximum number of upload slots per torrent:)QBT_TR[CONTEXT=OptionsDialog]</label>
285 </td>
286 <td><input type="text" id="max_uploads_per_torrent_value" style="width: 4em;" /></td>
287 </tr>
288 </table>
289 </fieldset>
291 <fieldset class="settings">
292 <legend>QBT_TR(Proxy Server)QBT_TR[CONTEXT=OptionsDialog]</legend>
293 <table>
294 <tr>
295 <td>
296 <label for="peer_proxy_type_select">QBT_TR(Type:)QBT_TR[CONTEXT=OptionsDialog]</label>
297 </td>
298 <td>
299 <select id="peer_proxy_type_select" onchange="updatePeerProxySettings();">
300 <option value="none">QBT_TR((None))QBT_TR[CONTEXT=OptionsDialog]</option>
301 <option value="socks4">QBT_TR(SOCKS4)QBT_TR[CONTEXT=OptionsDialog]</option>
302 <option value="socks5">QBT_TR(SOCKS5)QBT_TR[CONTEXT=OptionsDialog]</option>
303 <option value="http">QBT_TR(HTTP)QBT_TR[CONTEXT=OptionsDialog]</option>
304 </select>
305 </td>
306 <td>
307 <label for="peer_proxy_host_text">QBT_TR(Host:)QBT_TR[CONTEXT=OptionsDialog]</label>
308 </td>
309 <td>
310 <input type="text" id="peer_proxy_host_text" />
311 </td>
312 <td>
313 <label for="peer_proxy_port_value">QBT_TR(Port:)QBT_TR[CONTEXT=OptionsDialog]</label>
314 </td>
315 <td>
316 <input type="text" id="peer_proxy_port_value" style="width: 4em;" />
317 </td>
318 </tr>
319 </table>
320 <div class="formRow">
321 <input type="checkbox" id="use_peer_proxy_checkbox" />
322 <label for="use_peer_proxy_checkbox">QBT_TR(Use proxy for peer connections)QBT_TR[CONTEXT=OptionsDialog]</label>
323 </div>
324 <div class="formRow">
325 <input type="checkbox" id="proxy_only_for_torrents_checkbox" />
326 <label for="proxy_only_for_torrents_checkbox">QBT_TR(Use proxy only for torrents)QBT_TR[CONTEXT=OptionsDialog]</label>
327 </div>
328 <fieldset class="settings">
329 <legend>
330 <input type="checkbox" id="peer_proxy_auth_checkbox" onclick="updatePeerProxyAuthSettings();" />
331 <label for="peer_proxy_auth_checkbox">QBT_TR(Authentication)QBT_TR[CONTEXT=OptionsDialog]</label>
332 </legend>
333 <table>
334 <tr>
335 <td>
336 <label for="peer_proxy_username_text">QBT_TR(Username:)QBT_TR[CONTEXT=OptionsDialog]</label>
337 </td>
338 <td>
339 <input type="text" id="peer_proxy_username_text" />
340 </td>
341 </tr>
342 <tr>
343 <td>
344 <label for="peer_proxy_password_text">QBT_TR(Password:)QBT_TR[CONTEXT=OptionsDialog]</label>
345 </td>
346 <td>
347 <input type="password" id="peer_proxy_password_text" />
348 </td>
349 </tr>
350 </table>
351 <div class="formRow">
352 <span>Info: The password is saved unencrypted</span>
353 </div>
354 </fieldset>
355 </fieldset>
357 <fieldset class="settings">
358 <legend>
359 <input type="checkbox" id="ipfilter_enabled_checkbox" onclick="updateFilterSettings();" />
360 <label for="ipfilter_enabled_checkbox">QBT_TR(IP Filtering)QBT_TR[CONTEXT=OptionsDialog]</label>
361 </legend>
362 <div class="formRow">
363 <label for="ipfilter_text">QBT_TR(Filter path (.dat, .p2p, .p2b):)QBT_TR[CONTEXT=OptionsDialog]</label>
364 <input type="text" id="ipfilter_text" />
365 </div>
366 <div class="formRow">
367 <input type="checkbox" id="ipfilter_trackers_checkbox" />
368 <label for="ipfilter_trackers_checkbox">QBT_TR(Apply to trackers)QBT_TR[CONTEXT=OptionsDialog]</label>
369 </div>
370 <div class="formRow">
371 <fieldset class="settings">
372 <legend>QBT_TR(Manually banned IP addresses...)QBT_TR[CONTEXT=OptionsDialog]</legend>
373 <textarea id="banned_IPs_textarea" rows="5" cols="70"></textarea>
374 </fieldset>
375 </div>
376 </fieldset>
377 </div>
379 <div id="SpeedTab" class="PrefTab invisible">
380 <fieldset class="settings">
381 <legend>QBT_TR(Global Rate Limits)QBT_TR[CONTEXT=OptionsDialog]</legend>
382 <table>
383 <tr>
384 <td rowspan="2">
385 <img src="images/slow_off.svg" style="height: 1em;" alt="QBT_TR(Alternative speed limits)QBT_TR[CONTEXT=MainWindow]">
386 </td>
387 <td><label for="up_limit_value">QBT_TR(Upload:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
388 <td><input type="number" id="up_limit_value" style="width: 4em;" min="0" />&nbsp;&nbsp;QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog]</td>
389 </tr>
390 <tr>
391 <td><label for="dl_limit_value">QBT_TR(Download:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
392 <td><input type="number" id="dl_limit_value" style="width: 4em;" min="0" />&nbsp;&nbsp;QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog]</td>
393 </tr>
394 </table>
395 <i>QBT_TR(0 means unlimited)QBT_TR[CONTEXT=OptionsDialog]</i>
396 </fieldset>
398 <fieldset class="settings">
399 <legend>QBT_TR(Alternative Rate Limits)QBT_TR[CONTEXT=OptionsDialog]</legend>
400 <table>
401 <tr>
402 <td rowspan="2">
403 <img src="images/slow.svg" style="height: 1em;" alt="QBT_TR(Alternative speed limits)QBT_TR[CONTEXT=MainWindow]">
404 </td>
405 <td><label for="alt_up_limit_value">QBT_TR(Upload:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
406 <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>
407 </tr>
408 <tr>
409 <td><label for="alt_dl_limit_value">QBT_TR(Download:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
410 <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>
411 </tr>
412 </table>
413 <i>QBT_TR(0 means unlimited)QBT_TR[CONTEXT=OptionsDialog]</i>
415 <fieldset class="settings">
416 <legend>
417 <input type="checkbox" id="limit_sheduling_checkbox" onclick="updateSchedulingEnabled();" />
418 <label for="limit_sheduling_checkbox">QBT_TR(Schedule the use of alternative rate limits)QBT_TR[CONTEXT=OptionsDialog]</label>
419 </legend>
420 <div class="formRow">
421 QBT_TR(From:)QBT_TR[CONTEXT=OptionsDialog]
422 <input type="text" id="schedule_from_hour" style="width: 1.5em;" />:<input type="text" id="schedule_from_min" style="width: 1.5em;" /> QBT_TR(To:)QBT_TR[CONTEXT=OptionsDialog]
423 <input type="text" id="schedule_to_hour" style="width: 1.5em;" />:<input type="text" id="schedule_to_min" style="width: 1.5em;" />
424 </div>
425 <div class="formRow">
426 QBT_TR(When:)QBT_TR[CONTEXT=OptionsDialog]
427 <select id="schedule_freq_select">
428 <option value="0">QBT_TR(Every day)QBT_TR[CONTEXT=OptionsDialog]</option>
429 <option value="1">QBT_TR(Weekdays)QBT_TR[CONTEXT=OptionsDialog]</option>
430 <option value="2">QBT_TR(Weekends)QBT_TR[CONTEXT=OptionsDialog]</option>
431 <option value="3">QBT_TR(Monday)QBT_TR[CONTEXT=HttpServer]</option>
432 <option value="4">QBT_TR(Tuesday)QBT_TR[CONTEXT=HttpServer]</option>
433 <option value="5">QBT_TR(Wednesday)QBT_TR[CONTEXT=HttpServer]</option>
434 <option value="6">QBT_TR(Thursday)QBT_TR[CONTEXT=HttpServer]</option>
435 <option value="7">QBT_TR(Friday)QBT_TR[CONTEXT=HttpServer]</option>
436 <option value="8">QBT_TR(Saturday)QBT_TR[CONTEXT=HttpServer]</option>
437 <option value="9">QBT_TR(Sunday)QBT_TR[CONTEXT=HttpServer]</option>
438 </select>
439 </div>
440 </fieldset>
441 </fieldset>
443 <fieldset class="settings">
444 <legend>QBT_TR(Rate Limits Settings)QBT_TR[CONTEXT=OptionsDialog]</legend>
445 <div class="formRow">
446 <input type="checkbox" id="limit_utp_rate_checkbox" />
447 <label for="limit_utp_rate_checkbox">QBT_TR(Apply rate limit to µTP protocol)QBT_TR[CONTEXT=OptionsDialog]</label>
448 </div>
449 <div class="formRow">
450 <input type="checkbox" id="limit_tcp_overhead_checkbox" />
451 <label for="limit_tcp_overhead_checkbox">QBT_TR(Apply rate limit to transport overhead)QBT_TR[CONTEXT=OptionsDialog]</label>
452 </div>
453 <div class="formRow">
454 <input type="checkbox" id="limit_lan_peers_checkbox" />
455 <label for="limit_lan_peers_checkbox">QBT_TR(Apply rate limit to peers on LAN)QBT_TR[CONTEXT=OptionsDialog]</label>
456 </div>
457 </fieldset>
458 </div>
460 <div id="BittorrentTab" class="PrefTab invisible">
461 <fieldset class="settings">
462 <legend>QBT_TR(Privacy)QBT_TR[CONTEXT=OptionsDialog]</legend>
463 <div class="formRow">
464 <input type="checkbox" id="dht_checkbox" />
465 <label for="dht_checkbox">QBT_TR(Enable DHT (decentralized network) to find more peers)QBT_TR[CONTEXT=OptionsDialog]</label>
466 </div>
467 <div class="formRow">
468 <input type="checkbox" id="pex_checkbox" />
469 <label for="pex_checkbox">QBT_TR(Enable Peer Exchange (PeX) to find more peers)QBT_TR[CONTEXT=OptionsDialog]</label>
470 </div>
471 <div class="formRow">
472 <input type="checkbox" id="lsd_checkbox" />
473 <label for="lsd_checkbox">QBT_TR(Enable Local Peer Discovery to find more peers)QBT_TR[CONTEXT=OptionsDialog]</label>
474 </div>
475 <div class="formRow">
476 <label for="encryption_select">QBT_TR(Encryption mode:)QBT_TR[CONTEXT=OptionsDialog]</label>
477 <select id="encryption_select">
478 <option value="0">QBT_TR(Allow encryption)QBT_TR[CONTEXT=OptionsDialog]</option>
479 <option value="1">QBT_TR(Require encryption)QBT_TR[CONTEXT=OptionsDialog]</option>
480 <option value="2">QBT_TR(Disable encryption)QBT_TR[CONTEXT=OptionsDialog]</option>
481 </select>
482 </div>
483 <div class="formRow">
484 <input type="checkbox" id="anonymous_mode_checkbox" />
485 <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>
486 </div>
487 </fieldset>
489 <fieldset class="settings">
490 <legend>
491 <input type="checkbox" id="queueing_checkbox" onclick="updateQueueingSystem();" />
492 <label for="queueing_checkbox">QBT_TR(Torrent Queueing)QBT_TR[CONTEXT=OptionsDialog]</label>
493 </legend>
494 <table>
495 <tr>
496 <td>
497 <label for="max_active_dl_value">QBT_TR(Maximum active downloads:)QBT_TR[CONTEXT=OptionsDialog]</label>
498 </td>
499 <td>
500 <input type="text" id="max_active_dl_value" style="width: 4em;" />
501 </td>
502 </tr>
503 <tr>
504 <td>
505 <label for="max_active_up_value">QBT_TR(Maximum active uploads:)QBT_TR[CONTEXT=OptionsDialog]</label>
506 </td>
507 <td>
508 <input type="text" id="max_active_up_value" style="width: 4em;" />
509 </td>
510 </tr>
511 <tr>
512 <td>
513 <label for="max_active_to_value">QBT_TR(Maximum active torrents:)QBT_TR[CONTEXT=OptionsDialog]</label>
514 </td>
515 <td>
516 <input type="text" id="max_active_to_value" style="width: 4em;" />
517 </td>
518 </tr>
519 </table>
520 <fieldset class="settings">
521 <legend>
522 <input type="checkbox" id="dont_count_slow_torrents_checkbox" onclick="updateSlowTorrentsSettings();" />
523 <label for="dont_count_slow_torrents_checkbox">QBT_TR(Do not count slow torrents in these limits)QBT_TR[CONTEXT=OptionsDialog]</label>
524 </legend>
525 <table>
526 <tr>
527 <td>
528 <label for="dl_rate_threshold">QBT_TR(Download rate threshold:)QBT_TR[CONTEXT=OptionsDialog]</label>
529 </td>
530 <td>
531 <input type="text" id="dl_rate_threshold" style="width: 4em;" />&nbsp;&nbsp;QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog]
532 </td>
533 </tr>
534 <tr>
535 <td>
536 <label for="ul_rate_threshold">QBT_TR(Upload rate threshold:)QBT_TR[CONTEXT=OptionsDialog]</label>
537 </td>
538 <td>
539 <input type="text" id="ul_rate_threshold" style="width: 4em;" />&nbsp;&nbsp;QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog]
540 </td>
541 </tr>
542 <tr>
543 <td>
544 <label for="torrent_inactive_timer">QBT_TR(Torrent inactivity timer:)QBT_TR[CONTEXT=OptionsDialog]</label>
545 </td>
546 <td>
547 <input type="text" id="torrent_inactive_timer" style="width: 4em;" />&nbsp;&nbsp;QBT_TR(seconds)QBT_TR[CONTEXT=OptionsDialog]
548 </td>
549 </tr>
550 </table>
551 </fieldset>
552 </fieldset>
554 <fieldset class="settings">
555 <legend>QBT_TR(Share Ratio Limiting)QBT_TR[CONTEXT=OptionsDialog]</legend>
556 <table>
557 <tr>
558 <td>
559 <input type="checkbox" id="max_ratio_checkbox" onclick="updateMaxRatioTimeEnabled();" />
560 <label for="max_ratio_checkbox">QBT_TR(Seed torrents until their ratio reaches)QBT_TR[CONTEXT=OptionsDialog]</label>
561 </td>
562 <td>
563 <input type="text" id="max_ratio_value" style="width: 4em;" />
564 </td>
565 <tr>
566 <td>
567 <input type="checkbox" id="max_seeding_time_checkbox" onclick="updateMaxRatioTimeEnabled();" />
568 <label for="max_seeding_time_checkbox">QBT_TR(Seed torrents until their seeding time reaches)QBT_TR[CONTEXT=OptionsDialog]</label>
569 </td>
570 <td>
571 <input type="text" id="max_seeding_time_value" style="width: 4em;" /> QBT_TR(minutes)QBT_TR[CONTEXT=OptionsDialog]
572 </td>
573 </tr>
574 <tr>
575 <td style="text-align: right;">
576 QBT_TR(then)QBT_TR[CONTEXT=OptionsDialog]
577 </td>
578 <td>
579 <select id="max_ratio_act">
580 <option value="0">QBT_TR(Pause them)QBT_TR[CONTEXT=OptionsDialog]</option>
581 <option value="1">QBT_TR(Remove them)QBT_TR[CONTEXT=OptionsDialog]</option>
582 <option value="2">QBT_TR(Enable super seeding for them)QBT_TR[CONTEXT=OptionsDialog]</option>
583 </select>
584 </td>
585 </tr>
586 </table>
587 </fieldset>
589 <fieldset class="settings">
590 <legend>
591 <input type="checkbox" id="add_trackers_checkbox" onclick="updateAddTrackersEnabled();" />
592 <label for="add_trackers_checkbox">QBT_TR(Automatically add these trackers to new downloads:)QBT_TR[CONTEXT=OptionsDialog]</label>
593 </legend>
594 <textarea id="add_trackers_textarea" rows="5" cols="70"></textarea>
595 </fieldset>
596 </div>
598 <div id="WebUITab" class="PrefTab invisible">
599 <fieldset class="settings">
600 <legend>QBT_TR(Language)QBT_TR[CONTEXT=OptionsDialog]</legend>
601 <label for="locale_select">QBT_TR(User Interface Language:)QBT_TR[CONTEXT=OptionsDialog]</label>
602 <select id="locale_select">
603 <option value="en">English</option>
604 <option value="en_AU">English(Australia)</option>
605 <option value="en_GB">English(United Kingdom)</option>
606 <option value="eo_EO">Esperanto</option>
607 <option value="fr_FR">Français</option>
608 <option value="de_DE">Deutsch</option>
609 <option value="hu_HU">Magyar</option>
610 <option value="is">Íslenska</option>
611 <option value="id">Bahasa Indonesia</option>
612 <option value="it_IT">Italiano</option>
613 <option value="nl_NL">Nederlands</option>
614 <option value="es_ES">Español</option>
615 <option value="ca_ES">Català</option>
616 <option value="gl_ES">Galego</option>
617 <option value="oc">lenga d'òc</option>
618 <option value="pt_BR">Português brasileiro</option>
619 <option value="pt_PT">Português</option>
620 <option value="pl_PL">Polski</option>
621 <option value="lv_LV">latviešu valoda</option>
622 <option value="lt_LT">Lietuvių</option>
623 <option value="ms_MY">بهاس ملايو</option>
624 <option value="cs_CZ">Čeština</option>
625 <option value="sk_SK">Slovenčina</option>
626 <option value="sl_SI">Slovenščina</option>
627 <option value="sr_CS">Српски</option>
628 <option value="hi_IN">हिन्दी, हिंदी</option>
629 <option value="hr_HR">Hrvatski</option>
630 <option value="hy_AM">Հայերեն</option>
631 <option value="ro_RO">Română</option>
632 <option value="tr_TR">Türkçe</option>
633 <option value="el_GR">Ελληνικά</option>
634 <option value="sv_SE">Svenska</option>
635 <option value="fi_FI">Suomi</option>
636 <option value="nb_NO">Norsk</option>
637 <option value="da_DK">Dansk</option>
638 <option value="bg_BG">Български</option>
639 <option value="uk_UA">Українська</option>
640 <option value="uz@Latn">أۇزبېك</option>
641 <option value="ru_RU">Русский</option>
642 <option value="ja_JP">日本語</option>
643 <option value="he_IL">עברית</option>
644 <option value="ar_AE">عربي</option>
645 <option value="ka_GE">ქართული</option>
646 <option value="be_BY">Беларуская</option>
647 <option value="eu_ES">Euskara</option>
648 <option value="vi_VN">tiếng Việt</option>
649 <option value="zh">简体中文</option>
650 <option value="zh_TW">正體中文</option>
651 <option value="zh_HK">香港正體字</option>
652 <option value="ko_KR">한글</option>
653 </select>
654 </fieldset>
656 <fieldset class="settings">
657 <legend>QBT_TR(Web User Interface (Remote control))QBT_TR[CONTEXT=OptionsDialog]</legend>
658 <table>
659 <tr>
660 <td>
661 <label for="webui_address_value">QBT_TR(IP address:)QBT_TR[CONTEXT=OptionsDialog]</label>
662 </td>
663 <td>
664 <input type="text" id="webui_address_value" />
665 <label for="webui_port_value" style="margin-left: 10px;">QBT_TR(Port:)QBT_TR[CONTEXT=OptionsDialog]</label>
666 <input type="text" id="webui_port_value" style="width: 4em;" />
667 </td>
668 </tr>
669 </table>
670 <div class="formRow">
671 <input type="checkbox" id="webui_upnp_checkbox" />
672 <label for="webui_upnp_checkbox">QBT_TR(Use UPnP / NAT-PMP to forward the port from my router)QBT_TR[CONTEXT=OptionsDialog]</label>
673 </div>
674 <fieldset class="settings">
675 <legend>
676 <input type="checkbox" id="use_https_checkbox" onclick="updateHttpsSettings();" />
677 <label for="use_https_checkbox">QBT_TR(Use HTTPS instead of HTTP)QBT_TR[CONTEXT=OptionsDialog]</label>
678 </legend>
679 <table>
680 <tr>
681 <td>
682 <label for="ssl_cert_text">QBT_TR(Certificate:)QBT_TR[CONTEXT=OptionsDialog]</label>
683 </td>
684 <td>
685 <input type="text" id="ssl_cert_text" style="width: 30em;" />
686 </td>
687 </tr>
688 <tr>
689 <td>
690 <label for="ssl_key_text">QBT_TR(Key:)QBT_TR[CONTEXT=OptionsDialog]</label>
691 </td>
692 <td>
693 <input type="text" id="ssl_key_text" style="width: 30em;" />
694 </td>
695 </tr>
696 </table>
697 <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>
698 </fieldset>
700 <fieldset class="settings">
701 <legend>QBT_TR(Authentication)QBT_TR[CONTEXT=OptionsDialog]</legend>
702 <table>
703 <tr>
704 <td>
705 <label for="webui_username_text">QBT_TR(Username:)QBT_TR[CONTEXT=OptionsDialog]</label>
706 </td>
707 <td>
708 <input type="text" id="webui_username_text" />
709 </td>
710 </tr>
711 <tr>
712 <td>
713 <label for="webui_password_text">QBT_TR(Password:)QBT_TR[CONTEXT=OptionsDialog]</label>
714 </td>
715 <td>
716 <input type="password" id="webui_password_text" placeholder="QBT_TR(Change current password)QBT_TR[CONTEXT=OptionsDialog]" autocomplete="new-password" />
717 </td>
718 </tr>
719 </table>
720 <div class="formRow">
721 <input type="checkbox" id="bypass_local_auth_checkbox" />
722 <label for="bypass_local_auth_checkbox">QBT_TR(Bypass authentication for clients on localhost)QBT_TR[CONTEXT=OptionsDialog]</label>
723 </div>
724 <div class="formRow">
725 <input type="checkbox" id="bypass_auth_subnet_whitelist_checkbox" onclick="updateBypasssAuthSettings();" />
726 <label for="bypass_auth_subnet_whitelist_checkbox">QBT_TR(Bypass authentication for clients in whitelisted IP subnets)QBT_TR[CONTEXT=OptionsDialog]</label>
727 </div>
728 <div class="formRow" style="padding-left: 30px; padding-top: 5px;">
729 <textarea id="bypass_auth_subnet_whitelist_textarea" rows="5" cols="48" placeholder="Example: 172.17.32.0/24, fdff:ffff:c8::/40"></textarea>
730 </div>
731 <table>
732 <tr>
733 <td><label for="webUISessionTimeoutInput">QBT_TR(Session timeout:)QBT_TR[CONTEXT=OptionsDialog]</label></td>
734 <td><input type="number" id="webUISessionTimeoutInput" style="width: 4em;" min="0" />&nbsp;&nbsp;QBT_TR(sec)QBT_TR[CONTEXT=OptionsDialog]</td>
735 </tr>
736 </table>
737 </fieldset>
739 <fieldset class="settings">
740 <legend><input type="checkbox" id="use_alt_webui_checkbox" onclick="updateAlternativeWebUISettings();" />
741 <label for="use_alt_webui_checkbox">QBT_TR(Use alternative Web UI)QBT_TR[CONTEXT=OptionsDialog]</label></legend>
742 <div class="formRow">
743 <label for="webui_files_location_textarea">QBT_TR(Files location:)QBT_TR[CONTEXT=OptionsDialog]</label>
744 <input type="text" id="webui_files_location_textarea" />
745 </div>
746 </fieldset>
748 <fieldset class="settings">
749 <legend>QBT_TR(Security)QBT_TR[CONTEXT=OptionsDialog]</legend>
750 <div class="formRow">
751 <input type="checkbox" id="clickjacking_protection_checkbox" />
752 <label for="clickjacking_protection_checkbox">QBT_TR(Enable clickjacking protection)QBT_TR[CONTEXT=OptionsDialog]</label>
753 </div>
754 <div class="formRow">
755 <input type="checkbox" id="csrf_protection_checkbox" />
756 <label for="csrf_protection_checkbox">QBT_TR(Enable Cross-Site Request Forgery (CSRF) protection)QBT_TR[CONTEXT=OptionsDialog]</label>
757 </div>
759 <fieldset class="settings">
760 <legend>
761 <input type="checkbox" id="host_header_validation_checkbox" onclick="updateHostHeaderValidationSettings();" />
762 <label for="host_header_validation_checkbox">QBT_TR(Enable Host header validation)QBT_TR[CONTEXT=OptionsDialog]</label>
763 </legend>
764 <table>
765 <tr>
766 <td>
767 <label for="webui_domain_textarea">QBT_TR(Server domains:)QBT_TR[CONTEXT=OptionsDialog]</label>
768 </td>
769 <td>
770 <textarea id="webui_domain_textarea" rows="1" cols="60"></textarea>
771 </td>
772 </tr>
773 </table>
774 </fieldset>
775 </fieldset>
776 </fieldset>
778 <fieldset class="settings">
779 <legend>
780 <input type="checkbox" id="use_dyndns_checkbox" onclick="updateDynDnsSettings();" />
781 <label for="use_dyndns_checkbox">QBT_TR(Update my dynamic domain name)QBT_TR[CONTEXT=OptionsDialog]</label>
782 </legend>
783 <select id="dyndns_select">
784 <option value="0">DynDNS</option>
785 <option value="1">NO-IP</option>
786 </select>
787 <input type="button" value="QBT_TR(Register)QBT_TR[CONTEXT=OptionsDialog]" onclick="registerDynDns();" />
788 <table style="margin-top: 10px;">
789 <tr>
790 <td>
791 <label for="dyndns_domain_text">QBT_TR(Domain name:)QBT_TR[CONTEXT=OptionsDialog]</label>
792 </td>
793 <td>
794 <input type="text" id="dyndns_domain_text" />
795 </td>
796 </tr>
797 <tr>
798 <td>
799 <label for="dyndns_username_text">QBT_TR(Username:)QBT_TR[CONTEXT=OptionsDialog]</label>
800 </td>
801 <td>
802 <input type="text" id="dyndns_username_text" />
803 </td>
804 </tr>
805 <tr>
806 <td>
807 <label for="dyndns_password_text">QBT_TR(Password:)QBT_TR[CONTEXT=OptionsDialog]</label>
808 </td>
809 <td>
810 <input type="password" id="dyndns_password_text" />
811 </td>
812 </tr>
813 </table>
814 </fieldset>
815 </div>
817 <div id="AdvancedTab" class="PrefTab invisible">
818 <fieldset class="settings">
819 <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>
820 <table>
821 <tr>
822 <td>
823 <label for="networkInterface">QBT_TR(Network Interface (requires restart):)QBT_TR[CONTEXT=OptionsDialog]</label>
824 </td>
825 <td>
826 <select id="networkInterface" style="width: 15em;">
827 </select>
828 </td>
829 </tr>
830 <tr>
831 <td>
832 <label for="optionalIPAddressToBind">QBT_TR(Optional IP Address to bind to (requires restart):)QBT_TR[CONTEXT=OptionsDialog]</label>
833 </td>
834 <td>
835 <select id="optionalIPAddressToBind" style="width: 15em;">
836 </select>
837 </td>
838 </tr>
839 <tr>
840 <td>
841 <label for="listenOnIPv6Address">QBT_TR(Listen on IPv6 address (requires restart):)QBT_TR[CONTEXT=OptionsDialog]</label>
842 </td>
843 <td>
844 <input type="checkbox" id="listenOnIPv6Address">
845 </td>
846 </tr>
847 <tr>
848 <td>
849 <label for="saveResumeDataInterval">QBT_TR(Save resume data interval:)QBT_TR[CONTEXT=OptionsDialog]</label>
850 </td>
851 <td>
852 <input type="text" id="saveResumeDataInterval" style="width: 15em;">&nbsp;&nbsp;QBT_TR(min)QBT_TR[CONTEXT=OptionsDialog]
853 </td>
854 </tr>
855 <tr>
856 <td>
857 <label for="recheckTorrentsOnCompletion">QBT_TR(Recheck torrents on completion:)QBT_TR[CONTEXT=OptionsDialog]</label>
858 </td>
859 <td>
860 <input type="checkbox" id="recheckTorrentsOnCompletion">
861 </td>
862 </tr>
863 <tr>
864 <td>
865 <label for="resolvePeerCountries">QBT_TR(Resolve peer countries (GeoIP):)QBT_TR[CONTEXT=OptionsDialog]</label>
866 </td>
867 <td>
868 <input type="checkbox" id="resolvePeerCountries">
869 </td>
870 </tr>
871 </table>
872 </fieldset>
873 <fieldset class="settings">
874 <legend>QBT_TR(libtorrent Section)QBT_TR[CONTEXT=OptionsDialog]&nbsp;(<a href="https://www.libtorrent.org/reference.html" target="_blank">QBT_TR(Open documentation)QBT_TR[CONTEXT=HttpServer]</a>)</legend>
875 <table>
876 <tr>
877 <td>
878 <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>
879 </td>
880 <td>
881 <input type="text" id="asyncIOThreads" style="width: 15em;" />
882 </td>
883 </tr>
884 <tr>
885 <td>
886 <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>
887 </td>
888 <td>
889 <input type="text" id="filePoolSize" style="width: 15em;" />
890 </td>
891 </tr>
892 <tr>
893 <td>
894 <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>
895 </td>
896 <td>
897 <input type="text" id="outstandMemoryWhenCheckingTorrents" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(MiB)QBT_TR[CONTEXT=OptionsDialog]
898 </td>
899 </tr>
900 <tr>
901 <td>
902 <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>
903 </td>
904 <td>
905 <input type="text" id="diskCache" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(MiB)QBT_TR[CONTEXT=OptionsDialog]
906 </td>
907 </tr>
908 <tr>
909 <td>
910 <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>
911 </td>
912 <td>
913 <input type="text" id="diskCacheExpiryInterval" style="width: 15em;">&nbsp;&nbsp;QBT_TR(s)QBT_TR[CONTEXT=OptionsDialog]
914 </td>
915 </tr>
916 <tr>
917 <td>
918 <label for="enableOSCache">QBT_TR(Enable OS cache:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#disk_io_write_mode" target="_blank">(?)</a></label>
919 </td>
920 <td>
921 <input type="checkbox" id="enableOSCache" />
922 </td>
923 </tr>
924 <tr>
925 <td>
926 <label for="coalesceReadsAndWrites">QBT_TR(Coalesce reads & writes:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#coalesce_reads" target="_blank">(?)</a></label>
927 </td>
928 <td>
929 <input type="checkbox" id="coalesceReadsAndWrites" />
930 </td>
931 </tr>
932 <tr>
933 <td>
934 <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>
935 </td>
936 <td>
937 <input type="checkbox" id="sendUploadPieceSuggestions" />
938 </td>
939 </tr>
940 <tr>
941 <td>
942 <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>
943 </td>
944 <td>
945 <input type="text" id="sendBufferWatermark" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(KiB)QBT_TR[CONTEXT=OptionsDialog]
946 </td>
947 </tr>
948 <tr>
949 <td>
950 <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>
951 </td>
952 <td>
953 <input type="text" id="sendBufferLowWatermark" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(KiB)QBT_TR[CONTEXT=OptionsDialog]
954 </td>
955 </tr>
956 <tr>
957 <td>
958 <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>
959 </td>
960 <td>
961 <input type="text" id="sendBufferWatermarkFactor" style="width: 15em;" />&nbsp;&nbsp;%
962 </td>
963 </tr>
964 <tr>
965 <td>
966 <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>
967 </td>
968 <td>
969 <input type="text" id="socketBacklogSize" style="width: 15em;" />
970 </td>
971 </tr>
972 <tr>
973 <td>
974 <label for="outgoingPortsMin">QBT_TR(Outgoing ports (Min) [0: Disabled]:)QBT_TR[CONTEXT=OptionsDialog]</label>
975 </td>
976 <td>
977 <input type="text" id="outgoingPortsMin" style="width: 15em;" />
978 </td>
979 </tr>
980 <tr>
981 <td>
982 <label for="outgoingPortsMax">QBT_TR(Outgoing ports (Max) [0: Disabled]:)QBT_TR[CONTEXT=OptionsDialog]</label>
983 </td>
984 <td>
985 <input type="text" id="outgoingPortsMax" style="width: 15em;" />
986 </td>
987 </tr>
988 <tr>
989 <td>
990 <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>
991 </td>
992 <td>
993 <select id="utpTCPMixedModeAlgorithm" style="width: 15em;">
994 <option value="0">QBT_TR(Prefer TCP)QBT_TR[CONTEXT=OptionsDialog]</option>
995 <option value="1">QBT_TR(Peer proportional (throttles TCP))QBT_TR[CONTEXT=OptionsDialog]</option>
996 </select>
997 </td>
998 </tr>
999 <tr>
1000 <td>
1001 <label for="allowMultipleConnectionsFromTheSameIPAddress">QBT_TR(Allow multiple connections from the same IP address:)QBT_TR[CONTEXT=OptionsDialog]</label>
1002 </td>
1003 <td>
1004 <input type="checkbox" id="allowMultipleConnectionsFromTheSameIPAddress" />
1005 </td>
1006 </tr>
1007 <tr>
1008 <td>
1009 <label for="enableEmbeddedTracker">QBT_TR(Enable embedded tracker:)QBT_TR[CONTEXT=OptionsDialog]</label>
1010 </td>
1011 <td>
1012 <input type="checkbox" id="enableEmbeddedTracker" />
1013 </td>
1014 </tr>
1015 <tr>
1016 <td>
1017 <label for="embeddedTrackerPort">QBT_TR(Embedded tracker port:)QBT_TR[CONTEXT=OptionsDialog]</label>
1018 </td>
1019 <td>
1020 <input type="text" id="embeddedTrackerPort" style="width: 15em;" />
1021 </td>
1022 </tr>
1023 <tr>
1024 <td>
1025 <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>
1026 </td>
1027 <td>
1028 <select id="uploadSlotsBehavior" style="width: 15em;">
1029 <option value="0">QBT_TR(Fixed slots)QBT_TR[CONTEXT=OptionsDialog]</option>
1030 <option value="1">QBT_TR(Upload rate based)QBT_TR[CONTEXT=OptionsDialog]</option>
1031 </select>
1032 </td>
1033 </tr>
1034 <tr>
1035 <td>
1036 <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>
1037 </td>
1038 <td>
1039 <select id="uploadChokingAlgorithm" style="width: 15em;">
1040 <option value="0">QBT_TR(Round-robin)QBT_TR[CONTEXT=OptionsDialog]</option>
1041 <option value="1">QBT_TR(Fastest upload)QBT_TR[CONTEXT=OptionsDialog]</option>
1042 <option value="2">QBT_TR(Anti-leech)QBT_TR[CONTEXT=OptionsDialog]</option>
1043 </select>
1044 </td>
1045 </tr>
1046 <tr>
1047 <td>
1048 <label for="strictSuperSeeding">QBT_TR(Strict super seeding:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#strict_super_seeding" target="_blank">(?)</a></label>
1049 </td>
1050 <td>
1051 <input type="checkbox" id="strictSuperSeeding" />
1052 </td>
1053 </tr>
1054 <tr>
1055 <td>
1056 <label for="announceAllTrackers">QBT_TR(Always announce to all trackers in a tier:)QBT_TR[CONTEXT=OptionsDialog]</label>
1057 </td>
1058 <td>
1059 <input type="checkbox" id="announceAllTrackers" />
1060 </td>
1061 </tr>
1062 <tr>
1063 <td>
1064 <label for="announceAllTiers">QBT_TR(Always announce to all tiers:)QBT_TR[CONTEXT=OptionsDialog]</label>
1065 </td>
1066 <td>
1067 <input type="checkbox" id="announceAllTiers" />
1068 </td>
1069 </tr>
1070 <tr>
1071 <td>
1072 <label for="announceIP">QBT_TR(IP Address to report to trackers (requires restart):)QBT_TR[CONTEXT=OptionsDialog]</label>
1073 </td>
1074 <td>
1075 <input type="text" id="announceIP" style="width: 15em;" />
1076 </td>
1077 </tr>
1078 </table>
1079 </fieldset>
1080 </div>
1082 <div style="text-align: center; margin-top: 1em;"><input type="button" value="QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" onclick="applyPreferences();" /></div>
1084 <script>
1085 'use strict';
1087 // Downloads tab
1088 this.WatchedFoldersTable = new HtmlTable($("watched_folders_tab"));
1090 this.updateTempDirEnabled = function() {
1091 const isTempDirEnabled = $('temppath_checkbox').getProperty('checked');
1092 $('temppath_text').setProperty('disabled', !isTempDirEnabled);
1095 this.addWatchFolder = function() {
1096 const new_folder = $('new_watch_folder_txt').getProperty('value').trim();
1097 if (new_folder.length <= 0) return;
1099 const new_other = $('new_watch_folder_other_txt').getProperty('value').trim();
1100 if (new_other.length <= 0) return;
1102 const new_select = $('new_watch_folder_select').getProperty('value').trim();
1104 const i = $('watched_folders_tab').getChildren('tbody')[0].getChildren('tr').length;
1105 pushWatchFolder(i, new_folder, new_select, new_other);
1107 // Clear fields
1108 $('new_watch_folder_txt').setProperty('value', '');
1109 const elt = $('new_watch_folder_select');
1110 elt.setProperty('value', 'watch_folder');
1111 const text = elt.options[elt.selectedIndex].innerHTML;
1112 $('new_watch_folder_other_txt').setProperty('value', text);
1115 this.changeWatchFolderSelect = function(item) {
1116 if (item.value == "other") {
1117 item.nextElementSibling.hidden = false;
1118 item.nextElementSibling.value = 'QBT_TR(Type folder here)QBT_TR[CONTEXT=HttpServer]';
1119 item.nextElementSibling.select();
1121 else {
1122 item.nextElementSibling.hidden = true;
1123 const text = item.options[item.selectedIndex].innerHTML;
1124 item.nextElementSibling.value = text;
1128 this.pushWatchFolder = function(pos, folder, sel, other) {
1129 const myinput = "<input id='text_watch_" + pos + "' type='text' value='" + folder + "'>";
1130 const disableInput = (sel != "other");
1131 const mycb = "<div class='select-watched-folder-editable'>"
1132 + "<select id ='cb_watch_" + pos + "' onchange='changeWatchFolderSelect(this)'>"
1133 + "<option value='watch_folder'>QBT_TR(Monitored folder)QBT_TR[CONTEXT=ScanFoldersModel]</option>"
1134 + "<option value='default_folder'>QBT_TR(Default save location)QBT_TR[CONTEXT=ScanFoldersModel]</option>"
1135 + "<option value='other'>QBT_TR(Other...)QBT_TR[CONTEXT=HttpServer]</option>"
1136 + "</select>"
1137 + "<input id='cb_watch_txt_" + pos + "' type='text' " + (disableInput ? "hidden " : "") + "/></div>";
1139 WatchedFoldersTable.push([myinput, mycb]);
1140 $('cb_watch_' + pos).setProperty('value', sel);
1141 if (disableInput) {
1142 const elt = $('cb_watch_' + pos);
1143 other = elt.options[elt.selectedIndex].innerHTML;
1145 $('cb_watch_txt_' + pos).setProperty('value', other);
1148 this.getWatchedFolders = function() {
1149 const nb_folders = $("watched_folders_tab").getChildren("tbody")[0].getChildren("tr").length;
1150 const folders = new Hash();
1151 for (let i = 0; i < nb_folders; ++i) {
1152 const fpath = $('text_watch_' + i).getProperty('value').trim();
1153 if (fpath.length > 0) {
1154 let other;
1155 const sel = $('cb_watch_' + i).getProperty('value').trim();
1156 if (sel == "other") {
1157 other = $('cb_watch_txt_' + i).getProperty('value').trim();
1159 else {
1160 other = (sel == "watch_folder") ? 0 : 1;
1162 folders.set(fpath, other);
1165 return folders;
1168 this.updateExportDirEnabled = function() {
1169 const isExportDirEnabled = $('exportdir_checkbox').getProperty('checked');
1170 $('exportdir_text').setProperty('disabled', !isExportDirEnabled);
1173 this.updateExportDirFinEnabled = function() {
1174 const isExportDirFinEnabled = $('exportdirfin_checkbox').getProperty('checked');
1175 $('exportdirfin_text').setProperty('disabled', !isExportDirFinEnabled);
1178 this.updateMailNotification = function() {
1179 const isMailNotificationEnabled = $('mail_notification_checkbox').getProperty('checked');
1180 $('src_email_txt').setProperty('disabled', !isMailNotificationEnabled);
1181 $('dest_email_txt').setProperty('disabled', !isMailNotificationEnabled);
1182 $('smtp_server_txt').setProperty('disabled', !isMailNotificationEnabled);
1183 $('mail_ssl_checkbox').setProperty('disabled', !isMailNotificationEnabled);
1184 $('mail_auth_checkbox').setProperty('disabled', !isMailNotificationEnabled);
1186 if (!isMailNotificationEnabled) {
1187 $('mail_auth_checkbox').setProperty('checked', !isMailNotificationEnabled);
1188 updateMailAuthSettings();
1192 this.updateMailAuthSettings = function() {
1193 const isMailAuthEnabled = $('mail_auth_checkbox').getProperty('checked');
1194 $('mail_username_text').setProperty('disabled', !isMailAuthEnabled);
1195 $('mail_password_text').setProperty('disabled', !isMailAuthEnabled);
1198 this.updateAutoRun = function() {
1199 const isAutoRunEnabled = $('autorun_checkbox').getProperty('checked');
1200 $('autorunProg_txt').setProperty('disabled', !isAutoRunEnabled);
1203 // Connection tab
1204 this.updateMaxConnecEnabled = function() {
1205 const isMaxConnecEnabled = $('max_connec_checkbox').getProperty('checked');
1206 $('max_connec_value').setProperty('disabled', !isMaxConnecEnabled);
1209 this.updateMaxConnecPerTorrentEnabled = function() {
1210 const isMaxConnecPerTorrentEnabled = $('max_connec_per_torrent_checkbox').getProperty('checked');
1211 $('max_connec_per_torrent_value').setProperty('disabled', !isMaxConnecPerTorrentEnabled);
1214 this.updateMaxUploadsEnabled = function() {
1215 const isMaxUploadsEnabled = $('max_uploads_checkbox').getProperty('checked');
1216 $('max_uploads_value').setProperty('disabled', !isMaxUploadsEnabled);
1219 this.updateMaxUploadsPerTorrentEnabled = function() {
1220 const isMaxUploadsPerTorrentEnabled = $('max_uploads_per_torrent_checkbox').getProperty('checked');
1221 $('max_uploads_per_torrent_value').setProperty('disabled', !isMaxUploadsPerTorrentEnabled);
1224 this.updatePeerProxySettings = function() {
1225 const isPeerProxyTypeSelected = $('peer_proxy_type_select').getProperty('value') != "none";
1226 $('peer_proxy_host_text').setProperty('disabled', !isPeerProxyTypeSelected);
1227 $('peer_proxy_port_value').setProperty('disabled', !isPeerProxyTypeSelected);
1228 $('use_peer_proxy_checkbox').setProperty('disabled', !isPeerProxyTypeSelected);
1229 $('proxy_only_for_torrents_checkbox').setProperty('disabled', !isPeerProxyTypeSelected);
1231 if (isPeerProxyTypeSelected) {
1232 const isPeerProxyTypeSocks5 = $('peer_proxy_type_select').getProperty('value') == "socks5";
1233 $('peer_proxy_auth_checkbox').setProperty('disabled', !isPeerProxyTypeSocks5);
1235 if (!isPeerProxyTypeSocks5) {
1236 $('peer_proxy_auth_checkbox').setProperty('checked', isPeerProxyTypeSocks5);
1237 updatePeerProxyAuthSettings();
1240 else {
1241 $('peer_proxy_auth_checkbox').setProperty('disabled', !isPeerProxyTypeSelected);
1242 $('peer_proxy_auth_checkbox').setProperty('checked', isPeerProxyTypeSelected);
1243 updatePeerProxyAuthSettings();
1247 this.updatePeerProxyAuthSettings = function() {
1248 const isPeerProxyAuthEnabled = $('peer_proxy_auth_checkbox').getProperty('checked');
1249 $('peer_proxy_username_text').setProperty('disabled', !isPeerProxyAuthEnabled);
1250 $('peer_proxy_password_text').setProperty('disabled', !isPeerProxyAuthEnabled);
1253 this.updateFilterSettings = function() {
1254 const isIPFilterEnabled = $('ipfilter_enabled_checkbox').getProperty('checked');
1255 $('ipfilter_text').setProperty('disabled', !isIPFilterEnabled);
1256 $('ipfilter_trackers_checkbox').setProperty('disabled', !isIPFilterEnabled);
1257 $('banned_IPs_textarea').setProperty('disabled', !isIPFilterEnabled);
1260 // Speed tab
1261 this.updateSchedulingEnabled = function() {
1262 const isLimitSchedulingEnabled = $('limit_sheduling_checkbox').getProperty('checked');
1263 $('schedule_from_hour').setProperty('disabled', !isLimitSchedulingEnabled);
1264 $('schedule_from_min').setProperty('disabled', !isLimitSchedulingEnabled);
1265 $('schedule_to_hour').setProperty('disabled', !isLimitSchedulingEnabled);
1266 $('schedule_to_min').setProperty('disabled', !isLimitSchedulingEnabled);
1267 $('schedule_freq_select').setProperty('disabled', !isLimitSchedulingEnabled);
1270 // Bittorrent tab
1271 this.updateQueueingSystem = function() {
1272 const isQueueingEnabled = $('queueing_checkbox').getProperty('checked');
1273 $('max_active_dl_value').setProperty('disabled', !isQueueingEnabled);
1274 $('max_active_up_value').setProperty('disabled', !isQueueingEnabled);
1275 $('max_active_to_value').setProperty('disabled', !isQueueingEnabled);
1276 $('dont_count_slow_torrents_checkbox').setProperty('disabled', !isQueueingEnabled);
1277 updateSlowTorrentsSettings();
1280 this.updateSlowTorrentsSettings = function() {
1281 const isDontCountSlowTorrentsEnabled = (!$('dont_count_slow_torrents_checkbox').getProperty('disabled')) && $('dont_count_slow_torrents_checkbox').getProperty('checked');
1282 $('dl_rate_threshold').setProperty('disabled', !isDontCountSlowTorrentsEnabled);
1283 $('ul_rate_threshold').setProperty('disabled', !isDontCountSlowTorrentsEnabled);
1284 $('torrent_inactive_timer').setProperty('disabled', !isDontCountSlowTorrentsEnabled);
1287 this.updateMaxRatioTimeEnabled = function() {
1288 const isMaxRatioEnabled = $('max_ratio_checkbox').getProperty('checked');
1289 $('max_ratio_value').setProperty('disabled', !isMaxRatioEnabled);
1291 const isMaxSeedingTimeEnabled = $('max_seeding_time_checkbox').getProperty('checked');
1292 $('max_seeding_time_value').setProperty('disabled', !isMaxSeedingTimeEnabled);
1294 $('max_ratio_act').setProperty('disabled', !(isMaxRatioEnabled || isMaxSeedingTimeEnabled));
1297 this.updateAddTrackersEnabled = function() {
1298 const isAddTrackersEnabled = $('add_trackers_checkbox').getProperty('checked');
1299 $('add_trackers_textarea').setProperty('disabled', !isAddTrackersEnabled);
1302 // Web UI tab
1303 this.updateHttpsSettings = function() {
1304 const isUseHttpsEnabled = $('use_https_checkbox').getProperty('checked');
1305 $('ssl_cert_text').setProperty('disabled', !isUseHttpsEnabled);
1306 $('ssl_key_text').setProperty('disabled', !isUseHttpsEnabled);
1309 this.updateBypasssAuthSettings = function() {
1310 const isBypassAuthSubnetWhitelistEnabled = $('bypass_auth_subnet_whitelist_checkbox').getProperty('checked');
1311 $('bypass_auth_subnet_whitelist_textarea').setProperty('disabled', !isBypassAuthSubnetWhitelistEnabled);
1314 this.updateAlternativeWebUISettings = function() {
1315 const isUseAlternativeWebUIEnabled = $('use_alt_webui_checkbox').getProperty('checked');
1316 $('webui_files_location_textarea').setProperty('disabled', !isUseAlternativeWebUIEnabled);
1319 this.updateHostHeaderValidationSettings = function() {
1320 const isHostHeaderValidationEnabled = $('host_header_validation_checkbox').getProperty('checked');
1321 $('webui_domain_textarea').setProperty('disabled', !isHostHeaderValidationEnabled);
1324 this.updateDynDnsSettings = function() {
1325 const isDynDnsEnabled = $('use_dyndns_checkbox').getProperty('checked');
1326 $('dyndns_select').setProperty('disabled', !isDynDnsEnabled);
1327 $('dyndns_domain_text').setProperty('disabled', !isDynDnsEnabled);
1328 $('dyndns_username_text').setProperty('disabled', !isDynDnsEnabled);
1329 $('dyndns_password_text').setProperty('disabled', !isDynDnsEnabled);
1332 this.registerDynDns = function() {
1333 if ($('dyndns_select').getProperty('value').toInt() == 1) {
1334 window.open("http://www.no-ip.com/services/managed_dns/free_dynamic_dns.html", "NO-IP Registration");
1336 else {
1337 window.open("https://www.dyndns.com/account/services/hosts/add.html", "DynDNS Registration");
1341 this.generateRandomPort = function() {
1342 const min = 1024;
1343 const max = 65535;
1344 const port = Math.floor(Math.random() * (max - min + 1) + min);
1345 $('port_value').setProperty('value', port);
1348 this.time_padding = function(val) {
1349 let ret = val.toString();
1350 if (ret.length == 1)
1351 ret = '0' + ret;
1352 return ret;
1355 // Advanced Tab
1356 this.updateNetworkInterfaces = function(default_iface) {
1357 const url = 'api/v2/app/networkInterfaceList';
1358 $('networkInterface').empty();
1359 new Request.JSON({
1360 url: url,
1361 method: 'get',
1362 noCache: true,
1363 onFailure: function() {
1364 alert("Could not contact qBittorrent");
1366 onSuccess: function(ifaces) {
1367 if (!ifaces) return;
1369 $('networkInterface').options.add(new Option('QBT_TR(Any interface)QBT_TR[CONTEXT=OptionsDialog]', ''));
1370 ifaces.forEach(function(item, index) {
1371 $('networkInterface').options.add(new Option(item.name, item.value));
1373 $('networkInterface').setProperty('value', default_iface);
1375 }).send();
1378 this.updateInterfaceAddresses = function(iface, default_addr) {
1379 const url = 'api/v2/app/networkInterfaceAddressList';
1380 $('optionalIPAddressToBind').empty();
1381 new Request.JSON({
1382 url: url,
1383 method: 'get',
1384 noCache: true,
1385 data: {
1386 'iface': iface
1388 onFailure: function() {
1389 alert("Could not contact qBittorrent");
1391 onSuccess: function(addresses) {
1392 if (!addresses) return;
1394 $('optionalIPAddressToBind').options.add(new Option('QBT_TR(All addresses)QBT_TR[CONTEXT=OptionDialog]', ''));
1395 addresses.forEach(function(item, index) {
1396 $('optionalIPAddressToBind').options.add(new Option(item, item));
1398 $('optionalIPAddressToBind').setProperty('value', default_addr);
1400 }).send();
1403 this.loadPreferences = function() {
1404 const url = 'api/v2/app/preferences';
1405 new Request.JSON({
1406 url: url,
1407 method: 'get',
1408 noCache: true,
1409 onFailure: function() {
1410 alert("Could not contact qBittorrent");
1412 onSuccess: function(pref) {
1413 if (pref) {
1414 // Downloads tab
1415 // When adding a torrent
1416 $('createsubfolder_checkbox').setProperty('checked', pref.create_subfolder_enabled);
1417 $('dontstartdownloads_checkbox').setProperty('checked', pref.start_paused_enabled);
1418 $('deletetorrentfileafter_checkbox').setProperty('checked', pref.auto_delete_mode);
1420 $('preallocateall_checkbox').setProperty('checked', pref.preallocate_all);
1421 $('appendext_checkbox').setProperty('checked', pref.incomplete_files_ext);
1423 // Saving Managmenet
1424 $('default_tmm_combobox').setProperty('value', pref.auto_tmm_enabled);
1425 $('torrent_changed_tmm_combobox').setProperty('value', pref.torrent_changed_tmm_enabled);
1426 $('save_path_changed_tmm_combobox').setProperty('value', pref.save_path_changed_tmm_enabled);
1427 $('category_changed_tmm_combobox').setProperty('value', pref.category_changed_tmm_enabled);
1428 $('savepath_text').setProperty('value', pref.save_path);
1429 $('temppath_checkbox').setProperty('checked', pref.temp_path_enabled);
1430 $('temppath_text').setProperty('value', pref.temp_path);
1431 updateTempDirEnabled();
1432 if (pref.export_dir != '') {
1433 $('exportdir_checkbox').setProperty('checked', true);
1434 $('exportdir_text').setProperty('value', pref.export_dir);
1436 else {
1437 $('exportdir_checkbox').setProperty('checked', false);
1438 $('exportdir_text').setProperty('value', '');
1440 updateExportDirEnabled();
1441 if (pref.export_dir_fin != '') {
1442 $('exportdirfin_checkbox').setProperty('checked', true);
1443 $('exportdirfin_text').setProperty('value', pref.export_dir_fin);
1445 else {
1446 $('exportdirfin_checkbox').setProperty('checked', false);
1447 $('exportdirfin_text').setProperty('value', '');
1449 updateExportDirFinEnabled();
1451 // Automatically add torrents from
1452 let i = 0;
1453 for (const folder in pref.scan_dirs) {
1454 let sel;
1455 let other = "";
1456 if (typeof pref.scan_dirs[folder] == "string") {
1457 other = pref.scan_dirs[folder];
1458 sel = "other";
1460 else {
1461 sel = (pref.scan_dirs[folder] == 0) ? "watch_folder" : "default_folder";
1463 pushWatchFolder(i++, folder, sel, other);
1466 // Email notification upon download completion
1467 $('mail_notification_checkbox').setProperty('checked', pref.mail_notification_enabled);
1468 $('src_email_txt').setProperty('value', pref.mail_notification_sender);
1469 $('dest_email_txt').setProperty('value', pref.mail_notification_email);
1470 $('smtp_server_txt').setProperty('value', pref.mail_notification_smtp);
1471 $('mail_ssl_checkbox').setProperty('checked', pref.mail_notification_ssl_enabled);
1472 $('mail_auth_checkbox').setProperty('checked', pref.mail_notification_auth_enabled);
1473 $('mail_username_text').setProperty('value', pref.mail_notification_username);
1474 $('mail_password_text').setProperty('value', pref.mail_notification_password);
1475 updateMailNotification();
1476 updateMailAuthSettings();
1478 // Run an external program on torrent completion
1479 $('autorun_checkbox').setProperty('checked', pref.autorun_enabled);
1480 $('autorunProg_txt').setProperty('value', pref.autorun_program);
1481 updateAutoRun();
1483 // Connection tab
1484 // Listening Port
1485 $('port_value').setProperty('value', pref.listen_port.toInt());
1486 $('upnp_checkbox').setProperty('checked', pref.upnp);
1487 $('random_port_checkbox').setProperty('checked', pref.random_port);
1489 // Connections Limits
1490 const max_connec = pref.max_connec.toInt();
1491 if (max_connec <= 0) {
1492 $('max_connec_checkbox').setProperty('checked', false);
1493 $('max_connec_value').setProperty('value', 500);
1495 else {
1496 $('max_connec_checkbox').setProperty('checked', true);
1497 $('max_connec_value').setProperty('value', max_connec);
1499 updateMaxConnecEnabled();
1500 const max_connec_per_torrent = pref.max_connec_per_torrent.toInt();
1501 if (max_connec_per_torrent <= 0) {
1502 $('max_connec_per_torrent_checkbox').setProperty('checked', false);
1503 $('max_connec_per_torrent_value').setProperty('value', 100);
1505 else {
1506 $('max_connec_per_torrent_checkbox').setProperty('checked', true);
1507 $('max_connec_per_torrent_value').setProperty('value', max_connec_per_torrent);
1509 updateMaxConnecPerTorrentEnabled();
1510 const max_uploads = pref.max_uploads.toInt();
1511 if (max_uploads <= 0) {
1512 $('max_uploads_checkbox').setProperty('checked', false);
1513 $('max_uploads_value').setProperty('value', 8);
1515 else {
1516 $('max_uploads_checkbox').setProperty('checked', true);
1517 $('max_uploads_value').setProperty('value', max_uploads);
1519 updateMaxUploadsEnabled();
1520 const max_uploads_per_torrent = pref.max_uploads_per_torrent.toInt();
1521 if (max_uploads_per_torrent <= 0) {
1522 $('max_uploads_per_torrent_checkbox').setProperty('checked', false);
1523 $('max_uploads_per_torrent_value').setProperty('value', 4);
1525 else {
1526 $('max_uploads_per_torrent_checkbox').setProperty('checked', true);
1527 $('max_uploads_per_torrent_value').setProperty('value', max_uploads_per_torrent);
1529 updateMaxUploadsPerTorrentEnabled();
1531 // Proxy Server
1532 switch (pref.proxy_type.toInt()) {
1533 case 5: //SOCKS4
1534 $('peer_proxy_type_select').setProperty('value', 'socks4');
1535 break;
1536 case 2: // SOCKS5
1537 case 4: // SOCKS5_PW
1538 $('peer_proxy_type_select').setProperty('value', 'socks5');
1539 break;
1540 case 1: // HTTP
1541 case 3: // HTTP_PW
1542 $('peer_proxy_type_select').setProperty('value', 'http');
1543 break;
1544 default: // NONE
1545 $('peer_proxy_type_select').setProperty('value', 'none');
1547 updatePeerProxySettings();
1548 $('peer_proxy_host_text').setProperty('value', pref.proxy_ip);
1549 $('peer_proxy_port_value').setProperty('value', pref.proxy_port);
1550 $('use_peer_proxy_checkbox').setProperty('checked', pref.proxy_peer_connections);
1551 $('proxy_only_for_torrents_checkbox').setProperty('checked', pref.proxy_torrents_only);
1552 $('peer_proxy_auth_checkbox').setProperty('checked', pref.proxy_auth_enabled);
1553 updatePeerProxyAuthSettings();
1554 $('peer_proxy_username_text').setProperty('value', pref.proxy_username);
1555 $('peer_proxy_password_text').setProperty('value', pref.proxy_password);
1557 // IP Filtering
1558 $('ipfilter_enabled_checkbox').setProperty('checked', pref.ip_filter_enabled);
1559 $('ipfilter_text').setProperty('value', pref.ip_filter_path);
1560 $('ipfilter_trackers_checkbox').setProperty('checked', pref.ip_filter_trackers);
1561 $('banned_IPs_textarea').setProperty('value', pref.banned_IPs);
1562 updateFilterSettings();
1564 // Speed tab
1565 // Global Rate Limits
1566 $('up_limit_value').setProperty('value', (pref.up_limit.toInt() / 1024));
1567 $('dl_limit_value').setProperty('value', (pref.dl_limit.toInt() / 1024));
1568 // Alternative Global Rate Limits
1569 $('alt_up_limit_value').setProperty('value', (pref.alt_up_limit.toInt() / 1024));
1570 $('alt_dl_limit_value').setProperty('value', (pref.alt_dl_limit.toInt() / 1024));
1572 $('enable_protocol_combobox').setProperty('value', pref.bittorrent_protocol);
1573 $('limit_utp_rate_checkbox').setProperty('checked', pref.limit_utp_rate);
1574 $('limit_tcp_overhead_checkbox').setProperty('checked', pref.limit_tcp_overhead);
1575 $('limit_lan_peers_checkbox').setProperty('checked', pref.limit_lan_peers);
1577 // Scheduling
1578 $('limit_sheduling_checkbox').setProperty('checked', pref.scheduler_enabled);
1579 $('schedule_from_hour').setProperty('value', time_padding(pref.schedule_from_hour));
1580 $('schedule_from_min').setProperty('value', time_padding(pref.schedule_from_min));
1581 $('schedule_to_hour').setProperty('value', time_padding(pref.schedule_to_hour));
1582 $('schedule_to_min').setProperty('value', time_padding(pref.schedule_to_min));
1583 $('schedule_freq_select').setProperty('value', pref.scheduler_days);
1584 updateSchedulingEnabled();
1586 // Bittorrent tab
1587 // Privacy
1588 $('dht_checkbox').setProperty('checked', pref.dht);
1589 $('pex_checkbox').setProperty('checked', pref.pex);
1590 $('lsd_checkbox').setProperty('checked', pref.lsd);
1591 const encryption = pref.encryption.toInt();
1592 $('encryption_select').getChildren('option')[encryption].setAttribute('selected', '');
1593 $('anonymous_mode_checkbox').setProperty('checked', pref.anonymous_mode);
1595 // Torrent Queueing
1596 $('queueing_checkbox').setProperty('checked', pref.queueing_enabled);
1597 $('max_active_dl_value').setProperty('value', pref.max_active_downloads.toInt());
1598 $('max_active_up_value').setProperty('value', pref.max_active_uploads.toInt());
1599 $('max_active_to_value').setProperty('value', pref.max_active_torrents.toInt());
1600 $('dont_count_slow_torrents_checkbox').setProperty('checked', pref.dont_count_slow_torrents);
1601 $('dl_rate_threshold').setProperty('value', pref.slow_torrent_dl_rate_threshold.toInt());
1602 $('ul_rate_threshold').setProperty('value', pref.slow_torrent_ul_rate_threshold.toInt());
1603 $('torrent_inactive_timer').setProperty('value', pref.slow_torrent_inactive_timer.toInt());
1604 updateQueueingSystem();
1606 // Share Limiting
1607 $('max_ratio_checkbox').setProperty('checked', pref.max_ratio_enabled);
1608 if (pref.max_ratio_enabled)
1609 $('max_ratio_value').setProperty('value', pref.max_ratio);
1610 else
1611 $('max_ratio_value').setProperty('value', 1);
1612 $('max_seeding_time_checkbox').setProperty('checked', pref.max_seeding_time_enabled);
1613 if (pref.max_seeding_time_enabled)
1614 $('max_seeding_time_value').setProperty('value', pref.max_seeding_time.toInt());
1615 else
1616 $('max_seeding_time_value').setProperty('value', 1440);
1617 const max_ratio_act = pref.max_ratio_act.toInt();
1618 $('max_ratio_act').getChildren('option')[max_ratio_act].setAttribute('selected', '');
1619 updateMaxRatioTimeEnabled();
1621 // Add trackers
1622 $('add_trackers_checkbox').setProperty('checked', pref.add_trackers_enabled);
1623 $('add_trackers_textarea').setProperty('value', pref.add_trackers);
1624 updateAddTrackersEnabled();
1626 // Web UI tab
1627 // Language
1628 $('locale_select').setProperty('value', pref.locale);
1630 // HTTP Server
1631 $('webui_domain_textarea').setProperty('value', pref.web_ui_domain_list);
1632 $('webui_address_value').setProperty('value', pref.web_ui_address);
1633 $('webui_port_value').setProperty('value', pref.web_ui_port);
1634 $('webui_upnp_checkbox').setProperty('checked', pref.web_ui_upnp);
1635 $('use_https_checkbox').setProperty('checked', pref.use_https);
1636 $('ssl_cert_text').setProperty('value', pref.web_ui_https_cert_path);
1637 $('ssl_key_text').setProperty('value', pref.web_ui_https_key_path);
1638 updateHttpsSettings();
1640 // Authentication
1641 $('webui_username_text').setProperty('value', pref.web_ui_username);
1642 $('bypass_local_auth_checkbox').setProperty('checked', pref.bypass_local_auth);
1643 $('bypass_auth_subnet_whitelist_checkbox').setProperty('checked', pref.bypass_auth_subnet_whitelist_enabled);
1644 $('bypass_auth_subnet_whitelist_textarea').setProperty('value', pref.bypass_auth_subnet_whitelist);
1645 updateBypasssAuthSettings();
1646 $('webUISessionTimeoutInput').setProperty('value', pref.web_ui_session_timeout.toInt());
1648 // Use alternative Web UI
1649 $('use_alt_webui_checkbox').setProperty('checked', pref.alternative_webui_enabled);
1650 $('webui_files_location_textarea').setProperty('value', pref.alternative_webui_path);
1651 updateAlternativeWebUISettings();
1653 // Security
1654 $('clickjacking_protection_checkbox').setProperty('checked', pref.web_ui_clickjacking_protection_enabled);
1655 $('csrf_protection_checkbox').setProperty('checked', pref.web_ui_csrf_protection_enabled);
1656 $('host_header_validation_checkbox').setProperty('checked', pref.web_ui_host_header_validation_enabled);
1657 updateHostHeaderValidationSettings();
1659 // Update my dynamic domain name
1660 $('use_dyndns_checkbox').setProperty('checked', pref.dyndns_enabled);
1661 $('dyndns_select').setProperty('value', pref.dyndns_service);
1662 $('dyndns_domain_text').setProperty('value', pref.dyndns_domain);
1663 $('dyndns_username_text').setProperty('value', pref.dyndns_username);
1664 $('dyndns_password_text').setProperty('value', pref.dyndns_password);
1665 updateDynDnsSettings();
1667 // Advanced settings
1668 // qBittorrent section
1669 updateNetworkInterfaces(pref.current_network_interface);
1670 updateInterfaceAddresses(pref.current_network_interface, pref.current_interface_address);
1671 $('listenOnIPv6Address').setProperty('checked', pref.listen_on_ipv6_address);
1672 $('saveResumeDataInterval').setProperty('value', pref.save_resume_data_interval);
1673 $('recheckTorrentsOnCompletion').setProperty('checked', pref.recheck_completed_torrents);
1674 $('resolvePeerCountries').setProperty('checked', pref.resolve_peer_countries);
1675 // libtorrent section
1676 $('asyncIOThreads').setProperty('value', pref.async_io_threads);
1677 $('filePoolSize').setProperty('value', pref.file_pool_size);
1678 $('outstandMemoryWhenCheckingTorrents').setProperty('value', pref.checking_memory_use);
1679 $('diskCache').setProperty('value', pref.disk_cache);
1680 $('diskCacheExpiryInterval').setProperty('value', pref.disk_cache_ttl);
1681 $('enableOSCache').setProperty('checked', pref.enable_os_cache);
1682 $('coalesceReadsAndWrites').setProperty('checked', pref.enable_coalesce_read_write);
1683 $('sendUploadPieceSuggestions').setProperty('checked', pref.enable_upload_suggestions);
1684 $('sendBufferWatermark').setProperty('value', pref.send_buffer_watermark);
1685 $('sendBufferLowWatermark').setProperty('value', pref.send_buffer_low_watermark);
1686 $('sendBufferWatermarkFactor').setProperty('value', pref.send_buffer_watermark_factor);
1687 $('socketBacklogSize').setProperty('value', pref.socket_backlog_size);
1688 $('outgoingPortsMin').setProperty('value', pref.outgoing_ports_min);
1689 $('outgoingPortsMax').setProperty('value', pref.outgoing_ports_max);
1690 $('utpTCPMixedModeAlgorithm').setProperty('value', pref.utp_tcp_mixed_mode);
1691 $('allowMultipleConnectionsFromTheSameIPAddress').setProperty('checked', pref.enable_multi_connections_from_same_ip);
1692 $('enableEmbeddedTracker').setProperty('checked', pref.enable_embedded_tracker);
1693 $('embeddedTrackerPort').setProperty('value', pref.embedded_tracker_port);
1694 $('uploadSlotsBehavior').setProperty('value', pref.upload_slots_behavior);
1695 $('uploadChokingAlgorithm').setProperty('value', pref.upload_choking_algorithm);
1696 $('strictSuperSeeding').setProperty('checked', pref.enable_super_seeding);
1697 $('announceAllTrackers').setProperty('checked', pref.announce_to_all_trackers);
1698 $('announceAllTiers').setProperty('checked', pref.announce_to_all_tiers);
1699 $('announceIP').setProperty('value', pref.announce_ip);
1702 }).send();
1705 this.applyPreferences = function() {
1706 const settings = new Hash();
1707 // Validate form data
1708 // Downloads tab
1709 // When adding a torrent
1710 settings.set('create_subfolder_enabled', $('createsubfolder_checkbox').getProperty('checked'));
1711 settings.set('start_paused_enabled', $('dontstartdownloads_checkbox').getProperty('checked'));
1712 settings.set('auto_delete_mode', $('deletetorrentfileafter_checkbox').getProperty('checked'));
1714 settings.set('preallocate_all', $('preallocateall_checkbox').getProperty('checked'));
1715 settings.set('incomplete_files_ext', $('appendext_checkbox').getProperty('checked'));
1717 // Saving Management
1718 settings.set('auto_tmm_enabled', $('default_tmm_combobox').getProperty('value'));
1719 settings.set('torrent_changed_tmm_enabled', $('torrent_changed_tmm_combobox').getProperty('value'));
1720 settings.set('save_path_changed_tmm_enabled', $('save_path_changed_tmm_combobox').getProperty('value'));
1721 settings.set('category_changed_tmm_enabled', $('category_changed_tmm_combobox').getProperty('value'));
1722 settings.set('save_path', $('savepath_text').getProperty('value'));
1723 settings.set('temp_path_enabled', $('temppath_checkbox').getProperty('checked'));
1724 settings.set('temp_path', $('temppath_text').getProperty('value'));
1725 if ($('exportdir_checkbox').getProperty('checked'))
1726 settings.set('export_dir', $('exportdir_text').getProperty('value'));
1727 else
1728 settings.set('export_dir', '');
1729 if ($('exportdirfin_checkbox').getProperty('checked'))
1730 settings.set('export_dir_fin', $('exportdirfin_text').getProperty('value'));
1731 else
1732 settings.set('export_dir_fin', '');
1734 // Automatically add torrents from
1735 settings.set('scan_dirs', getWatchedFolders());
1737 // Email notification upon download completion
1738 settings.set('mail_notification_enabled', $('mail_notification_checkbox').getProperty('checked'));
1739 settings.set('mail_notification_sender', $('src_email_txt').getProperty('value'));
1740 settings.set('mail_notification_email', $('dest_email_txt').getProperty('value'));
1741 settings.set('mail_notification_smtp', $('smtp_server_txt').getProperty('value'));
1742 settings.set('mail_notification_ssl_enabled', $('mail_ssl_checkbox').getProperty('checked'));
1743 settings.set('mail_notification_auth_enabled', $('mail_auth_checkbox').getProperty('checked'));
1744 settings.set('mail_notification_username', $('mail_username_text').getProperty('value'));
1745 settings.set('mail_notification_password', $('mail_password_text').getProperty('value'));
1747 // Run an external program on torrent completion
1748 settings.set('autorun_enabled', $('autorun_checkbox').getProperty('checked'));
1749 settings.set('autorun_program', $('autorunProg_txt').getProperty('value'));
1751 // Connection tab
1752 // Listening Port
1753 const listen_port = $('port_value').getProperty('value').toInt();
1754 if (isNaN(listen_port) || listen_port < 1 || listen_port > 65535) {
1755 alert("QBT_TR(The port used for incoming connections must be between 1 and 65535.)QBT_TR[CONTEXT=HttpServer]");
1756 return;
1758 settings.set('listen_port', listen_port);
1759 settings.set('upnp', $('upnp_checkbox').getProperty('checked'));
1760 settings.set('random_port', $('random_port_checkbox').getProperty('checked'));
1762 // Connections Limits
1763 let max_connec = -1;
1764 if ($('max_connec_checkbox').getProperty('checked')) {
1765 max_connec = $('max_connec_value').getProperty('value').toInt();
1766 if (isNaN(max_connec) || max_connec <= 0) {
1767 alert("QBT_TR(Maximum number of connections limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
1768 return;
1771 settings.set('max_connec', max_connec);
1772 let max_connec_per_torrent = -1;
1773 if ($('max_connec_per_torrent_checkbox').getProperty('checked')) {
1774 max_connec_per_torrent = $('max_connec_per_torrent_value').getProperty('value').toInt();
1775 if (isNaN(max_connec_per_torrent) || max_connec_per_torrent <= 0) {
1776 alert("QBT_TR(Maximum number of connections per torrent limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
1777 return;
1780 settings.set('max_connec_per_torrent', max_connec_per_torrent);
1781 let max_uploads = -1;
1782 if ($('max_uploads_checkbox').getProperty('checked')) {
1783 max_uploads = $('max_uploads_value').getProperty('value').toInt();
1784 if (isNaN(max_uploads) || max_uploads <= 0) {
1785 alert("QBT_TR(Global number of upload slots limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
1786 return;
1789 settings.set('max_uploads', max_uploads);
1790 let max_uploads_per_torrent = -1;
1791 if ($('max_uploads_per_torrent_checkbox').getProperty('checked')) {
1792 max_uploads_per_torrent = $('max_uploads_per_torrent_value').getProperty('value').toInt();
1793 if (isNaN(max_uploads_per_torrent) || max_uploads_per_torrent <= 0) {
1794 alert("QBT_TR(Maximum number of upload slots per torrent limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
1795 return;
1798 settings.set('max_uploads_per_torrent', max_uploads_per_torrent);
1800 // Proxy Server
1801 const proxy_type_str = $('peer_proxy_type_select').getProperty('value');
1802 let proxy_type = 0;
1803 let proxy_auth_enabled = false;
1804 if (proxy_type_str == "socks5") {
1805 if ($('peer_proxy_auth_checkbox').getProperty('checked')) {
1806 proxy_type = 4;
1807 proxy_auth_enabled = true;
1809 else {
1810 proxy_type = 2;
1813 else {
1814 if (proxy_type_str == "socks4") {
1815 proxy_type = 5;
1817 else {
1818 if (proxy_type_str == "http") {
1819 if ($('peer_proxy_auth_checkbox').getProperty('checked')) {
1820 proxy_type = 3;
1821 proxy_auth_enabled = true;
1823 else {
1824 proxy_type = 1;
1829 settings.set('proxy_type', proxy_type);
1830 settings.set('proxy_auth_enabled', proxy_auth_enabled);
1831 settings.set('proxy_ip', $('peer_proxy_host_text').getProperty('value'));
1832 settings.set('proxy_port', $('peer_proxy_port_value').getProperty('value').toInt());
1833 settings.set('proxy_peer_connections', $('use_peer_proxy_checkbox').getProperty('checked'));
1834 settings.set('proxy_torrents_only', $('proxy_only_for_torrents_checkbox').getProperty('checked'));
1835 settings.set('proxy_username', $('peer_proxy_username_text').getProperty('value'));
1836 settings.set('proxy_password', $('peer_proxy_password_text').getProperty('value'));
1838 // IP Filtering
1839 settings.set('ip_filter_enabled', $('ipfilter_enabled_checkbox').getProperty('checked'));
1840 settings.set('ip_filter_path', $('ipfilter_text').getProperty('value'));
1841 settings.set('ip_filter_trackers', $('ipfilter_trackers_checkbox').getProperty('checked'));
1842 settings.set('banned_IPs', $('banned_IPs_textarea').getProperty('value'));
1844 // Speed tab
1845 // Global Rate Limits
1846 const up_limit = $('up_limit_value').getProperty('value').toInt() * 1024;
1847 if (isNaN(up_limit) || up_limit < 0) {
1848 alert("QBT_TR(Global upload rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
1849 return;
1851 settings.set('up_limit', up_limit);
1853 const dl_limit = $('dl_limit_value').getProperty('value').toInt() * 1024;
1854 if (isNaN(dl_limit) || dl_limit < 0) {
1855 alert("QBT_TR(Global download rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
1856 return;
1858 settings.set('dl_limit', dl_limit);
1860 // Alternative Global Rate Limits
1861 const alt_up_limit = $('alt_up_limit_value').getProperty('value').toInt() * 1024;
1862 if (isNaN(alt_up_limit) || alt_up_limit < 0) {
1863 alert("QBT_TR(Alternative upload rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
1864 return;
1866 settings.set('alt_up_limit', alt_up_limit);
1868 const alt_dl_limit = $('alt_dl_limit_value').getProperty('value').toInt() * 1024;
1869 if (isNaN(alt_dl_limit) || alt_dl_limit < 0) {
1870 alert("QBT_TR(Alternative download rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
1871 return;
1873 settings.set('alt_dl_limit', alt_dl_limit);
1875 settings.set('bittorrent_protocol', $('enable_protocol_combobox').getProperty('value'));
1876 settings.set('limit_utp_rate', $('limit_utp_rate_checkbox').getProperty('checked'));
1877 settings.set('limit_tcp_overhead', $('limit_tcp_overhead_checkbox').getProperty('checked'));
1878 settings.set('limit_lan_peers', $('limit_lan_peers_checkbox').getProperty('checked'));
1880 // Scheduler
1881 const scheduling_enabled = $('limit_sheduling_checkbox').getProperty('checked');
1882 settings.set('scheduler_enabled', scheduling_enabled);
1883 if (scheduling_enabled) {
1884 settings.set('schedule_from_hour', $('schedule_from_hour').getProperty('value').toInt());
1885 settings.set('schedule_from_min', $('schedule_from_min').getProperty('value').toInt());
1886 settings.set('schedule_to_hour', $('schedule_to_hour').getProperty('value').toInt());
1887 settings.set('schedule_to_min', $('schedule_to_min').getProperty('value').toInt());
1888 settings.set('scheduler_days', $('schedule_freq_select').getProperty('value').toInt());
1891 // Bittorrent tab
1892 // Privacy
1893 settings.set('dht', $('dht_checkbox').getProperty('checked'));
1894 settings.set('pex', $('pex_checkbox').getProperty('checked'));
1895 settings.set('lsd', $('lsd_checkbox').getProperty('checked'));
1896 settings.set('encryption', $('encryption_select').getSelected()[0].getProperty('value'));
1897 settings.set('anonymous_mode', $('anonymous_mode_checkbox').getProperty('checked'));
1899 // Torrent Queueing
1900 settings.set('queueing_enabled', $('queueing_checkbox').getProperty('checked'));
1901 if ($('queueing_checkbox').getProperty('checked')) {
1902 const max_active_downloads = $('max_active_dl_value').getProperty('value').toInt();
1903 if (isNaN(max_active_downloads) || max_active_downloads < -1) {
1904 alert("QBT_TR(Maximum active downloads must be greater than -1.)QBT_TR[CONTEXT=HttpServer]");
1905 return;
1907 settings.set('max_active_downloads', max_active_downloads);
1908 const max_active_uploads = $('max_active_up_value').getProperty('value').toInt();
1909 if (isNaN(max_active_uploads) || max_active_uploads < -1) {
1910 alert("QBT_TR(Maximum active uploads must be greater than -1.)QBT_TR[CONTEXT=HttpServer]");
1911 return;
1913 settings.set('max_active_uploads', max_active_uploads);
1914 const max_active_torrents = $('max_active_to_value').getProperty('value').toInt();
1915 if (isNaN(max_active_torrents) || max_active_torrents < -1) {
1916 alert("QBT_TR(Maximum active torrents must be greater than -1.)QBT_TR[CONTEXT=HttpServer]");
1917 return;
1919 settings.set('max_active_torrents', max_active_torrents);
1920 settings.set('dont_count_slow_torrents', $('dont_count_slow_torrents_checkbox').getProperty('checked'));
1921 const dl_rate_threshold = $('dl_rate_threshold').getProperty('value').toInt();
1922 if (isNaN(dl_rate_threshold) || (dl_rate_threshold < 1)) {
1923 alert("QBT_TR(Download rate threshold must be greater than 0.)QBT_TR[CONTEXT=HttpServer]");
1924 return;
1926 settings.set('slow_torrent_dl_rate_threshold', dl_rate_threshold);
1927 const ul_rate_threshold = $('ul_rate_threshold').getProperty('value').toInt();
1928 if (isNaN(ul_rate_threshold) || (ul_rate_threshold < 1)) {
1929 alert("QBT_TR(Upload rate threshold must be greater than 0.)QBT_TR[CONTEXT=HttpServer]");
1930 return;
1932 settings.set('slow_torrent_ul_rate_threshold', ul_rate_threshold);
1933 const torrent_inactive_timer = $('torrent_inactive_timer').getProperty('value').toInt();
1934 if (isNaN(torrent_inactive_timer) || (torrent_inactive_timer < 1)) {
1935 alert("QBT_TR(Torrent inactivity timer must be greater than 0.)QBT_TR[CONTEXT=HttpServer]");
1936 return;
1938 settings.set('slow_torrent_inactive_timer', torrent_inactive_timer);
1941 // Share Ratio Limiting
1942 let max_ratio = -1;
1943 if ($('max_ratio_checkbox').getProperty('checked')) {
1944 max_ratio = $('max_ratio_value').getProperty('value');
1945 if (isNaN(max_ratio) || max_ratio < 0 || max_ratio > 9998) {
1946 alert("QBT_TR(Share ratio limit must be between 0 and 9998.)QBT_TR[CONTEXT=HttpServer]");
1947 return;
1950 settings.set('max_ratio_enabled', $('max_ratio_checkbox').getProperty('checked'));
1951 settings.set('max_ratio', max_ratio);
1952 settings.set('max_ratio_act', $('max_ratio_act').getProperty('value').toInt());
1954 let max_seeding_time = -1;
1955 if ($('max_seeding_time_checkbox').getProperty('checked')) {
1956 max_seeding_time = $('max_seeding_time_value').getProperty('value').toInt();
1957 if (isNaN(max_seeding_time) || max_seeding_time < 0 || max_seeding_time > 525600) {
1958 alert("QBT_TR(Seeding time limit must be between 0 and 525600 minutes.)QBT_TR[CONTEXT=HttpServer]");
1959 return;
1962 settings.set('max_seeding_time_enabled', $('max_seeding_time_checkbox').getProperty('checked'));
1963 settings.set('max_seeding_time', max_seeding_time);
1964 settings.set('max_ratio_act', $('max_ratio_act').getProperty('value').toInt());
1966 // Add trackers
1967 settings.set('add_trackers_enabled', $('add_trackers_checkbox').getProperty('checked'));
1968 settings.set('add_trackers', $('add_trackers_textarea').getProperty('value'));
1970 // Web UI tab
1971 // Language
1972 settings.set('locale', $('locale_select').getProperty('value'));
1974 // HTTP Server
1975 settings.set('web_ui_domain_list', $('webui_domain_textarea').getProperty('value'));
1976 const web_ui_address = $('webui_address_value').getProperty('value').toString();
1977 const web_ui_port = $('webui_port_value').getProperty('value').toInt();
1978 if (isNaN(web_ui_port) || web_ui_port < 1 || web_ui_port > 65535) {
1979 alert("QBT_TR(The port used for the Web UI must be between 1 and 65535.)QBT_TR[CONTEXT=HttpServer]");
1980 return;
1982 settings.set('web_ui_address', web_ui_address);
1983 settings.set('web_ui_port', web_ui_port);
1984 settings.set('web_ui_upnp', $('webui_upnp_checkbox').getProperty('checked'));
1985 settings.set('use_https', $('use_https_checkbox').getProperty('checked'));
1986 settings.set('web_ui_https_cert_path', $('ssl_cert_text').getProperty('value'));
1987 settings.set('web_ui_https_key_path', $('ssl_key_text').getProperty('value'));
1989 // Authentication
1990 const web_ui_username = $('webui_username_text').getProperty('value');
1991 if (web_ui_username.length < 3) {
1992 alert("QBT_TR(The Web UI username must be at least 3 characters long.)QBT_TR[CONTEXT=OptionsDialog]");
1993 return;
1995 const web_ui_password = $('webui_password_text').getProperty('value');
1996 if ((0 < web_ui_password.length) && (web_ui_password.length < 6)) {
1997 alert("QBT_TR(The Web UI password must be at least 6 characters long.)QBT_TR[CONTEXT=OptionsDialog]");
1998 return;
2001 settings.set('web_ui_username', web_ui_username);
2002 if (web_ui_password.length > 0)
2003 settings.set('web_ui_password', web_ui_password);
2004 settings.set('bypass_local_auth', $('bypass_local_auth_checkbox').getProperty('checked'));
2005 settings.set('bypass_auth_subnet_whitelist_enabled', $('bypass_auth_subnet_whitelist_checkbox').getProperty('checked'));
2006 settings.set('bypass_auth_subnet_whitelist', $('bypass_auth_subnet_whitelist_textarea').getProperty('value'));
2007 settings.set('web_ui_session_timeout', $('webUISessionTimeoutInput').getProperty('value'));
2009 // Use alternative Web UI
2010 const alternative_webui_enabled = $('use_alt_webui_checkbox').getProperty('checked');
2011 const webui_files_location_textarea = $('webui_files_location_textarea').getProperty('value');
2012 if (alternative_webui_enabled && (webui_files_location_textarea.trim() === "")) {
2013 alert("QBT_TR(The alternative Web UI files location cannot be blank.)QBT_TR[CONTEXT=OptionsDialog]");
2014 return;
2016 settings.set('alternative_webui_enabled', alternative_webui_enabled);
2017 settings.set('alternative_webui_path', webui_files_location_textarea);
2019 settings.set('web_ui_clickjacking_protection_enabled', $('clickjacking_protection_checkbox').getProperty('checked'));
2020 settings.set('web_ui_csrf_protection_enabled', $('csrf_protection_checkbox').getProperty('checked'));
2021 settings.set('web_ui_host_header_validation_enabled', $('host_header_validation_checkbox').getProperty('checked'));
2023 // Update my dynamic domain name
2024 settings.set('dyndns_enabled', $('use_dyndns_checkbox').getProperty('checked'));
2025 settings.set('dyndns_service', $('dyndns_select').getProperty('value'));
2026 settings.set('dyndns_domain', $('dyndns_domain_text').getProperty('value'));
2027 settings.set('dyndns_username', $('dyndns_username_text').getProperty('value'));
2028 settings.set('dyndns_password', $('dyndns_password_text').getProperty('value'));
2030 // Update advanced settings
2031 // qBittorrent section
2032 settings.set('current_network_interface', $('networkInterface').getProperty('value'));
2033 settings.set('current_interface_address', $('optionalIPAddressToBind').getProperty('value'));
2034 settings.set('listen_on_ipv6_address', $('listenOnIPv6Address').getProperty('checked'));
2035 settings.set('save_resume_data_interval', $('saveResumeDataInterval').getProperty('value'));
2036 settings.set('recheck_completed_torrents', $('recheckTorrentsOnCompletion').getProperty('checked'));
2037 settings.set('resolve_peer_countries', $('resolvePeerCountries').getProperty('checked'));
2039 // libtorrent section
2040 settings.set('async_io_threads', $('asyncIOThreads').getProperty('value'));
2041 settings.set('file_pool_size', $('filePoolSize').getProperty('value'));
2042 settings.set('checking_memory_use', $('outstandMemoryWhenCheckingTorrents').getProperty('value'));
2043 settings.set('disk_cache', $('diskCache').getProperty('value'));
2044 settings.set('disk_cache_ttl', $('diskCacheExpiryInterval').getProperty('value'));
2045 settings.set('enable_os_cache', $('enableOSCache').getProperty('checked'));
2046 settings.set('enable_coalesce_read_write', $('coalesceReadsAndWrites').getProperty('checked'));
2047 settings.set('enable_upload_suggestions', $('sendUploadPieceSuggestions').getProperty('checked'));
2048 settings.set('send_buffer_watermark', $('sendBufferWatermark').getProperty('value'));
2049 settings.set('send_buffer_low_watermark', $('sendBufferLowWatermark').getProperty('value'));
2050 settings.set('send_buffer_watermark_factor', $('sendBufferWatermarkFactor').getProperty('value'));
2051 settings.set('socket_backlog_size', $('socketBacklogSize').getProperty('value'));
2052 settings.set('outgoing_ports_min', $('outgoingPortsMin').getProperty('value'));
2053 settings.set('outgoing_ports_max', $('outgoingPortsMax').getProperty('value'));
2054 settings.set('utp_tcp_mixed_mode', $('utpTCPMixedModeAlgorithm').getProperty('value'));
2055 settings.set('enable_multi_connections_from_same_ip', $('allowMultipleConnectionsFromTheSameIPAddress').getProperty('checked'));
2056 settings.set('enable_embedded_tracker', $('enableEmbeddedTracker').getProperty('checked'));
2057 settings.set('embedded_tracker_port', $('embeddedTrackerPort').getProperty('value'));
2058 settings.set('upload_slots_behavior', $('uploadSlotsBehavior').getProperty('value'));
2059 settings.set('upload_choking_algorithm', $('uploadChokingAlgorithm').getProperty('value'));
2060 settings.set('enable_super_seeding', $('strictSuperSeeding').getProperty('checked'));
2061 settings.set('announce_to_all_trackers', $('announceAllTrackers').getProperty('checked'));
2062 settings.set('announce_to_all_tiers', $('announceAllTiers').getProperty('checked'));
2063 settings.set('announce_ip', $('announceIP').getProperty('value'));
2065 // Send it to qBT
2066 const json_str = JSON.encode(settings);
2068 new Request({
2069 url: 'api/v2/app/setPreferences',
2070 method: 'post',
2071 data: {
2072 'json': json_str,
2074 onFailure: function() {
2075 alert("QBT_TR(Unable to save program preferences, qBittorrent is probably unreachable.)QBT_TR[CONTEXT=HttpServer]");
2076 window.parent.closeWindows();
2078 onSuccess: function() {
2079 // Close window
2080 window.parent.location.reload();
2081 window.parent.closeWindows();
2083 }).send();
2086 $('networkInterface').addEvent('change', function() {
2087 updateInterfaceAddresses($(this).getProperty('value'), '');
2090 loadPreferences();
2091 </script>