blob: ac4848160cd54598c001b12281a1b5f12bdcba7e [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';
Derick Montaguee2fd1562019-12-20 13:26:53 -060092import PageTitle from '../../components/Global/PageTitle';
93import PageSection from '../../components/Global/PageSection';
94import { 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],
Dixsie Wolmersf65ee342020-01-22 19:47:56 -0600107 computed: mapState({
Yoshie Muranakac687f102020-06-02 12:01:27 -0700108 server: state => state.system.systems[0],
Yoshie Muranaka92a0a4a2020-07-15 10:30:31 -0700109 bmcFirmwareVersion: state => state.firmware.activeFirmware.version,
Dixsie Wolmers4c69f5b2020-02-26 11:23:52 -0600110 powerCapValue: state => state.powerControl.powerCapValue,
Yoshie Muranakac687f102020-06-02 12:01:27 -0700111 powerConsumptionValue: state => state.powerControl.powerConsumptionValue,
112 serverManufacturer() {
Dixsie Wolmersc3fb64e2020-07-01 12:41:28 -0500113 if (this.server) return this.server.manufacturer || '--';
114 return '--';
Yoshie Muranakac687f102020-06-02 12:01:27 -0700115 },
116 serverModel() {
Dixsie Wolmersc3fb64e2020-07-01 12:41:28 -0500117 if (this.server) return this.server.model || '--';
118 return '--';
Yoshie Muranakac687f102020-06-02 12:01:27 -0700119 },
120 serverSerialNumber() {
Dixsie Wolmersc3fb64e2020-07-01 12:41:28 -0500121 if (this.server) return this.server.serialNumber || '--';
122 return '--';
Yoshie Muranakac687f102020-06-02 12:01:27 -0700123 },
124 hostFirmwareVersion() {
Dixsie Wolmersc3fb64e2020-07-01 12:41:28 -0500125 if (this.server) return this.server.firmwareVersion || '--';
126 return '--';
Yoshie Muranakac687f102020-06-02 12:01:27 -0700127 }
Dixsie Wolmersf65ee342020-01-22 19:47:56 -0600128 }),
Derick Montague09e45cd2020-01-23 15:45:57 -0600129 created() {
Yoshie Muranaka598bf7e2020-05-01 12:26:00 -0700130 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 Muranakac687f102020-06-02 12:01:27 -0700141 this.$store.dispatch('system/getSystem'),
Yoshie Muranaka92a0a4a2020-07-15 10:30:31 -0700142 this.$store.dispatch('firmware/getSystemFirwareVersion'),
Yoshie Muranaka598bf7e2020-05-01 12:26:00 -0700143 this.$store.dispatch('powerControl/getPowerControl'),
144 quicklinksPromise,
145 networkPromise,
146 eventsPromise
147 ]).finally(() => this.endLoader());
Derick Montague09e45cd2020-01-23 15:45:57 -0600148 },
Yoshie Muranaka598bf7e2020-05-01 12:26:00 -0700149 beforeRouteLeave(to, from, next) {
150 this.hideLoader();
151 next();
Dixsie Wolmers97d86b32019-12-02 05:07:57 -0600152 }
153};
154</script>
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -0500155
156<style lang="scss" scoped>
157.quicklinks-section {
158 margin-bottom: $spacer * 2;
Dixsie Wolmers9d40e302020-02-13 13:29:40 -0600159 margin-left: $spacer * -1;
160}
161
162dd {
163 white-space: nowrap;
164 overflow: hidden;
165 text-overflow: ellipsis;
Dixsie Wolmers537c6cb2020-01-06 17:22:25 -0500166}
167</style>