mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
WebUI: Implement pause torrents by category
This commit is contained in:
parent
f7833c9f0c
commit
2c24c0bfbf
3 changed files with 20 additions and 0 deletions
|
@ -130,6 +130,7 @@
|
||||||
<li><a href="#DeleteCategory"><img src="theme/list-remove" alt="QBT_TR(Remove category)QBT_TR"/> QBT_TR(Remove category)QBT_TR</a></li>
|
<li><a href="#DeleteCategory"><img src="theme/list-remove" alt="QBT_TR(Remove category)QBT_TR"/> QBT_TR(Remove category)QBT_TR</a></li>
|
||||||
<li><a href="#DeleteUnusedCategories"><img src="theme/list-remove" alt="QBT_TR(Remove unused categories)QBT_TR"/> QBT_TR(Remove unused categories)QBT_TR</a></li>
|
<li><a href="#DeleteUnusedCategories"><img src="theme/list-remove" alt="QBT_TR(Remove unused categories)QBT_TR"/> QBT_TR(Remove unused categories)QBT_TR</a></li>
|
||||||
<li class="separator"><a href="#StartTorrentsByCategory"><img src="theme/media-playback-start" alt="QBT_TR(Resume torrents)QBT_TR"/> QBT_TR(Resume torrents)QBT_TR</a></li>
|
<li class="separator"><a href="#StartTorrentsByCategory"><img src="theme/media-playback-start" alt="QBT_TR(Resume torrents)QBT_TR"/> QBT_TR(Resume torrents)QBT_TR</a></li>
|
||||||
|
<li><a href="#PauseTorrentsByCategory"><img src="theme/media-playback-pause" alt="QBT_TR(Pause torrents)QBT_TR"/> QBT_TR(Pause torrents)QBT_TR</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div id="desktopFooterWrapper">
|
<div id="desktopFooterWrapper">
|
||||||
<div id="desktopFooter">
|
<div id="desktopFooter">
|
||||||
|
|
|
@ -31,6 +31,9 @@
|
||||||
},
|
},
|
||||||
StartTorrentsByCategory : function (element, ref) {
|
StartTorrentsByCategory : function (element, ref) {
|
||||||
startTorrentsByCategoryFN(element.id);
|
startTorrentsByCategoryFN(element.id);
|
||||||
|
},
|
||||||
|
PauseTorrentsByCategory : function (element, ref) {
|
||||||
|
pauseTorrentsByCategoryFN(element.id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
offsets : {
|
offsets : {
|
||||||
|
|
|
@ -401,6 +401,22 @@ initializeWindows = function() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pauseTorrentsByCategoryFN = function (categoryHash) {
|
||||||
|
var h = torrentsTable.getFilteredTorrentsHashes('all', categoryHash);
|
||||||
|
if (h.length) {
|
||||||
|
h.each(function (hash, index) {
|
||||||
|
new Request({
|
||||||
|
url: 'command/pause',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
hash: hash
|
||||||
|
}
|
||||||
|
}).send();
|
||||||
|
});
|
||||||
|
updateMainData();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
['pauseAll', 'resumeAll'].each(function(item) {
|
['pauseAll', 'resumeAll'].each(function(item) {
|
||||||
addClickEvent(item, function(e) {
|
addClickEvent(item, function(e) {
|
||||||
new Event(e).stop();
|
new Event(e).stop();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue