blob: 27a599b92cd694e7421461d8a52f02c9a76bf9f9 [file] [log] [blame]
Dixsie Wolmers97d86b32019-12-02 05:07:57 -06001<template>
Yoshie Muranaka3111b6f2020-04-21 19:48:38 -07002 <b-container fluid="xl">
Derick Montague09e45cd2020-01-23 15:45:57 -06003 <page-title />
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -05004 <div class="quicklinks-section">
5 <overview-quick-links />
6 </div>
Dixsie Wolmers97d86b32019-12-02 05:07:57 -06007 <b-row>
Dixsie Wolmers9d40e302020-02-13 13:29:40 -06008 <b-col>
Yoshie Muranaka547b5fc2020-02-24 15:42:40 -08009 <page-section :section-title="$t('pageOverview.bmcInformation')">
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060010 <b-row>
Dixsie Wolmers9d40e302020-02-13 13:29:40 -060011 <b-col>
12 <dl>
Yoshie Muranaka547b5fc2020-02-24 15:42:40 -080013 <dt>{{ $t('pageOverview.firmwareVersion') }}</dt>
Dixsie Wolmers46a87442020-02-26 15:26:30 -060014 <dd>{{ bmcFirmwareVersion }}</dd>
Dixsie Wolmers9d40e302020-02-13 13:29:40 -060015 </dl>
16 </b-col>
17 </b-row>
18 </page-section>
19 <b-row>
20 <b-col>
21 <page-section
Yoshie Muranaka547b5fc2020-02-24 15:42:40 -080022 :section-title="$t('pageOverview.networkInformation')"
Dixsie Wolmers9d40e302020-02-13 13:29:40 -060023 >
24 <overview-network />
25 </page-section>
26 </b-col>
27 </b-row>
28 </b-col>
29 <b-col>
Yoshie Muranaka547b5fc2020-02-24 15:42:40 -080030 <page-section :section-title="$t('pageOverview.serverInformation')">
Dixsie Wolmers9d40e302020-02-13 13:29:40 -060031 <b-row>
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060032 <b-col sm="6">
33 <dl>
Yoshie Muranaka547b5fc2020-02-24 15:42:40 -080034 <dt>{{ $t('pageOverview.model') }}</dt>
Dixsie Wolmersf65ee342020-01-22 19:47:56 -060035 <dd>{{ serverModel }}</dd>
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060036 </dl>
37 </b-col>
38 <b-col sm="6">
39 <dl>
Yoshie Muranaka547b5fc2020-02-24 15:42:40 -080040 <dt>{{ $t('pageOverview.manufacturer') }}</dt>
Dixsie Wolmersf65ee342020-01-22 19:47:56 -060041 <dd>{{ serverManufacturer }}</dd>
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060042 </dl>
43 </b-col>
44 <b-col sm="6">
45 <dl>
Yoshie Muranaka547b5fc2020-02-24 15:42:40 -080046 <dt>{{ $t('pageOverview.serialNumber') }}</dt>
Dixsie Wolmersf65ee342020-01-22 19:47:56 -060047 <dd>{{ serverSerialNumber }}</dd>
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060048 </dl>
49 </b-col>
50 <b-col sm="6">
51 <dl>
Yoshie Muranaka547b5fc2020-02-24 15:42:40 -080052 <dt>{{ $t('pageOverview.firmwareVersion') }}</dt>
Dixsie Wolmers46a87442020-02-26 15:26:30 -060053 <dd>{{ hostFirmwareVersion }}</dd>
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060054 </dl>
55 </b-col>
56 </b-row>
Derick Montague09e45cd2020-01-23 15:45:57 -060057 </page-section>
Yoshie Muranaka547b5fc2020-02-24 15:42:40 -080058 <page-section :section-title="$t('pageOverview.powerConsumption')">
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060059 <b-row>
60 <b-col sm="6">
61 <dl>
Yoshie Muranaka547b5fc2020-02-24 15:42:40 -080062 <dt>{{ $t('pageOverview.powerConsumption') }}</dt>
Dixsie Wolmers4c69f5b2020-02-26 11:23:52 -060063 <dd v-if="powerConsumptionValue == null">
64 {{ $t('global.status.notAvailable') }}
65 </dd>
66 <dd v-else>{{ powerConsumptionValue }} W</dd>
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060067 </dl>
68 </b-col>
69 <b-col sm="6">
70 <dl>
Yoshie Muranaka547b5fc2020-02-24 15:42:40 -080071 <dt>{{ $t('pageOverview.powerCap') }}</dt>
Dixsie Wolmers4c69f5b2020-02-26 11:23:52 -060072 <dd v-if="powerCapValue == null">
73 {{ $t('global.status.disabled') }}
74 </dd>
75 <dd v-else>{{ powerCapValue }} W</dd>
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060076 </dl>
77 </b-col>
78 </b-row>
Derick Montague09e45cd2020-01-23 15:45:57 -060079 </page-section>
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060080 </b-col>
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060081 </b-row>
Yoshie Muranaka547b5fc2020-02-24 15:42:40 -080082 <page-section :section-title="$t('pageOverview.highPriorityEvents')">
Derick Montague09e45cd2020-01-23 15:45:57 -060083 <overview-events />
84 </page-section>
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060085 </b-container>
86</template>
87
88<script>
Derick Montaguee2fd1562019-12-20 13:26:53 -060089import OverviewQuickLinks from './OverviewQuickLinks';
90import OverviewEvents from './OverviewEvents';
Dixsie Wolmers9d40e302020-02-13 13:29:40 -060091import OverviewNetwork from './OverviewNetwork';
SurenNeware61859092020-10-01 09:37:32 +053092import PageTitle from '@/components/Global/PageTitle';
93import PageSection from '@/components/Global/PageSection';
Derick Montaguee2fd1562019-12-20 13:26:53 -060094import { mapState } from 'vuex';
Yoshie Muranaka598bf7e2020-05-01 12:26:00 -070095import LoadingBarMixin from '@/components/Mixins/LoadingBarMixin';
Dixsie Wolmers9d40e302020-02-13 13:29:40 -060096
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060097export default {
Derick Montaguee2fd1562019-12-20 13:26:53 -060098 name: 'Overview',
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060099 components: {
Dixsie Wolmersf65ee342020-01-22 19:47:56 -0600100 OverviewQuickLinks,
101 OverviewEvents,
Dixsie Wolmers9d40e302020-02-13 13:29:40 -0600102 OverviewNetwork,
Yoshie Muranaka8d129102019-12-19 09:51:55 -0800103 PageTitle,
104 PageSection
Dixsie Wolmers97d86b32019-12-02 05:07:57 -0600105 },
Yoshie Muranaka598bf7e2020-05-01 12:26:00 -0700106 mixins: [LoadingBarMixin],
Yoshie Muranaka98bb24e2020-10-06 10:00:19 -0700107 data() {
108 return {
109 firmwareStoreModuleName: this.$store.hasModule('firmwareSingleImage')
110 ? 'firmwareSingleImage'
111 : 'firmware'
112 };
113 },
114 computed: {
115 ...mapState({
116 server: state => state.system.systems[0],
117 powerCapValue: state => state.powerControl.powerCapValue,
118 powerConsumptionValue: state => state.powerControl.powerConsumptionValue,
119 serverManufacturer() {
120 if (this.server) return this.server.manufacturer || '--';
121 return '--';
122 },
123 serverModel() {
124 if (this.server) return this.server.model || '--';
125 return '--';
126 },
127 serverSerialNumber() {
128 if (this.server) return this.server.serialNumber || '--';
129 return '--';
130 },
131 hostFirmwareVersion() {
132 if (this.server) return this.server.firmwareVersion || '--';
133 return '--';
134 }
135 }),
136 bmcFirmwareVersion() {
137 return this.$store.getters[
138 `${this.firmwareStoreModuleName}/bmcFirmwareCurrentVersion`
139 ];
Yoshie Muranakac687f102020-06-02 12:01:27 -0700140 }
Yoshie Muranaka98bb24e2020-10-06 10:00:19 -0700141 },
Derick Montague09e45cd2020-01-23 15:45:57 -0600142 created() {
Yoshie Muranaka598bf7e2020-05-01 12:26:00 -0700143 this.startLoader();
144 const quicklinksPromise = new Promise(resolve => {
145 this.$root.$on('overview::quicklinks::complete', () => resolve());
146 });
147 const networkPromise = new Promise(resolve => {
148 this.$root.$on('overview::network::complete', () => resolve());
149 });
150 const eventsPromise = new Promise(resolve => {
151 this.$root.$on('overview::events::complete', () => resolve());
152 });
153 Promise.all([
Yoshie Muranakac687f102020-06-02 12:01:27 -0700154 this.$store.dispatch('system/getSystem'),
Yoshie Muranaka98bb24e2020-10-06 10:00:19 -0700155 this.$store.dispatch(
156 `${this.firmwareStoreModuleName}/getFirmwareInformation`
157 ),
Yoshie Muranaka598bf7e2020-05-01 12:26:00 -0700158 this.$store.dispatch('powerControl/getPowerControl'),
159 quicklinksPromise,
160 networkPromise,
161 eventsPromise
162 ]).finally(() => this.endLoader());
Derick Montague09e45cd2020-01-23 15:45:57 -0600163 },
Yoshie Muranaka598bf7e2020-05-01 12:26:00 -0700164 beforeRouteLeave(to, from, next) {
165 this.hideLoader();
166 next();
Dixsie Wolmers97d86b32019-12-02 05:07:57 -0600167 }
168};
169</script>
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -0500170
171<style lang="scss" scoped>
172.quicklinks-section {
173 margin-bottom: $spacer * 2;
Dixsie Wolmers9d40e302020-02-13 13:29:40 -0600174 margin-left: $spacer * -1;
175}
176
177dd {
178 white-space: nowrap;
179 overflow: hidden;
180 text-overflow: ellipsis;
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -0500181}
182</style>