blob: e27c8a262daeea2b3a4449f59b15dcc0f35a6edb [file] [log] [blame]
Yoshie Muranaka92a0a4a2020-07-15 10:30:31 -07001<template>
2 <b-container fluid="xl">
Yoshie Muranaka33d755f2021-02-18 15:24:14 -08003 <page-title />
4 <alerts-server-power
5 v-if="isServerPowerOffRequired"
6 :is-host-off="isHostOff"
7 />
Yoshie Muranaka98bb24e2020-10-06 10:00:19 -07008
Yoshie Muranaka33d755f2021-02-18 15:24:14 -08009 <!-- Firmware cards -->
10 <b-row>
11 <b-col xl="10">
12 <!-- BMC Firmware -->
13 <bmc-cards :is-page-disabled="isPageDisabled" />
Yoshie Muranaka98bb24e2020-10-06 10:00:19 -070014
Yoshie Muranaka33d755f2021-02-18 15:24:14 -080015 <!-- Host Firmware -->
16 <host-cards v-if="!isSingleFileUploadEnabled" />
Yoshie Muranaka92a0a4a2020-07-15 10:30:31 -070017 </b-col>
18 </b-row>
19
Yoshie Muranaka33d755f2021-02-18 15:24:14 -080020 <!-- Update firmware-->
21 <page-section
22 :section-title="$t('pageFirmware.sectionTitleUpdateFirmware')"
23 >
24 <b-row>
25 <b-col sm="8" md="6" xl="4">
26 <!-- Update form -->
27 <form-update
28 :is-host-off="isHostOff"
29 :is-page-disabled="isPageDisabled"
30 />
31 </b-col>
32 </b-row>
33 </page-section>
Yoshie Muranaka92a0a4a2020-07-15 10:30:31 -070034 </b-container>
35</template>
36
37<script>
Yoshie Muranaka33d755f2021-02-18 15:24:14 -080038import AlertsServerPower from './FirmwareAlertServerPower';
39import BmcCards from './FirmwareCardsBmc';
40import FormUpdate from './FirmwareFormUpdate';
41import HostCards from './FirmwareCardsHost';
Yoshie Muranaka92a0a4a2020-07-15 10:30:31 -070042import PageSection from '@/components/Global/PageSection';
43import PageTitle from '@/components/Global/PageTitle';
Yoshie Muranaka92a0a4a2020-07-15 10:30:31 -070044
SurenNewareba91c492020-10-27 14:18:54 +053045import LoadingBarMixin, { loading } from '@/components/Mixins/LoadingBarMixin';
Yoshie Muranaka92a0a4a2020-07-15 10:30:31 -070046
47export default {
Yoshie Muranaka33d755f2021-02-18 15:24:14 -080048 name: 'FirmwareSingleImage',
Yoshie Muranaka92a0a4a2020-07-15 10:30:31 -070049 components: {
Yoshie Muranaka33d755f2021-02-18 15:24:14 -080050 AlertsServerPower,
51 BmcCards,
52 FormUpdate,
53 HostCards,
Yoshie Muranaka92a0a4a2020-07-15 10:30:31 -070054 PageSection,
Derick Montague602e98a2020-10-21 16:20:00 -050055 PageTitle,
Yoshie Muranaka92a0a4a2020-07-15 10:30:31 -070056 },
Yoshie Muranaka33d755f2021-02-18 15:24:14 -080057 mixins: [LoadingBarMixin],
Derick Montague602e98a2020-10-21 16:20:00 -050058 beforeRouteLeave(to, from, next) {
59 this.hideLoader();
Derick Montague602e98a2020-10-21 16:20:00 -050060 next();
61 },
Yoshie Muranaka92a0a4a2020-07-15 10:30:31 -070062 data() {
63 return {
Yoshie Muranaka33d755f2021-02-18 15:24:14 -080064 loading,
65 isServerPowerOffRequired:
66 process.env.VUE_APP_SERVER_OFF_REQUIRED === 'true',
Yoshie Muranaka92a0a4a2020-07-15 10:30:31 -070067 };
68 },
69 computed: {
Yoshie Muranaka33d755f2021-02-18 15:24:14 -080070 hostStatus() {
71 return this.$store.getters['global/hostStatus'];
72 },
73 isHostOff() {
74 return this.hostStatus === 'off' ? true : false;
75 },
76 isSingleFileUploadEnabled() {
77 return this.$store.getters['firmware/isSingleFileUploadEnabled'];
78 },
79 isPageDisabled() {
80 if (this.isServerPowerOffRequired) {
81 return !this.isHostOff || this.loading || this.isOperationInProgress;
82 }
83 return this.loading || this.isOperationInProgress;
Derick Montague602e98a2020-10-21 16:20:00 -050084 },
Yoshie Muranaka92a0a4a2020-07-15 10:30:31 -070085 },
86 created() {
87 this.startLoader();
Yoshie Muranaka98bb24e2020-10-06 10:00:19 -070088 this.$store
89 .dispatch('firmware/getFirmwareInformation')
90 .finally(() => this.endLoader());
Yoshie Muranaka92a0a4a2020-07-15 10:30:31 -070091 },
Yoshie Muranaka92a0a4a2020-07-15 10:30:31 -070092};
93</script>