mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-03 06:02:29 -06:00
55 lines
2.0 KiB
HTML
55 lines
2.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="${LANG}" class="dark">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>QBT_TR(Add trackers)QBT_TR[CONTEXT=TrackersAdditionDialog]</title>
|
|
<link rel="stylesheet" href="css/style.css?v=${CACHEID}" type="text/css">
|
|
<script defer src="scripts/localpreferences.js?v=${CACHEID}"></script>
|
|
<script defer src="scripts/color-scheme.js?v=${CACHEID}"></script>
|
|
<script>
|
|
"use strict";
|
|
|
|
window.addEventListener("DOMContentLoaded", (event) => {
|
|
window.addEventListener("keydown", (event) => {
|
|
switch (event.key) {
|
|
case "Escape":
|
|
event.preventDefault();
|
|
window.parent.qBittorrent.Client.closeFrameWindow(window);
|
|
break;
|
|
}
|
|
});
|
|
|
|
document.getElementById("trackersUrls").focus();
|
|
document.getElementById("addTrackersButton").addEventListener("click", (e) => {
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
|
|
fetch("api/v2/torrents/addTrackers", {
|
|
method: "POST",
|
|
body: new URLSearchParams({
|
|
hash: new URLSearchParams(window.location.search).get("hash"),
|
|
urls: document.getElementById("trackersUrls").value
|
|
})
|
|
})
|
|
.then((response) => {
|
|
if (!response.ok)
|
|
return;
|
|
|
|
window.parent.qBittorrent.Client.closeFrameWindow(window);
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
<div style="text-align: center; margin-top: 10px;">
|
|
<label for="trackersUrls">QBT_TR(List of trackers to add (one per line):)QBT_TR[CONTEXT=TrackersAdditionDialog]</label>
|
|
<textarea name="list" id="trackersUrls" rows="10" cols="1"></textarea>
|
|
<input type="button" value="QBT_TR(Add)QBT_TR[CONTEXT=HttpServer]" id="addTrackersButton">
|
|
</div>
|
|
</body>
|
|
|
|
</html>
|