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 <mikl@greenfil.ru>
diff --git a/src/store/modules/Logs/EventLogStore.js b/src/store/modules/Logs/EventLogStore.js
index c9bd82f..f398007 100644
--- a/src/store/modules/Logs/EventLogStore.js
+++ b/src/store/modules/Logs/EventLogStore.js
@@ -4,12 +4,14 @@
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;