adding inforamtion about when the processor ran the last time

This commit is contained in:
orangecoding
2021-05-13 20:27:42 +02:00
parent 0cd354c34a
commit 1f6e2d3618
6 changed files with 61 additions and 4 deletions

View File

@@ -4,6 +4,7 @@ export const jobs = {
state: {
jobs: [],
insights: {},
processingTimes: {},
},
reducers: {
setJobs: (state, payload) => {
@@ -12,6 +13,12 @@ export const jobs = {
jobs: Object.freeze(payload),
};
},
setProcessingTimes: (state, payload) => {
return {
...state,
processingTimes: Object.freeze(payload),
};
},
setJobInsights: (state, payload, jobId) => {
return {
...state,
@@ -31,6 +38,14 @@ export const jobs = {
console.error(`Error while trying to get resource for api/jobs. Error:`, Exception);
}
},
async getProcessingTimes() {
try {
const response = await xhrGet('/api/jobs/processingTimes');
this.setProcessingTimes(response.json);
} catch (Exception) {
console.error(`Error while trying to get resource for api/processingTimes. Error:`, Exception);
}
},
async getInsightDataForJob(jobId) {
try {
const response = await xhrGet(`/api/jobs/insights/${jobId}`);