Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 1 | <template> |
Yoshie Muranaka | 3111b6f | 2020-04-21 19:48:38 -0700 | [diff] [blame] | 2 | <b-container fluid="xl"> |
Derick Montague | 09e45cd | 2020-01-23 15:45:57 -0600 | [diff] [blame] | 3 | <page-title /> |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 4 | <div class="quicklinks-section"> |
| 5 | <overview-quick-links /> |
| 6 | </div> |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 7 | <b-row> |
Dixsie Wolmers | 9d40e30 | 2020-02-13 13:29:40 -0600 | [diff] [blame] | 8 | <b-col> |
Yoshie Muranaka | 547b5fc | 2020-02-24 15:42:40 -0800 | [diff] [blame] | 9 | <page-section :section-title="$t('pageOverview.bmcInformation')"> |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 10 | <b-row> |
Dixsie Wolmers | 9d40e30 | 2020-02-13 13:29:40 -0600 | [diff] [blame] | 11 | <b-col> |
| 12 | <dl> |
Yoshie Muranaka | 547b5fc | 2020-02-24 15:42:40 -0800 | [diff] [blame] | 13 | <dt>{{ $t('pageOverview.firmwareVersion') }}</dt> |
Dixsie Wolmers | 46a8744 | 2020-02-26 15:26:30 -0600 | [diff] [blame] | 14 | <dd>{{ bmcFirmwareVersion }}</dd> |
Dixsie Wolmers | 9d40e30 | 2020-02-13 13:29:40 -0600 | [diff] [blame] | 15 | </dl> |
| 16 | </b-col> |
| 17 | </b-row> |
| 18 | </page-section> |
| 19 | <b-row> |
| 20 | <b-col> |
| 21 | <page-section |
Yoshie Muranaka | 547b5fc | 2020-02-24 15:42:40 -0800 | [diff] [blame] | 22 | :section-title="$t('pageOverview.networkInformation')" |
Dixsie Wolmers | 9d40e30 | 2020-02-13 13:29:40 -0600 | [diff] [blame] | 23 | > |
| 24 | <overview-network /> |
| 25 | </page-section> |
| 26 | </b-col> |
| 27 | </b-row> |
| 28 | </b-col> |
| 29 | <b-col> |
Yoshie Muranaka | 547b5fc | 2020-02-24 15:42:40 -0800 | [diff] [blame] | 30 | <page-section :section-title="$t('pageOverview.serverInformation')"> |
Dixsie Wolmers | 9d40e30 | 2020-02-13 13:29:40 -0600 | [diff] [blame] | 31 | <b-row> |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 32 | <b-col sm="6"> |
| 33 | <dl> |
Yoshie Muranaka | 547b5fc | 2020-02-24 15:42:40 -0800 | [diff] [blame] | 34 | <dt>{{ $t('pageOverview.model') }}</dt> |
Dixsie Wolmers | f65ee34 | 2020-01-22 19:47:56 -0600 | [diff] [blame] | 35 | <dd>{{ serverModel }}</dd> |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 36 | </dl> |
| 37 | </b-col> |
| 38 | <b-col sm="6"> |
| 39 | <dl> |
Yoshie Muranaka | 547b5fc | 2020-02-24 15:42:40 -0800 | [diff] [blame] | 40 | <dt>{{ $t('pageOverview.manufacturer') }}</dt> |
Dixsie Wolmers | f65ee34 | 2020-01-22 19:47:56 -0600 | [diff] [blame] | 41 | <dd>{{ serverManufacturer }}</dd> |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 42 | </dl> |
| 43 | </b-col> |
| 44 | <b-col sm="6"> |
| 45 | <dl> |
Yoshie Muranaka | 547b5fc | 2020-02-24 15:42:40 -0800 | [diff] [blame] | 46 | <dt>{{ $t('pageOverview.serialNumber') }}</dt> |
Dixsie Wolmers | f65ee34 | 2020-01-22 19:47:56 -0600 | [diff] [blame] | 47 | <dd>{{ serverSerialNumber }}</dd> |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 48 | </dl> |
| 49 | </b-col> |
| 50 | <b-col sm="6"> |
| 51 | <dl> |
Yoshie Muranaka | 547b5fc | 2020-02-24 15:42:40 -0800 | [diff] [blame] | 52 | <dt>{{ $t('pageOverview.firmwareVersion') }}</dt> |
Dixsie Wolmers | 46a8744 | 2020-02-26 15:26:30 -0600 | [diff] [blame] | 53 | <dd>{{ hostFirmwareVersion }}</dd> |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 54 | </dl> |
| 55 | </b-col> |
| 56 | </b-row> |
Derick Montague | 09e45cd | 2020-01-23 15:45:57 -0600 | [diff] [blame] | 57 | </page-section> |
Yoshie Muranaka | 547b5fc | 2020-02-24 15:42:40 -0800 | [diff] [blame] | 58 | <page-section :section-title="$t('pageOverview.powerConsumption')"> |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 59 | <b-row> |
| 60 | <b-col sm="6"> |
| 61 | <dl> |
Yoshie Muranaka | 547b5fc | 2020-02-24 15:42:40 -0800 | [diff] [blame] | 62 | <dt>{{ $t('pageOverview.powerConsumption') }}</dt> |
Dixsie Wolmers | 4c69f5b | 2020-02-26 11:23:52 -0600 | [diff] [blame] | 63 | <dd v-if="powerConsumptionValue == null"> |
| 64 | {{ $t('global.status.notAvailable') }} |
| 65 | </dd> |
| 66 | <dd v-else>{{ powerConsumptionValue }} W</dd> |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 67 | </dl> |
| 68 | </b-col> |
| 69 | <b-col sm="6"> |
| 70 | <dl> |
Yoshie Muranaka | 547b5fc | 2020-02-24 15:42:40 -0800 | [diff] [blame] | 71 | <dt>{{ $t('pageOverview.powerCap') }}</dt> |
Dixsie Wolmers | 4c69f5b | 2020-02-26 11:23:52 -0600 | [diff] [blame] | 72 | <dd v-if="powerCapValue == null"> |
| 73 | {{ $t('global.status.disabled') }} |
| 74 | </dd> |
| 75 | <dd v-else>{{ powerCapValue }} W</dd> |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 76 | </dl> |
| 77 | </b-col> |
| 78 | </b-row> |
Derick Montague | 09e45cd | 2020-01-23 15:45:57 -0600 | [diff] [blame] | 79 | </page-section> |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 80 | </b-col> |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 81 | </b-row> |
Yoshie Muranaka | 547b5fc | 2020-02-24 15:42:40 -0800 | [diff] [blame] | 82 | <page-section :section-title="$t('pageOverview.highPriorityEvents')"> |
Derick Montague | 09e45cd | 2020-01-23 15:45:57 -0600 | [diff] [blame] | 83 | <overview-events /> |
| 84 | </page-section> |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 85 | </b-container> |
| 86 | </template> |
| 87 | |
| 88 | <script> |
Derick Montague | e2fd156 | 2019-12-20 13:26:53 -0600 | [diff] [blame] | 89 | import OverviewQuickLinks from './OverviewQuickLinks'; |
| 90 | import OverviewEvents from './OverviewEvents'; |
Dixsie Wolmers | 9d40e30 | 2020-02-13 13:29:40 -0600 | [diff] [blame] | 91 | import OverviewNetwork from './OverviewNetwork'; |
Derick Montague | e2fd156 | 2019-12-20 13:26:53 -0600 | [diff] [blame] | 92 | import PageTitle from '../../components/Global/PageTitle'; |
| 93 | import PageSection from '../../components/Global/PageSection'; |
| 94 | import { mapState } from 'vuex'; |
Yoshie Muranaka | 598bf7e | 2020-05-01 12:26:00 -0700 | [diff] [blame] | 95 | import LoadingBarMixin from '@/components/Mixins/LoadingBarMixin'; |
Dixsie Wolmers | 9d40e30 | 2020-02-13 13:29:40 -0600 | [diff] [blame] | 96 | |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 97 | export default { |
Derick Montague | e2fd156 | 2019-12-20 13:26:53 -0600 | [diff] [blame] | 98 | name: 'Overview', |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 99 | components: { |
Dixsie Wolmers | f65ee34 | 2020-01-22 19:47:56 -0600 | [diff] [blame] | 100 | OverviewQuickLinks, |
| 101 | OverviewEvents, |
Dixsie Wolmers | 9d40e30 | 2020-02-13 13:29:40 -0600 | [diff] [blame] | 102 | OverviewNetwork, |
Yoshie Muranaka | 8d12910 | 2019-12-19 09:51:55 -0800 | [diff] [blame] | 103 | PageTitle, |
| 104 | PageSection |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 105 | }, |
Yoshie Muranaka | 598bf7e | 2020-05-01 12:26:00 -0700 | [diff] [blame] | 106 | mixins: [LoadingBarMixin], |
Dixsie Wolmers | f65ee34 | 2020-01-22 19:47:56 -0600 | [diff] [blame] | 107 | computed: mapState({ |
Yoshie Muranaka | c687f10 | 2020-06-02 12:01:27 -0700 | [diff] [blame] | 108 | server: state => state.system.systems[0], |
Yoshie Muranaka | 92a0a4a | 2020-07-15 10:30:31 -0700 | [diff] [blame] | 109 | bmcFirmwareVersion: state => state.firmware.activeFirmware.version, |
Dixsie Wolmers | 4c69f5b | 2020-02-26 11:23:52 -0600 | [diff] [blame] | 110 | powerCapValue: state => state.powerControl.powerCapValue, |
Yoshie Muranaka | c687f10 | 2020-06-02 12:01:27 -0700 | [diff] [blame] | 111 | powerConsumptionValue: state => state.powerControl.powerConsumptionValue, |
| 112 | serverManufacturer() { |
Dixsie Wolmers | c3fb64e | 2020-07-01 12:41:28 -0500 | [diff] [blame] | 113 | if (this.server) return this.server.manufacturer || '--'; |
| 114 | return '--'; |
Yoshie Muranaka | c687f10 | 2020-06-02 12:01:27 -0700 | [diff] [blame] | 115 | }, |
| 116 | serverModel() { |
Dixsie Wolmers | c3fb64e | 2020-07-01 12:41:28 -0500 | [diff] [blame] | 117 | if (this.server) return this.server.model || '--'; |
| 118 | return '--'; |
Yoshie Muranaka | c687f10 | 2020-06-02 12:01:27 -0700 | [diff] [blame] | 119 | }, |
| 120 | serverSerialNumber() { |
Dixsie Wolmers | c3fb64e | 2020-07-01 12:41:28 -0500 | [diff] [blame] | 121 | if (this.server) return this.server.serialNumber || '--'; |
| 122 | return '--'; |
Yoshie Muranaka | c687f10 | 2020-06-02 12:01:27 -0700 | [diff] [blame] | 123 | }, |
| 124 | hostFirmwareVersion() { |
Dixsie Wolmers | c3fb64e | 2020-07-01 12:41:28 -0500 | [diff] [blame] | 125 | if (this.server) return this.server.firmwareVersion || '--'; |
| 126 | return '--'; |
Yoshie Muranaka | c687f10 | 2020-06-02 12:01:27 -0700 | [diff] [blame] | 127 | } |
Dixsie Wolmers | f65ee34 | 2020-01-22 19:47:56 -0600 | [diff] [blame] | 128 | }), |
Derick Montague | 09e45cd | 2020-01-23 15:45:57 -0600 | [diff] [blame] | 129 | created() { |
Yoshie Muranaka | 598bf7e | 2020-05-01 12:26:00 -0700 | [diff] [blame] | 130 | this.startLoader(); |
| 131 | const quicklinksPromise = new Promise(resolve => { |
| 132 | this.$root.$on('overview::quicklinks::complete', () => resolve()); |
| 133 | }); |
| 134 | const networkPromise = new Promise(resolve => { |
| 135 | this.$root.$on('overview::network::complete', () => resolve()); |
| 136 | }); |
| 137 | const eventsPromise = new Promise(resolve => { |
| 138 | this.$root.$on('overview::events::complete', () => resolve()); |
| 139 | }); |
| 140 | Promise.all([ |
Yoshie Muranaka | c687f10 | 2020-06-02 12:01:27 -0700 | [diff] [blame] | 141 | this.$store.dispatch('system/getSystem'), |
Yoshie Muranaka | 92a0a4a | 2020-07-15 10:30:31 -0700 | [diff] [blame] | 142 | this.$store.dispatch('firmware/getSystemFirwareVersion'), |
Yoshie Muranaka | 598bf7e | 2020-05-01 12:26:00 -0700 | [diff] [blame] | 143 | this.$store.dispatch('powerControl/getPowerControl'), |
| 144 | quicklinksPromise, |
| 145 | networkPromise, |
| 146 | eventsPromise |
| 147 | ]).finally(() => this.endLoader()); |
Derick Montague | 09e45cd | 2020-01-23 15:45:57 -0600 | [diff] [blame] | 148 | }, |
Yoshie Muranaka | 598bf7e | 2020-05-01 12:26:00 -0700 | [diff] [blame] | 149 | beforeRouteLeave(to, from, next) { |
| 150 | this.hideLoader(); |
| 151 | next(); |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 152 | } |
| 153 | }; |
| 154 | </script> |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 155 | |
| 156 | <style lang="scss" scoped> |
| 157 | .quicklinks-section { |
| 158 | margin-bottom: $spacer * 2; |
Dixsie Wolmers | 9d40e30 | 2020-02-13 13:29:40 -0600 | [diff] [blame] | 159 | margin-left: $spacer * -1; |
| 160 | } |
| 161 | |
| 162 | dd { |
| 163 | white-space: nowrap; |
| 164 | overflow: hidden; |
| 165 | text-overflow: ellipsis; |
Dixsie Wolmers | 537c6cb | 2020-01-06 17:22:25 -0500 | [diff] [blame] | 166 | } |
| 167 | </style> |