WebUI: migrate to fetch API
[qBittorrent.git] / src / webui / www / private / upload.html
blobd7a065a26a645e034eab120c91cc49dbefa74b25
1 <!DOCTYPE html>
2 <html lang="${LANG}" class="dark">
4 <head>
5 <meta charset="UTF-8">
6 <title>QBT_TR(Upload local torrent)QBT_TR[CONTEXT=HttpServer]</title>
7 <link rel="stylesheet" href="css/style.css?v=${CACHEID}" type="text/css">
8 <link rel="stylesheet" href="css/Window.css?v=${CACHEID}" type="text/css">
9 <script src="scripts/lib/MooTools-Core-1.6.0-compat-compressed.js"></script>
10 <script src="scripts/localpreferences.js?v=${CACHEID}"></script>
11 <script src="scripts/color-scheme.js?v=${CACHEID}"></script>
12 <script src="scripts/download.js?v=${CACHEID}"></script>
13 <script src="scripts/pathAutofill.js?v=${CACHEID}"></script>
14 </head>
16 <body>
17 <iframe id="upload_frame" name="upload_frame" class="invisible" title="" src="about:blank"></iframe>
18 <form action="api/v2/torrents/add" enctype="multipart/form-data" method="post" id="uploadForm" style="text-align: center;" target="upload_frame" autocorrect="off" autocapitalize="none">
19 <div style="margin-top: 25px; display: inline-block; border: 1px solid lightgrey; border-radius: 4px;">
20 <input type="file" id="fileselect" accept=".torrent, application/x-bittorrent" name="fileselect[]" multiple aria-label="QBT_TR(Select .torrent files)QBT_TR[CONTEXT=AddNewTorrentDialog]">
21 </div>
22 <fieldset class="settings" style="border: 0; text-align: left; margin-top: 12px;">
23 <legend>QBT_TR(Torrent options)QBT_TR[CONTEXT=AddNewTorrentDialog]</legend>
24 <table style="margin: auto;">
25 <tbody>
26 <tr>
27 <td>
28 <label for="autoTMM">QBT_TR(Torrent Management Mode:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
29 </td>
30 <td>
31 <select id="autoTMM" name="autoTMM" onchange="qBittorrent.Download.changeTMM(this)">
32 <option selected value="false">QBT_TR(Manual)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
33 <option value="true">QBT_TR(Automatic)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
34 </select>
35 </td>
36 </tr>
37 <tr>
38 <td>
39 <label for="savepath">QBT_TR(Save files to location:)QBT_TR[CONTEXT=HttpServer]</label>
40 </td>
41 <td>
42 <input type="text" id="savepath" name="savepath" class="pathDirectory" style="width: 16em;">
43 </td>
44 </tr>
45 <tr>
46 <td>
47 <label for="rename">QBT_TR(Rename torrent)QBT_TR[CONTEXT=HttpServer]</label>
48 </td>
49 <td>
50 <input type="text" id="rename" name="rename" style="width: 16em;">
51 </td>
52 </tr>
53 <tr>
54 <td>
55 <label id="categoryLabel" for="categorySelect">QBT_TR(Category:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
56 </td>
57 <td>
58 <div class="select-watched-folder-editable">
59 <select id="categorySelect" onchange="qBittorrent.Download.changeCategorySelect(this)">
60 <option selected value="\other"></option>
61 </select>
62 <input type="text" name="category" aria-labelledby="categoryLabel">
63 </div>
64 </td>
65 </tr>
66 <tr>
67 <td>
68 <label for="startTorrent">QBT_TR(Start torrent)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
69 </td>
70 <td>
71 <input type="hidden" id="startTorrentHidden" name="stopped">
72 <input type="checkbox" id="startTorrent">
73 </td>
74 </tr>
75 <tr>
76 <td>
77 <label for="addToTopOfQueue">QBT_TR(Add to top of queue)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
78 </td>
79 <td>
80 <input type="checkbox" id="addToTopOfQueue" name="addToTopOfQueue" value="true">
81 </td>
82 </tr>
83 <tr>
84 <td>
85 <label for="stopCondition">QBT_TR(Stop condition:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
86 </td>
87 <td>
88 <select id="stopCondition" name="stopCondition">
89 <option selected value="None">QBT_TR(None)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
90 <option value="MetadataReceived">QBT_TR(Metadata received)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
91 <option value="FilesChecked">QBT_TR(Files checked)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
92 </select>
93 </td>
94 </tr>
95 <tr>
96 <td>
97 <label for="skip_checking">QBT_TR(Skip hash check)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
98 </td>
99 <td>
100 <input type="checkbox" id="skip_checking" name="skip_checking" value="true">
101 </td>
102 </tr>
103 <tr>
104 <td>
105 <label for="contentLayout">QBT_TR(Content layout:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
106 </td>
107 <td>
108 <select id="contentLayout" name="contentLayout">
109 <option selected value="Original">QBT_TR(Original)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
110 <option value="Subfolder">QBT_TR(Create subfolder)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
111 <option value="NoSubfolder">QBT_TR(Don't create subfolder)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
112 </select>
113 </td>
114 </tr>
115 <tr>
116 <td>
117 <label for="sequentialDownload">QBT_TR(Download in sequential order)QBT_TR[CONTEXT=TransferListWidget]</label>
118 </td>
119 <td>
120 <input type="checkbox" id="sequentialDownload" name="sequentialDownload" value="true">
121 </td>
122 </tr>
123 <tr>
124 <td>
125 <label for="firstLastPiecePrio">QBT_TR(Download first and last pieces first)QBT_TR[CONTEXT=TransferListWidget]</label>
126 </td>
127 <td>
128 <input type="checkbox" id="firstLastPiecePrio" name="firstLastPiecePrio" value="true">
129 </td>
130 </tr>
131 <tr>
132 <td>
133 <label for="dlLimitText">QBT_TR(Limit download rate)QBT_TR[CONTEXT=HttpServer]</label>
134 </td>
135 <td>
136 <input type="hidden" id="dlLimitHidden" name="dlLimit">
137 <input type="text" id="dlLimitText" style="width: 16em;" placeholder="KiB/s">
138 </td>
139 </tr>
140 <tr>
141 <td>
142 <label for="upLimitText">QBT_TR(Limit upload rate)QBT_TR[CONTEXT=HttpServer]</label>
143 </td>
144 <td>
145 <input type="hidden" id="upLimitHidden" name="upLimit">
146 <input type="text" id="upLimitText" style="width: 16em;" placeholder="KiB/s">
147 </td>
148 </tr>
149 </tbody>
150 </table>
151 <div id="submitbutton" style="margin-top: 30px; text-align: center;">
152 <button type="submit" style="font-size: 1em;">QBT_TR(Upload Torrents)QBT_TR[CONTEXT=HttpServer]</button>
153 </div>
154 </fieldset>
155 </form>
156 <div id="upload_spinner" class="mochaSpinner"></div>
158 <script>
159 "use strict";
161 let submitted = false;
163 $("uploadForm").addEventListener("submit", () => {
164 $("startTorrentHidden").value = $("startTorrent").checked ? "false" : "true";
166 $("dlLimitHidden").value = Number($("dlLimitText").value) * 1024;
167 $("upLimitHidden").value = Number($("upLimitText").value) * 1024;
169 $("upload_spinner").style.display = "block";
170 submitted = true;
173 $("upload_frame").addEventListener("load", () => {
174 if (submitted)
175 window.parent.qBittorrent.Client.closeFrameWindow(window);
178 if ((Browser.platform === "ios") || ((Browser.platform === "mac") && (navigator.maxTouchPoints > 1)))
179 $("fileselect").accept = ".torrent";
181 window.qBittorrent.pathAutofill.attachPathAutofill();
182 </script>
183 </body>
185 </html>