blob: 83aa677d711de55333a7252a1a4d63e038b4ae8e [file] [log] [blame]
Dixsie Wolmers97d86b32019-12-02 05:07:57 -06001<template>
Dixsie Wolmersf65ee342020-01-22 19:47:56 -06002 <div>
SurenNeware10fe2762020-08-19 12:01:32 +05303 <b-button
4 variant="link"
5 to="/health/event-logs"
6 data-test-id="overviewEvents-button-eventLogs"
7 class="float-md-right"
8 >
9 {{ $t('pageOverview.events.viewAllButton') }}
10 </b-button>
11 <b-table
12 per-page="5"
Derick Montagueb7718492020-09-11 09:23:30 -050013 sort-by="id"
SurenNeware10fe2762020-08-19 12:01:32 +053014 sort-desc
Sukanya Pandeyfde429e2020-09-14 20:48:39 +053015 hover
SurenNeware10fe2762020-08-19 12:01:32 +053016 responsive="md"
SurenNeware5e9c3912020-09-25 15:49:16 +053017 stacked="sm"
SurenNeware10fe2762020-08-19 12:01:32 +053018 show-empty
19 :items="eventLogData"
20 :fields="fields"
21 :empty-text="$t('pageOverview.events.noHighEventsMsg')"
22 >
Derick Montague602e98a2020-10-21 16:20:00 -050023 <template #cell(severity)="{ value }">
SurenNeware10fe2762020-08-19 12:01:32 +053024 <status-icon status="danger" />
25 {{ value }}
26 </template>
Derick Montague602e98a2020-10-21 16:20:00 -050027 <template #cell(date)="{ value }">
Dixsie Wolmers949cdd52020-08-24 21:36:37 -050028 <p class="mb-0">{{ value | formatDate }}</p>
29 <p class="mb-0">{{ value | formatTime }}</p>
SurenNeware10fe2762020-08-19 12:01:32 +053030 </template>
31 </b-table>
Dixsie Wolmersf65ee342020-01-22 19:47:56 -060032 </div>
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060033</template>
34
35<script>
Yoshie Muranakace9a3ef2020-05-06 14:33:22 -070036import StatusIcon from '@/components/Global/StatusIcon';
37
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060038export default {
Derick Montague09e45cd2020-01-23 15:45:57 -060039 name: 'Events',
Yoshie Muranakace9a3ef2020-05-06 14:33:22 -070040 components: { StatusIcon },
Dixsie Wolmers9d40e302020-02-13 13:29:40 -060041 data() {
42 return {
43 fields: [
44 {
Yoshie Muranakace9a3ef2020-05-06 14:33:22 -070045 key: 'id',
Derick Montague602e98a2020-10-21 16:20:00 -050046 label: this.$t('pageOverview.events.id'),
Dixsie Wolmers9d40e302020-02-13 13:29:40 -060047 },
48 {
Yoshie Muranakace9a3ef2020-05-06 14:33:22 -070049 key: 'severity',
Derick Montague602e98a2020-10-21 16:20:00 -050050 label: this.$t('pageOverview.events.severity'),
Dixsie Wolmers9d40e302020-02-13 13:29:40 -060051 },
52 {
Yoshie Muranakace9a3ef2020-05-06 14:33:22 -070053 key: 'type',
Derick Montague602e98a2020-10-21 16:20:00 -050054 label: this.$t('pageOverview.events.type'),
Yoshie Muranakace9a3ef2020-05-06 14:33:22 -070055 },
56 {
57 key: 'date',
Derick Montague602e98a2020-10-21 16:20:00 -050058 label: this.$t('pageOverview.events.date'),
Dixsie Wolmers9d40e302020-02-13 13:29:40 -060059 },
60 {
61 key: 'description',
Derick Montague602e98a2020-10-21 16:20:00 -050062 label: this.$t('pageOverview.events.description'),
63 },
64 ],
Dixsie Wolmers9d40e302020-02-13 13:29:40 -060065 };
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060066 },
Dixsie Wolmersf65ee342020-01-22 19:47:56 -060067 computed: {
68 eventLogData() {
Yoshie Muranaka1ace1d92020-02-06 13:47:28 -080069 return this.$store.getters['eventLog/highPriorityEvents'];
Derick Montague602e98a2020-10-21 16:20:00 -050070 },
Dixsie Wolmersf65ee342020-01-22 19:47:56 -060071 },
Derick Montague09e45cd2020-01-23 15:45:57 -060072 created() {
Yoshie Muranaka598bf7e2020-05-01 12:26:00 -070073 this.$store.dispatch('eventLog/getEventLogData').finally(() => {
74 this.$root.$emit('overview::events::complete');
75 });
Derick Montague602e98a2020-10-21 16:20:00 -050076 },
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060077};
78</script>