Health icon shows ok while loading
While web UI is loading it is showing controls as "OK" state
instead of undetermined which might be confusing.
More details: https://github.com/openbmc/webui-vue/issues/11
Signed-off-by: Mateusz Gapski <mateuszx.gapski@intel.com>
Change-Id: I0dc4aa3f00cee5d67c764c1950b4961e59a0a3cd
diff --git a/src/store/modules/Health/EventLogStore.js b/src/store/modules/Health/EventLogStore.js
index 2b93ffa..79bee02 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 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 }) {