rework jobs package 1/2

This commit is contained in:
Inga Kirschnick
2023-03-09 14:55:52 +01:00
parent 5f27ce2801
commit d6fcaa97bf
10 changed files with 134 additions and 94 deletions
app
contributions
tesseract_ocr_pipeline_models
jobs
static
js
Requests
ResourceDisplays
Utils.js
templates

@ -1,4 +1,4 @@
Requests = {};
let Requests = {};
Requests.JSONfetch = (input, init={}) => {
return new Promise((resolve, reject) => {

@ -0,0 +1,23 @@
/*****************************************************************************
* Jobs *
* Fetch requests for /jobs routes *
*****************************************************************************/
Requests.jobs = {};
Requests.jobs.entity = {};
Requests.jobs.entity.delete = (jobId) => {
let input = `/jobs/${jobId}`;
let init = {
method: 'DELETE'
};
return Requests.JSONfetch(input, init);
}
Requests.jobs.entity.log = (jobId) => {
let input = `/jobs/${jobId}/log`;
let init = {
method: 'GET'
};
return Requests.JSONfetch(input, init);
}