From a2933658dcdb23da2dd171f4eb385e995d77c543 Mon Sep 17 00:00:00 2001 From: Timo Pollmeier Date: Wed, 16 Aug 2023 13:32:44 +0200 Subject: [PATCH] Add: New "Processing" task and report status Tasks and reports can now have a new status "Processing" when the actual scan is done but additional data like asset identifiers is still being processed. This gives users additional information when before the scan appeared to be stuck at 100% progress. --- public/locales/gsa-de.json | 1 + src/gmp/models/task.js | 5 ++++- src/web/components/bar/statusbar.js | 5 ++++- src/web/pages/tasks/dashboard/statusdisplay.js | 2 ++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/public/locales/gsa-de.json b/public/locales/gsa-de.json index 0e8b1bb8dd..8dc14c44cf 100644 --- a/public/locales/gsa-de.json +++ b/public/locales/gsa-de.json @@ -1201,6 +1201,7 @@ "Privacy Password": "Privacy-Passwort", "Private Key": "Privater Schlüssel", "Privileges Required": "Benötigte Berechtigungen", + "Processing": "Verarbeiten", "Product": "Produkt", "Product Detection Result": "Ergebnis zur Produkterkennung", "Protocol": "Protokoll", diff --git a/src/gmp/models/task.js b/src/gmp/models/task.js index cf6aaaac0b..8087f56cf3 100644 --- a/src/gmp/models/task.js +++ b/src/gmp/models/task.js @@ -64,6 +64,7 @@ export const TASK_STATUS = { interrupted: 'Interrupted', container: 'Container', uploading: 'Uploading', + processing: 'Processing', done: 'Done', }; @@ -82,6 +83,7 @@ const TASK_STATUS_TRANSLATIONS = { Uploading: _l('Uploading'), Done: _l('Done'), Queued: _l('Queued'), + Processing: _l('Processing'), }; /* eslint-disable quote-props */ @@ -95,7 +97,8 @@ export const isActive = status => status === TASK_STATUS.ultimatedeleterequested || status === TASK_STATUS.resumerequested || status === TASK_STATUS.requested || - status === TASK_STATUS.queued; + status === TASK_STATUS.queued || + status === TASK_STATUS.processing; class Task extends Model { static entityType = 'task'; diff --git a/src/web/components/bar/statusbar.js b/src/web/components/bar/statusbar.js index 5090367496..10a218f9b7 100644 --- a/src/web/components/bar/statusbar.js +++ b/src/web/components/bar/statusbar.js @@ -78,7 +78,10 @@ const StatusBar = ({status = 'Unknown', progress = '0'}) => { background = 'low'; } else if (status === TASK_STATUS.new) { background = 'new'; - } else if (status === TASK_STATUS.running) { + } else if ( + status === TASK_STATUS.processing || + status === TASK_STATUS.running + ) { background = 'run'; } diff --git a/src/web/pages/tasks/dashboard/statusdisplay.js b/src/web/pages/tasks/dashboard/statusdisplay.js index 65fe003c2d..245b7fb0fe 100644 --- a/src/web/pages/tasks/dashboard/statusdisplay.js +++ b/src/web/pages/tasks/dashboard/statusdisplay.js @@ -55,6 +55,7 @@ const taskStatusColorScale = scaleOrdinal() TASK_STATUS.stoprequested, TASK_STATUS.stopped, TASK_STATUS.done, + TASK_STATUS.processing, 'N/A', ]) .range([ @@ -68,6 +69,7 @@ const taskStatusColorScale = scaleOrdinal() orange(1.0), orange(0.0), blue(0.5), + green(-0.5), 'silver', ]);