mirror of
https://github.com/Carve/qbittorrent-webui-cjratliff.com.git
synced 2025-02-28 07:30:36 +01:00
Merge pull request #87 from Carve/83-issues-on-version-201
83 issues on version 201
This commit is contained in:
commit
cf63d9e5f7
@ -8,6 +8,7 @@
|
||||
--darkmode-text: #c2c2c2;
|
||||
--darkmode-text-alt: #d3d3d3;
|
||||
--color-text-default: var(--darkmode-background);
|
||||
--color-text-white: #fff;
|
||||
--darkmode-line-color: #2F3437;
|
||||
--highlight-color--darkred: #b83739;
|
||||
--highlight-color--red: #ce292c;
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
.dynamicTable tbody tr.selected,
|
||||
.dynamicTable tbody tr:hover {
|
||||
background-color: var(--darkmode-background-light);
|
||||
background-color: var(--darkmode-text-alt);
|
||||
color: var(--darkmode-background)
|
||||
}
|
||||
|
||||
|
@ -689,7 +689,7 @@ ul.filterList span.link {
|
||||
|
||||
ul.filterList span.link:hover {
|
||||
background-color: var(--darkmode-primary);
|
||||
color: var(--color-text-white);
|
||||
color: var(--darkmode-background) !important;
|
||||
}
|
||||
|
||||
span.link :last-child {
|
||||
@ -705,7 +705,7 @@ span.link :is(img, button) {
|
||||
|
||||
.selectedFilter > span.link {
|
||||
background-color: var(--color-background-blue);
|
||||
color: var(--color-text-white);
|
||||
color: var(--darkmode-background);
|
||||
}
|
||||
|
||||
.subcategories,
|
||||
|
@ -140,6 +140,12 @@
|
||||
let createTagFN = function() {};
|
||||
let removeTagFN = function() {};
|
||||
let deleteUnusedTagsFN = function() {};
|
||||
let startTorrentsByTagFN = function() {};
|
||||
let stopTorrentsByTagFN = function() {};
|
||||
let deleteTorrentsByTagFN = function() {};
|
||||
let startTorrentsByTrackerFN = function() {};
|
||||
let stopTorrentsByTrackerFN = function() {};
|
||||
let deleteTorrentsByTrackerFN = function() {};
|
||||
let deleteTrackerFN = function() {};
|
||||
let copyNameFN = function() {};
|
||||
let copyInfohashFN = function(policy) {};
|
||||
@ -1009,6 +1015,203 @@
|
||||
}).send();
|
||||
setTagFilter(TAGS_ALL);
|
||||
};
|
||||
|
||||
startTorrentsByTagFN = function(tagHash) {
|
||||
const hashes = torrentsTable.getFilteredTorrentsHashes("all", CATEGORIES_ALL, tagHash, TRACKERS_ALL);
|
||||
if (hashes.length) {
|
||||
new Request({
|
||||
url: "api/v2/torrents/start",
|
||||
method: "post",
|
||||
data: {
|
||||
hashes: hashes.join("|")
|
||||
}
|
||||
}).send();
|
||||
updateMainData();
|
||||
}
|
||||
};
|
||||
|
||||
stopTorrentsByTagFN = function(tagHash) {
|
||||
const hashes = torrentsTable.getFilteredTorrentsHashes("all", CATEGORIES_ALL, tagHash, TRACKERS_ALL);
|
||||
if (hashes.length) {
|
||||
new Request({
|
||||
url: "api/v2/torrents/stop",
|
||||
method: "post",
|
||||
data: {
|
||||
hashes: hashes.join("|")
|
||||
}
|
||||
}).send();
|
||||
updateMainData();
|
||||
}
|
||||
};
|
||||
|
||||
deleteTorrentsByTagFN = function(tagHash) {
|
||||
const hashes = torrentsTable.getFilteredTorrentsHashes("all", CATEGORIES_ALL, tagHash, TRACKERS_ALL);
|
||||
if (hashes.length > 0) {
|
||||
if (window.qBittorrent.Cache.preferences.get().confirm_torrent_deletion) {
|
||||
new MochaUI.Modal({
|
||||
...window.qBittorrent.Dialog.baseModalOptions,
|
||||
id: "confirmDeletionPage",
|
||||
title: "QBT_TR(Remove torrent(s))QBT_TR[CONTEXT=confirmDeletionDlg]",
|
||||
data: { hashes: hashes },
|
||||
contentURL: "views/confirmdeletion.html",
|
||||
onContentLoaded: function(w) {
|
||||
MochaUI.resizeWindow(w, { centered: true });
|
||||
MochaUI.centerWindow(w);
|
||||
},
|
||||
onCloseComplete: function() {
|
||||
// make sure overlay is properly hidden upon modal closing
|
||||
document.getElementById("modalOverlay").style.display = "none";
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
new Request({
|
||||
url: "api/v2/torrents/delete",
|
||||
method: "post",
|
||||
data: {
|
||||
hashes: hashes.join("|"),
|
||||
deleteFiles: false,
|
||||
},
|
||||
onSuccess: function() {
|
||||
torrentsTable.deselectAll();
|
||||
updateMainData();
|
||||
},
|
||||
onFailure: function() {
|
||||
alert("QBT_TR(Unable to delete torrents.)QBT_TR[CONTEXT=HttpServer]");
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
startTorrentsByTrackerFN = function(trackerHash) {
|
||||
const trackerHashInt = Number.parseInt(trackerHash, 10);
|
||||
let hashes = [];
|
||||
switch (trackerHashInt) {
|
||||
case TRACKERS_ALL:
|
||||
hashes = torrentsTable.getFilteredTorrentsHashes("all", CATEGORIES_ALL, TAGS_ALL, TRACKERS_ALL);
|
||||
break;
|
||||
case TRACKERS_TRACKERLESS:
|
||||
hashes = torrentsTable.getFilteredTorrentsHashes("all", CATEGORIES_ALL, TAGS_ALL, TRACKERS_TRACKERLESS);
|
||||
break;
|
||||
default: {
|
||||
const uniqueTorrents = new Set();
|
||||
for (const torrents of trackerList.get(trackerHashInt).trackerTorrentMap.values()) {
|
||||
for (const torrent of torrents)
|
||||
uniqueTorrents.add(torrent);
|
||||
}
|
||||
hashes = [...uniqueTorrents];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (hashes.length > 0) {
|
||||
new Request({
|
||||
url: "api/v2/torrents/start",
|
||||
method: "post",
|
||||
data: {
|
||||
hashes: hashes.join("|")
|
||||
}
|
||||
}).send();
|
||||
updateMainData();
|
||||
}
|
||||
};
|
||||
|
||||
stopTorrentsByTrackerFN = function(trackerHash) {
|
||||
const trackerHashInt = Number.parseInt(trackerHash, 10);
|
||||
let hashes = [];
|
||||
switch (trackerHashInt) {
|
||||
case TRACKERS_ALL:
|
||||
hashes = torrentsTable.getFilteredTorrentsHashes("all", CATEGORIES_ALL, TAGS_ALL, TRACKERS_ALL);
|
||||
break;
|
||||
case TRACKERS_TRACKERLESS:
|
||||
hashes = torrentsTable.getFilteredTorrentsHashes("all", CATEGORIES_ALL, TAGS_ALL, TRACKERS_TRACKERLESS);
|
||||
break;
|
||||
default: {
|
||||
const uniqueTorrents = new Set();
|
||||
for (const torrents of trackerList.get(trackerHashInt).trackerTorrentMap.values()) {
|
||||
for (const torrent of torrents)
|
||||
uniqueTorrents.add(torrent);
|
||||
}
|
||||
hashes = [...uniqueTorrents];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (hashes.length) {
|
||||
new Request({
|
||||
url: "api/v2/torrents/stop",
|
||||
method: "post",
|
||||
data: {
|
||||
hashes: hashes.join("|")
|
||||
}
|
||||
}).send();
|
||||
updateMainData();
|
||||
}
|
||||
};
|
||||
|
||||
deleteTorrentsByTrackerFN = function(trackerHash) {
|
||||
const trackerHashInt = Number.parseInt(trackerHash, 10);
|
||||
let hashes = [];
|
||||
switch (trackerHashInt) {
|
||||
case TRACKERS_ALL:
|
||||
hashes = torrentsTable.getFilteredTorrentsHashes("all", CATEGORIES_ALL, TAGS_ALL, TRACKERS_ALL);
|
||||
break;
|
||||
case TRACKERS_TRACKERLESS:
|
||||
hashes = torrentsTable.getFilteredTorrentsHashes("all", CATEGORIES_ALL, TAGS_ALL, TRACKERS_TRACKERLESS);
|
||||
break;
|
||||
default: {
|
||||
const uniqueTorrents = new Set();
|
||||
for (const torrents of trackerList.get(trackerHashInt).trackerTorrentMap.values()) {
|
||||
for (const torrent of torrents)
|
||||
uniqueTorrents.add(torrent);
|
||||
}
|
||||
hashes = [...uniqueTorrents];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (hashes.length > 0) {
|
||||
if (window.qBittorrent.Cache.preferences.get().confirm_torrent_deletion) {
|
||||
new MochaUI.Modal({
|
||||
...window.qBittorrent.Dialog.baseModalOptions,
|
||||
id: "confirmDeletionPage",
|
||||
title: "QBT_TR(Remove torrent(s))QBT_TR[CONTEXT=confirmDeletionDlg]",
|
||||
data: {
|
||||
hashes: hashes,
|
||||
filterList: "tracker"
|
||||
},
|
||||
contentURL: "views/confirmdeletion.html",
|
||||
onContentLoaded: function(w) {
|
||||
MochaUI.resizeWindow(w, { centered: true });
|
||||
MochaUI.centerWindow(w);
|
||||
},
|
||||
onCloseComplete: function() {
|
||||
// make sure overlay is properly hidden upon modal closing
|
||||
document.getElementById("modalOverlay").style.display = "none";
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
new Request({
|
||||
url: "api/v2/torrents/delete",
|
||||
method: "post",
|
||||
data: {
|
||||
hashes: hashes.join("|"),
|
||||
deleteFiles: false,
|
||||
},
|
||||
onSuccess: function() {
|
||||
torrentsTable.deselectAll();
|
||||
setTrackerFilter(TRACKERS_ALL);
|
||||
updateMainData();
|
||||
},
|
||||
onFailure: function() {
|
||||
alert("QBT_TR(Unable to delete torrents.)QBT_TR[CONTEXT=HttpServer]");
|
||||
},
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
deleteTrackerFN = function(trackerHash) {
|
||||
const trackerHashInt = Number.parseInt(trackerHash, 10);
|
||||
|
@ -55,21 +55,21 @@
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.logTableRowlogNormal {
|
||||
color: var(--color-text-default);
|
||||
.dynamicTable tbody tr.logTableRowlogNormal {
|
||||
color: var(--darkmode-text);
|
||||
}
|
||||
|
||||
.logTableRowlogInfo {
|
||||
color: var(--color-text-blue);
|
||||
.dynamicTable tbody tr.logTableRowlogInfo {
|
||||
color: var(--highlight-color--blue);
|
||||
}
|
||||
|
||||
.logTableRowlogWarning {
|
||||
color: var(--color-text-orange);
|
||||
.dynamicTable tbody tr.logTableRowlogWarning {
|
||||
color: var(--highlight-color--orange);
|
||||
}
|
||||
|
||||
.logTableRowlogCritical,
|
||||
.logTableRowpeerBlocked {
|
||||
color: var(--color-text-red);
|
||||
.dynamicTable tbody tr.logTableRowlogCritical,
|
||||
.dynamicTable tbody tr.logTableRowpeerBlocked {
|
||||
color: var(--highlight-color--red);
|
||||
}
|
||||
|
||||
.vsb-main>button {
|
||||
|
Loading…
x
Reference in New Issue
Block a user