WebUI: Support creating new torrents

Implemented the torrent creator using WebAPI from #20366 in WebUI, the interface is mostly inspired by GUI and VueTorrent.

Closes #5614.
PR #22459.
This commit is contained in:
tehcneko
2025-04-03 17:16:12 +08:00
committed by GitHub
parent 055d82bda4
commit f540381caf
10 changed files with 790 additions and 6 deletions

View File

@@ -208,6 +208,32 @@ const initializeWindows = () => {
updateMainData();
};
addClickEvent("torrentCreator", (e) => {
e.preventDefault();
e.stopPropagation();
const id = "torrentCreatorPage";
new MochaUI.Window({
id: id,
icon: "images/torrent-creator.svg",
title: "QBT_TR(Torrent Creator)QBT_TR[CONTEXT=TorrentCreator]",
loadMethod: "xhr",
contentURL: "views/torrentcreator.html",
scrollbars: true,
maximizable: true,
paddingVertical: 0,
paddingHorizontal: 0,
width: loadWindowWidth(id, 900),
height: loadWindowHeight(id, 400),
onResize: () => {
saveWindowSize(id);
},
onClose: () => {
window.qBittorrent.TorrentCreator.unload();
}
});
});
addClickEvent("preferences", (e) => {
e.preventDefault();
e.stopPropagation();