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