summaryrefslogtreecommitdiff
path: root/src/store
diff options
context:
space:
mode:
Diffstat (limited to 'src/store')
-rw-r--r--src/store/modules/Health/EventLogStore.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/store/modules/Health/EventLogStore.js b/src/store/modules/Health/EventLogStore.js
index 2b93ffa7..79bee02a 100644
--- a/src/store/modules/Health/EventLogStore.js
+++ b/src/store/modules/Health/EventLogStore.js
@@ -1,8 +1,8 @@
import api, { getResponseCount } from '@/store/api';
import i18n from '@/i18n';
-const getHealthStatus = events => {
- let status = 'OK';
+const getHealthStatus = (events, loadedEvents) => {
+ let status = loadedEvents ? 'OK' : '';
for (const event of events) {
if (event.severity === 'Warning') {
status = 'Warning';
@@ -23,15 +23,18 @@ const getHighPriorityEvents = events =>
const EventLogStore = {
namespaced: true,
state: {
- allEvents: []
+ allEvents: [],
+ loadedEvents: false
},
getters: {
allEvents: state => state.allEvents,
highPriorityEvents: state => getHighPriorityEvents(state.allEvents),
- healthStatus: state => getHealthStatus(state.allEvents)
+ healthStatus: state => getHealthStatus(state.allEvents, state.loadedEvents)
},
mutations: {
- setAllEvents: (state, allEvents) => (state.allEvents = allEvents)
+ setAllEvents: (state, allEvents) => (
+ (state.allEvents = allEvents), (state.loadedEvents = true)
+ )
},
actions: {
async getEventLogData({ commit }) {