mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-22 11:50:14 +00:00
add kill queue function to frontend
This commit is contained in:
parent
47020e0cfa
commit
51ec765433
@ -482,7 +482,6 @@ class PostData:
|
||||
"ignore": self.ignore,
|
||||
"dl_pending": self.dl_pending,
|
||||
"queue": self.queue_handler,
|
||||
"kill_queue": self.kill_queue,
|
||||
"unsubscribe": self.unsubscribe,
|
||||
"sort_order": self.sort_order,
|
||||
"hide_watched": self.hide_watched,
|
||||
@ -534,15 +533,11 @@ class PostData:
|
||||
if to_execute == "stop":
|
||||
print("stopping download queue")
|
||||
RedisQueue("dl_queue").clear()
|
||||
|
||||
return {"success": True}
|
||||
|
||||
@staticmethod
|
||||
def kill_queue():
|
||||
"""brutally murder the celery task"""
|
||||
elif to_execute == "kill":
|
||||
task_id = get_message("dl_queue_id")
|
||||
print("brutally killing " + task_id)
|
||||
kill_dl(task_id)
|
||||
|
||||
return {"success": True}
|
||||
|
||||
def unsubscribe(self):
|
||||
|
@ -7,4 +7,5 @@
|
||||
--accent-font-dark: #259485;
|
||||
--accent-font-light: #97d4c8;
|
||||
--img-filter: invert(50%) sepia(9%) saturate(2940%) hue-rotate(122deg) brightness(94%) contrast(90%);
|
||||
--img-filter-error: invert(16%) sepia(60%) saturate(3717%) hue-rotate(349deg) brightness(86%) contrast(120%);
|
||||
}
|
||||
|
@ -7,4 +7,5 @@
|
||||
--accent-font-dark: #259485;
|
||||
--accent-font-light: #35b399;
|
||||
--img-filter: invert(50%) sepia(9%) saturate(2940%) hue-rotate(122deg) brightness(94%) contrast(90%);
|
||||
--img-filter-error: invert(83%) sepia(35%) saturate(1238%) hue-rotate(297deg) brightness(103%) contrast(97%);
|
||||
}
|
||||
|
@ -470,8 +470,16 @@ button:hover {
|
||||
|
||||
.dl-control-icons img {
|
||||
width: 30px;
|
||||
filter: var(--img-filter);
|
||||
cursor: pointer;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
#stop-icon {
|
||||
filter: var(--img-filter);
|
||||
}
|
||||
|
||||
#kill-icon {
|
||||
filter: var(--img-filter-error);
|
||||
}
|
||||
|
||||
/* status message */
|
||||
|
@ -82,13 +82,22 @@ function buildDownloadIcons() {
|
||||
var box = document.getElementById('downloadControl');
|
||||
var iconBox = document.createElement('div');
|
||||
iconBox.classList = 'dl-control-icons';
|
||||
// stop icon
|
||||
var stopIcon = document.createElement('img');
|
||||
stopIcon.setAttribute('id', "stop-icon");
|
||||
stopIcon.setAttribute('title', "Stop Download Queue");
|
||||
stopIcon.setAttribute('src', "/static/img/icon-stop.svg");
|
||||
stopIcon.setAttribute('alt', "stop icon");
|
||||
stopIcon.setAttribute('onclick', 'stopQueue()');
|
||||
// kill icon
|
||||
var killIcon = document.createElement('img');
|
||||
killIcon.setAttribute('id', "kill-icon");
|
||||
killIcon.setAttribute('title', "Kill Download Queue");
|
||||
killIcon.setAttribute('src', "/static/img/icon-close.svg");
|
||||
killIcon.setAttribute('alt', "kill icon");
|
||||
killIcon.setAttribute('onclick', 'killQueue()');
|
||||
// stich together
|
||||
iconBox.appendChild(stopIcon);
|
||||
iconBox.appendChild(killIcon);
|
||||
box.appendChild(iconBox);
|
||||
}
|
||||
|
@ -85,6 +85,11 @@ function stopQueue() {
|
||||
document.getElementById('stop-icon').remove();
|
||||
}
|
||||
|
||||
function killQueue() {
|
||||
var payload = JSON.stringify({'queue': 'kill'});
|
||||
sendPost(payload);
|
||||
document.getElementById('kill-icon').remove();
|
||||
}
|
||||
|
||||
// settings page buttons
|
||||
function manualImport() {
|
||||
|
Loading…
Reference in New Issue
Block a user