mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-10 17:35:00 -06:00
WebUI: Support editing tracker tier
This PR adds the ability to direct modify a tracker's tier from the WebUI. This process is notably different than the GUI, which provides arrows for increasing/decreasing a tracker's tier. Closes #12233. PR #22963.
This commit is contained in:
committed by
GitHub
parent
b2d6323034
commit
6ef9db89f9
@@ -26,9 +26,11 @@
|
||||
|
||||
const searchParams = new URLSearchParams(window.location.search);
|
||||
const currentUrl = searchParams.get("url");
|
||||
if (currentUrl === null)
|
||||
const currentTier = searchParams.get("tier");
|
||||
if ((currentUrl === null) || (currentTier === null))
|
||||
return;
|
||||
|
||||
document.getElementById("trackerTier").value = currentTier;
|
||||
document.getElementById("trackerUrl").value = currentUrl;
|
||||
document.getElementById("trackerUrl").focus();
|
||||
|
||||
@@ -40,8 +42,9 @@
|
||||
method: "POST",
|
||||
body: new URLSearchParams({
|
||||
hash: searchParams.get("hash"),
|
||||
origUrl: currentUrl,
|
||||
newUrl: document.getElementById("trackerUrl").value
|
||||
url: currentUrl,
|
||||
newUrl: document.getElementById("trackerUrl").value,
|
||||
tier: document.getElementById("trackerTier").value
|
||||
})
|
||||
})
|
||||
.then((response) => {
|
||||
@@ -63,6 +66,11 @@
|
||||
<input type="text" id="trackerUrl" style="width: 90%;">
|
||||
</div>
|
||||
<br>
|
||||
<label for="trackerTier">QBT_TR(Tier:)QBT_TR[CONTEXT=TrackerListWidget]</label>
|
||||
<div style="text-align: center; padding-top: 10px;">
|
||||
<input type="number" id="trackerTier" style="width: 90%; max-width: 100px;" min="0" max="255">
|
||||
</div>
|
||||
<br>
|
||||
<input type="button" value="QBT_TR(Edit)QBT_TR[CONTEXT=HttpServer]" id="editTrackerButton">
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user