Started working on job UI implementation

This commit is contained in:
2018-04-28 19:44:44 +02:00
parent 3983894a27
commit 59633707c1
6 changed files with 61 additions and 1 deletions

View File

@ -70,4 +70,17 @@ export async function multiSearchAnime(arn: AnimeNotifier, textarea: HTMLTextAre
results.classList.remove("hidden")
showSearchResults(arn, results)
}
}
// Start background job
export async function startJob(arn: AnimeNotifier, button: HTMLButtonElement) {
let jobName = button.dataset.job
if(!confirm(`Are you sure you want to start the "${jobName}" job?`)) {
return
}
await arn.post(`/api/job/${jobName}/start`)
arn.reloadContent()
}