summaryrefslogtreecommitdiff
path: root/src/store/modules
diff options
context:
space:
mode:
authorMateusz Gapski <mateuszx.gapski@intel.com>2020-07-20 11:55:15 +0300
committerDerick Montague <derick.montague@ibm.com>2020-07-22 01:16:17 +0300
commit076ab27f57c5adb34564908411c914c0ac300272 (patch)
tree24fdbd0e30bd2d88baf0221301c9e1404765552d /src/store/modules
parent03505916cf4195c63ac0c27f4e07d0dbece383c2 (diff)
downloadwebui-vue-076ab27f57c5adb34564908411c914c0ac300272.tar.xz
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
Diffstat (limited to 'src/store/modules')
-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 }) {