From 7c26338edd6fdb16e72702910987a8e5fd899c10 Mon Sep 17 00:00:00 2001 From: Glukhov Mikhail Date: Mon, 13 Feb 2023 16:07:35 +0300 Subject: Added a "solved" check Now Health status will be "Ok" if there are no unsolved problems in the log. Before this patch, the flag "solved" was not considered. Test: Created a log entry with the status of "Critical" and "Warning". Health became Critical. Event Critical pressed Resolved. Health became "Warning". Event Warning pressed Resolved. Health became "Ok". Change-Id: Ic74a4c488c1c806c478c562a17fc0bb132e66e8f Signed-off-by: Glukhov Mikhail --- src/store/modules/Logs/EventLogStore.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/store/modules/Logs/EventLogStore.js b/src/store/modules/Logs/EventLogStore.js index c9bd82fd..f3980075 100644 --- a/src/store/modules/Logs/EventLogStore.js +++ b/src/store/modules/Logs/EventLogStore.js @@ -4,12 +4,14 @@ import i18n from '@/i18n'; const getHealthStatus = (events, loadedEvents) => { let status = loadedEvents ? 'OK' : ''; for (const event of events) { - if (event.severity === 'Warning') { - status = 'Warning'; - } - if (event.severity === 'Critical') { - status = 'Critical'; - break; + if (event.filterByStatus === 'Unresolved') { + if (event.severity === 'Warning') { + status = 'Warning'; + } + if (event.severity === 'Critical') { + status = 'Critical'; + break; + } } } return status; -- cgit v1.2.3