Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 1 | <template> |
Dixsie Wolmers | f65ee34 | 2020-01-22 19:47:56 -0600 | [diff] [blame] | 2 | <div> |
SurenNeware | 10fe276 | 2020-08-19 12:01:32 +0530 | [diff] [blame] | 3 | <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 Montague | b771849 | 2020-09-11 09:23:30 -0500 | [diff] [blame] | 13 | sort-by="id" |
SurenNeware | 10fe276 | 2020-08-19 12:01:32 +0530 | [diff] [blame] | 14 | sort-desc |
Sukanya Pandey | fde429e | 2020-09-14 20:48:39 +0530 | [diff] [blame] | 15 | hover |
SurenNeware | 10fe276 | 2020-08-19 12:01:32 +0530 | [diff] [blame] | 16 | responsive="md" |
SurenNeware | 5e9c391 | 2020-09-25 15:49:16 +0530 | [diff] [blame] | 17 | stacked="sm" |
SurenNeware | 10fe276 | 2020-08-19 12:01:32 +0530 | [diff] [blame] | 18 | show-empty |
| 19 | :items="eventLogData" |
| 20 | :fields="fields" |
| 21 | :empty-text="$t('pageOverview.events.noHighEventsMsg')" |
| 22 | > |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 23 | <template #cell(severity)="{ value }"> |
SurenNeware | 10fe276 | 2020-08-19 12:01:32 +0530 | [diff] [blame] | 24 | <status-icon status="danger" /> |
| 25 | {{ value }} |
| 26 | </template> |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 27 | <template #cell(date)="{ value }"> |
Dixsie Wolmers | 949cdd5 | 2020-08-24 21:36:37 -0500 | [diff] [blame] | 28 | <p class="mb-0">{{ value | formatDate }}</p> |
| 29 | <p class="mb-0">{{ value | formatTime }}</p> |
SurenNeware | 10fe276 | 2020-08-19 12:01:32 +0530 | [diff] [blame] | 30 | </template> |
| 31 | </b-table> |
Dixsie Wolmers | f65ee34 | 2020-01-22 19:47:56 -0600 | [diff] [blame] | 32 | </div> |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 33 | </template> |
| 34 | |
| 35 | <script> |
Yoshie Muranaka | ce9a3ef | 2020-05-06 14:33:22 -0700 | [diff] [blame] | 36 | import StatusIcon from '@/components/Global/StatusIcon'; |
| 37 | |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 38 | export default { |
Derick Montague | 09e45cd | 2020-01-23 15:45:57 -0600 | [diff] [blame] | 39 | name: 'Events', |
Yoshie Muranaka | ce9a3ef | 2020-05-06 14:33:22 -0700 | [diff] [blame] | 40 | components: { StatusIcon }, |
Dixsie Wolmers | 9d40e30 | 2020-02-13 13:29:40 -0600 | [diff] [blame] | 41 | data() { |
| 42 | return { |
| 43 | fields: [ |
| 44 | { |
Yoshie Muranaka | ce9a3ef | 2020-05-06 14:33:22 -0700 | [diff] [blame] | 45 | key: 'id', |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 46 | label: this.$t('pageOverview.events.id'), |
Dixsie Wolmers | 9d40e30 | 2020-02-13 13:29:40 -0600 | [diff] [blame] | 47 | }, |
| 48 | { |
Yoshie Muranaka | ce9a3ef | 2020-05-06 14:33:22 -0700 | [diff] [blame] | 49 | key: 'severity', |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 50 | label: this.$t('pageOverview.events.severity'), |
Dixsie Wolmers | 9d40e30 | 2020-02-13 13:29:40 -0600 | [diff] [blame] | 51 | }, |
| 52 | { |
Yoshie Muranaka | ce9a3ef | 2020-05-06 14:33:22 -0700 | [diff] [blame] | 53 | key: 'type', |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 54 | label: this.$t('pageOverview.events.type'), |
Yoshie Muranaka | ce9a3ef | 2020-05-06 14:33:22 -0700 | [diff] [blame] | 55 | }, |
| 56 | { |
| 57 | key: 'date', |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 58 | label: this.$t('pageOverview.events.date'), |
Dixsie Wolmers | 9d40e30 | 2020-02-13 13:29:40 -0600 | [diff] [blame] | 59 | }, |
| 60 | { |
| 61 | key: 'description', |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 62 | label: this.$t('pageOverview.events.description'), |
| 63 | }, |
| 64 | ], |
Dixsie Wolmers | 9d40e30 | 2020-02-13 13:29:40 -0600 | [diff] [blame] | 65 | }; |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 66 | }, |
Dixsie Wolmers | f65ee34 | 2020-01-22 19:47:56 -0600 | [diff] [blame] | 67 | computed: { |
| 68 | eventLogData() { |
Yoshie Muranaka | 1ace1d9 | 2020-02-06 13:47:28 -0800 | [diff] [blame] | 69 | return this.$store.getters['eventLog/highPriorityEvents']; |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 70 | }, |
Dixsie Wolmers | f65ee34 | 2020-01-22 19:47:56 -0600 | [diff] [blame] | 71 | }, |
Derick Montague | 09e45cd | 2020-01-23 15:45:57 -0600 | [diff] [blame] | 72 | created() { |
Yoshie Muranaka | 598bf7e | 2020-05-01 12:26:00 -0700 | [diff] [blame] | 73 | this.$store.dispatch('eventLog/getEventLogData').finally(() => { |
| 74 | this.$root.$emit('overview::events::complete'); |
| 75 | }); |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 76 | }, |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 77 | }; |
| 78 | </script> |