GHA CI: add checking for GHA workflows
[qBittorrent.git] / src / webui / www / private / edittracker.html
blob2b4ff2553ef8a27795448bf7097e459435330d95
1 <!DOCTYPE html>
2 <html lang="${LANG}" class="dark">
4 <head>
5 <meta charset="UTF-8">
6 <title>QBT_TR(Tracker editing)QBT_TR[CONTEXT=TrackerListWidget]</title>
7 <link rel="stylesheet" href="css/style.css?v=${CACHEID}" type="text/css">
8 <script src="scripts/lib/MooTools-Core-1.6.0-compat-compressed.js"></script>
9 <script src="scripts/lib/MooTools-More-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>
13 "use strict";
15 window.addEventListener("DOMContentLoaded", () => {
16 window.addEventListener("keydown", (event) => {
17 switch (event.key) {
18 case "Enter":
19 event.preventDefault();
20 $("editTrackerButton").click();
21 break;
22 case "Escape":
23 event.preventDefault();
24 window.parent.qBittorrent.Client.closeFrameWindow(window);
25 break;
27 });
29 const searchParams = new URLSearchParams(window.location.search);
30 const currentUrl = searchParams.get("url");
31 if (currentUrl === null)
32 return;
34 $("trackerUrl").value = currentUrl;
35 $("trackerUrl").focus();
37 $("editTrackerButton").addEventListener("click", (e) => {
38 e.preventDefault();
39 e.stopPropagation();
41 fetch("api/v2/torrents/editTracker", {
42 method: "POST",
43 body: new URLSearchParams({
44 hash: searchParams.get("hash"),
45 origUrl: currentUrl,
46 newUrl: $("trackerUrl").value
49 .then((response) => {
50 if (!response.ok)
51 return;
53 window.parent.qBittorrent.Client.closeFrameWindow(window);
54 });
55 });
56 });
57 </script>
58 </head>
60 <body>
61 <div style="text-align: center;">
62 <br>
63 <label for="trackerUrl">QBT_TR(Tracker URL:)QBT_TR[CONTEXT=TrackerListWidget]</label>
64 <div style="text-align: center; padding-top: 10px;">
65 <input type="text" id="trackerUrl" style="width: 90%;">
66 </div>
67 <br>
68 <input type="button" value="QBT_TR(Edit)QBT_TR[CONTEXT=HttpServer]" id="editTrackerButton">
69 </div>
70 </body>
72 </html>