mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-05 20:51:25 -07:00
WebUI: Support editing tracker tier
This commit is contained in:
parent
f5743bd228
commit
dfcb16a7fd
2 changed files with 20 additions and 5 deletions
|
@ -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();
|
||||
|
||||
|
@ -41,7 +43,8 @@
|
|||
body: new URLSearchParams({
|
||||
hash: searchParams.get("hash"),
|
||||
origUrl: currentUrl,
|
||||
newUrl: document.getElementById("trackerUrl").value
|
||||
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>
|
||||
|
|
|
@ -209,13 +209,20 @@ window.qBittorrent.PropTrackers ??= (() => {
|
|||
if (current_hash.length === 0)
|
||||
return;
|
||||
|
||||
const trackerUrl = encodeURIComponent(torrentTrackersTable.selectedRowsIds()[0]);
|
||||
const tracker = torrentTrackersTable.getRow(torrentTrackersTable.getSelectedRowId());
|
||||
const contentURL = new URL("edittracker.html", window.location);
|
||||
contentURL.search = new URLSearchParams({
|
||||
hash: current_hash,
|
||||
url: tracker.full_data.url,
|
||||
tier: tracker.full_data.tier
|
||||
});
|
||||
|
||||
new MochaUI.Window({
|
||||
id: "trackersPage",
|
||||
icon: "images/qbittorrent-tray.svg",
|
||||
title: "QBT_TR(Tracker editing)QBT_TR[CONTEXT=TrackerListWidget]",
|
||||
loadMethod: "iframe",
|
||||
contentURL: `edittracker.html?hash=${current_hash}&url=${trackerUrl}`,
|
||||
contentURL: contentURL.toString(),
|
||||
scrollbars: true,
|
||||
resizable: false,
|
||||
maximizable: false,
|
||||
|
@ -223,7 +230,7 @@ window.qBittorrent.PropTrackers ??= (() => {
|
|||
paddingVertical: 0,
|
||||
paddingHorizontal: 0,
|
||||
width: 500,
|
||||
height: 150,
|
||||
height: 200,
|
||||
onCloseComplete: () => {
|
||||
updateData();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue