Added CancelJob
This commit is contained in:
parent
63ed4fdda5
commit
c2b01c8961
@ -177,3 +177,8 @@ function RemoveJob(jobId){
|
|||||||
var uri = `${apiUri}/Jobs?jobId=${jobId}`;
|
var uri = `${apiUri}/Jobs?jobId=${jobId}`;
|
||||||
DeleteData(uri);
|
DeleteData(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function CancelJob(jobId){
|
||||||
|
var uri = `${apiUri}/Jobs/Cancel?jobId=${jobId}`;
|
||||||
|
PostData(uri);
|
||||||
|
}
|
@ -101,9 +101,10 @@
|
|||||||
</publication-description>
|
</publication-description>
|
||||||
<publication-interactions>
|
<publication-interactions>
|
||||||
<publication-starttask id="startJobButton">Start Job ▶️</publication-starttask>
|
<publication-starttask id="startJobButton">Start Job ▶️</publication-starttask>
|
||||||
<publication-delete id="deleteJobButton">Delete Job ❌</publication-delete>
|
<publication-canceltask id="cancelJobButton">Cancel Job ❌</publication-canceltask>
|
||||||
|
<publication-delete id="deleteJobButton">Delete Job 🗑️</publication-delete>
|
||||||
<publication-add id="createMonitorJobButton">Monitor ➕</publication-add>
|
<publication-add id="createMonitorJobButton">Monitor ➕</publication-add>
|
||||||
<publication-add id="createDownloadChapterJobButton">Download Chapter ➕</publication-add>
|
<publication-add id="createDownloadChapterJobButton">Download Chapter 📥</publication-add>
|
||||||
</publication-interactions>
|
</publication-interactions>
|
||||||
</publication-information>
|
</publication-information>
|
||||||
</publication-viewer>
|
</publication-viewer>
|
||||||
|
@ -11,6 +11,7 @@ const tasksContent = document.querySelector("content");
|
|||||||
const createMonitorTaskButton = document.querySelector("#createMonitoJobButton");
|
const createMonitorTaskButton = document.querySelector("#createMonitoJobButton");
|
||||||
const createDownloadChapterTaskButton = document.querySelector("#createDownloadChapterJobButton");
|
const createDownloadChapterTaskButton = document.querySelector("#createDownloadChapterJobButton");
|
||||||
const startJobButton = document.querySelector("#startJobButton");
|
const startJobButton = document.querySelector("#startJobButton");
|
||||||
|
const cancelJobButton = document.querySelector("#cancelJobButton");
|
||||||
const deleteJobButton = document.querySelector("#deleteJobButton");
|
const deleteJobButton = document.querySelector("#deleteJobButton");
|
||||||
const mangaViewerPopup = document.querySelector("#publicationViewerPopup");
|
const mangaViewerPopup = document.querySelector("#publicationViewerPopup");
|
||||||
const mangaViewerWindow = document.querySelector("publication-viewer");
|
const mangaViewerWindow = document.querySelector("publication-viewer");
|
||||||
@ -137,6 +138,10 @@ startJobButton.addEventListener("click", () => {
|
|||||||
StartJob(selectedJob.id);
|
StartJob(selectedJob.id);
|
||||||
mangaViewerPopup.style.display = "none";
|
mangaViewerPopup.style.display = "none";
|
||||||
});
|
});
|
||||||
|
cancelJobButton.addEventListener("click", () => {
|
||||||
|
CancelJob(selectedJob.id);
|
||||||
|
mangaViewerPopup.style.display = "none";
|
||||||
|
});
|
||||||
deleteJobButton.addEventListener("click", () => {
|
deleteJobButton.addEventListener("click", () => {
|
||||||
RemoveJob(selectedJob.id);
|
RemoveJob(selectedJob.id);
|
||||||
UpdateJobs();
|
UpdateJobs();
|
||||||
@ -172,12 +177,14 @@ function ShowMangaWindow(job, manga, event, add){
|
|||||||
if(add){
|
if(add){
|
||||||
createMonitorJobButton.style.display = "initial";
|
createMonitorJobButton.style.display = "initial";
|
||||||
createDownloadChapterJobButton.style.display = "initial";
|
createDownloadChapterJobButton.style.display = "initial";
|
||||||
|
cancelJobButton.style.display = "none";
|
||||||
startJobButton.style.display = "none";
|
startJobButton.style.display = "none";
|
||||||
deleteJobButton.style.display = "none";
|
deleteJobButton.style.display = "none";
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
createMonitorJobButton.style.display = "none";
|
createMonitorJobButton.style.display = "none";
|
||||||
createDownloadChapterJobButton.style.display = "none";
|
createDownloadChapterJobButton.style.display = "none";
|
||||||
|
cancelJobButton.style.display = "initial";
|
||||||
startJobButton.style.display = "initial";
|
startJobButton.style.display = "initial";
|
||||||
deleteJobButton.style.display = "initial";
|
deleteJobButton.style.display = "initial";
|
||||||
}
|
}
|
||||||
|
@ -462,6 +462,10 @@ publication-viewer publication-information publication-interactions publication-
|
|||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
publication-view publication-information publication-interactions publication-canceltask {
|
||||||
|
color: yellow;
|
||||||
|
}
|
||||||
|
|
||||||
publication-viewer publication-information publication-interactions publication-add {
|
publication-viewer publication-information publication-interactions publication-add {
|
||||||
color: limegreen;
|
color: limegreen;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user