summaryrefslogtreecommitdiff
path: root/src/components/AppHeader
diff options
context:
space:
mode:
authorYoshie Muranaka <yoshiemuranaka@gmail.com>2020-02-07 00:47:28 +0300
committerYoshie Muranaka <yoshiemuranaka@gmail.com>2020-02-17 21:48:43 +0300
commit1ace1d91e80425eeed482b33e21838acb7f7325a (patch)
tree86700b60471ae41222bdba6902b3cb308978953a /src/components/AppHeader
parentc031b6988d6381ae1d2ecefd04e8c2af47f0ff4a (diff)
downloadwebui-vue-1ace1d91e80425eeed482b33e21838acb7f7325a.tar.xz
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 <yoshiemuranaka@gmail.com> Change-Id: I35ad30b005c70625a5f6a69488d45db0fa049374
Diffstat (limited to 'src/components/AppHeader')
-rw-r--r--src/components/AppHeader/AppHeader.vue27
1 files changed, 26 insertions, 1 deletions
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 @@
<b-nav>
<b-nav-item>
Health
- <status-icon :status="'danger'" />
+ <status-icon :status="healthStatusIcon" />
</b-nav-item>
<b-nav-item>
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;