From 1ace1d91e80425eeed482b33e21838acb7f7325a Mon Sep 17 00:00:00 2001 From: Yoshie Muranaka Date: Thu, 6 Feb 2020 13:47:28 -0800 Subject: Add Health status to app header Added logging path and interface to websocket subscription data filter, to dynamically indicate Health status in the app header. - Update OverviewEvents to use highPriorityEvents data - Refactor EventLogStore Signed-off-by: Yoshie Muranaka Change-Id: I35ad30b005c70625a5f6a69488d45db0fa049374 --- src/components/AppHeader/AppHeader.vue | 27 +++++- src/components/Global/StatusIcon.vue | 9 +- src/store/modules/GlobalStore.js | 2 +- src/store/modules/Health/EventLogStore.js | 134 ++++++++++++++++++++---------- src/store/plugins/WebSocketPlugin.js | 31 +++++-- src/views/Overview/OverviewEvents.vue | 4 +- 6 files changed, 148 insertions(+), 59 deletions(-) (limited to 'src') diff --git a/src/components/AppHeader/AppHeader.vue b/src/components/AppHeader/AppHeader.vue index 880c428f..d411c1f1 100644 --- a/src/components/AppHeader/AppHeader.vue +++ b/src/components/AppHeader/AppHeader.vue @@ -14,7 +14,7 @@ Health - + Power @@ -46,6 +46,9 @@ export default { hostStatus() { return this.$store.getters['global/hostStatus']; }, + healthStatus() { + return this.$store.getters['eventLog/healthStatus']; + }, hostStatusIcon() { switch (this.hostStatus) { case 'on': @@ -56,15 +59,31 @@ export default { default: return 'secondary'; } + }, + healthStatusIcon() { + switch (this.healthStatus) { + case 'good': + return 'success'; + case 'warning': + return 'warning'; + case 'critical': + return 'danger'; + default: + return 'secondary'; + } } }, created() { this.getHostInfo(); + this.getEvents(); }, methods: { getHostInfo() { this.$store.dispatch('global/getHostStatus'); }, + getEvents() { + this.$store.dispatch('eventLog/getEventLogData'); + }, logout() { this.$store.dispatch('authentication/logout'); } @@ -84,6 +103,12 @@ export default { transition-timing-function: cubic-bezier(0, 0, 0.3, 1); } } +.navbar-dark { + .navbar-text, + .nav-link { + color: $white !important; + } +} .nav-item { svg { fill: $light; diff --git a/src/components/Global/StatusIcon.vue b/src/components/Global/StatusIcon.vue index a2c7f04f..d59eaec2 100644 --- a/src/components/Global/StatusIcon.vue +++ b/src/components/Global/StatusIcon.vue @@ -1,6 +1,7 @@