Display External IP Address in status bar
[qBittorrent.git] / src / webui / www / private / views / confirmRecheck.html
blobb8421e77f762e948d58c88aa1972b54449cc015c
1 <div id="confirmRecheckDialog">
2 <div class="genericConfirmGrid">
3 <span class="confirmGridItem confirmWarning"></span>
4 <span class="confirmGridItem dialogMessage" id="confirmRecheckMessage"></span>
5 </div>
6 </div>
7 <div>
8 <input type="button" value="QBT_TR(Yes)QBT_TR[CONTEXT=MainWindow]" id="confirmRecheckButton">
9 <input type="button" value="QBT_TR(No)QBT_TR[CONTEXT=MainWindow]" id="cancelRecheckButton">
10 </div>
12 <script>
13 "use strict";
15 (() => {
16 const confirmButton = document.getElementById("confirmRecheckButton");
17 const cancelButton = document.getElementById("cancelRecheckButton");
18 const confirmText = document.getElementById("confirmRecheckMessage");
20 const {
21 options: { data: { hashes } },
22 windowEl
23 } = window.MUI.Windows.instances["confirmRecheckDialog"];
25 confirmText.textContent = "QBT_TR(Are you sure you want to recheck the selected torrent(s)?)QBT_TR[CONTEXT=confirmRecheckDialog]";
27 cancelButton.addEventListener("click", (e) => { window.qBittorrent.Client.closeWindow("confirmRecheckDialog"); });
28 confirmButton.addEventListener("click", (e) => {
29 new Request({
30 url: "api/v2/torrents/recheck",
31 method: "post",
32 data: {
33 hashes: hashes.join("|"),
35 onSuccess: () => {
36 updateMainData();
37 window.qBittorrent.Client.closeWindow("confirmRecheckDialog");
39 onFailure: () => {
40 alert("QBT_TR(Unable to recheck torrents.)QBT_TR[CONTEXT=HttpServer]");
42 }).send();
43 });
45 // set tabindex so window element receives keydown events
46 windowEl.setAttribute("tabindex", "-1");
47 windowEl.focus();
48 windowEl.addEventListener("keydown", (e) => {
49 switch (e.key) {
50 case "Enter":
51 confirmButton.click();
52 break;
53 case "Escape":
54 window.qBittorrent.Client.closeWindow("confirmRecheckDialog");
55 break;
57 });
58 })();
59 </script>