Yoshie Muranaka | 92a0a4a | 2020-07-15 10:30:31 -0700 | [diff] [blame] | 1 | <template> |
| 2 | <b-container fluid="xl"> |
Yoshie Muranaka | 33d755f | 2021-02-18 15:24:14 -0800 | [diff] [blame] | 3 | <page-title /> |
| 4 | <alerts-server-power |
| 5 | v-if="isServerPowerOffRequired" |
Derick Montague | 71114fe | 2021-05-06 18:17:34 -0500 | [diff] [blame] | 6 | :is-server-off="isServerOff" |
Yoshie Muranaka | 33d755f | 2021-02-18 15:24:14 -0800 | [diff] [blame] | 7 | /> |
Yoshie Muranaka | 98bb24e | 2020-10-06 10:00:19 -0700 | [diff] [blame] | 8 | |
Yoshie Muranaka | 33d755f | 2021-02-18 15:24:14 -0800 | [diff] [blame] | 9 | <!-- Firmware cards --> |
| 10 | <b-row> |
| 11 | <b-col xl="10"> |
| 12 | <!-- BMC Firmware --> |
| 13 | <bmc-cards :is-page-disabled="isPageDisabled" /> |
Yoshie Muranaka | 98bb24e | 2020-10-06 10:00:19 -0700 | [diff] [blame] | 14 | |
Yoshie Muranaka | 33d755f | 2021-02-18 15:24:14 -0800 | [diff] [blame] | 15 | <!-- Host Firmware --> |
| 16 | <host-cards v-if="!isSingleFileUploadEnabled" /> |
Yoshie Muranaka | 92a0a4a | 2020-07-15 10:30:31 -0700 | [diff] [blame] | 17 | </b-col> |
| 18 | </b-row> |
| 19 | |
Yoshie Muranaka | 33d755f | 2021-02-18 15:24:14 -0800 | [diff] [blame] | 20 | <!-- 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 |
Derick Montague | 71114fe | 2021-05-06 18:17:34 -0500 | [diff] [blame] | 28 | :is-server-off="isServerOff" |
Yoshie Muranaka | 33d755f | 2021-02-18 15:24:14 -0800 | [diff] [blame] | 29 | :is-page-disabled="isPageDisabled" |
| 30 | /> |
| 31 | </b-col> |
| 32 | </b-row> |
| 33 | </page-section> |
Yoshie Muranaka | 92a0a4a | 2020-07-15 10:30:31 -0700 | [diff] [blame] | 34 | </b-container> |
| 35 | </template> |
| 36 | |
| 37 | <script> |
Yoshie Muranaka | 33d755f | 2021-02-18 15:24:14 -0800 | [diff] [blame] | 38 | import AlertsServerPower from './FirmwareAlertServerPower'; |
| 39 | import BmcCards from './FirmwareCardsBmc'; |
| 40 | import FormUpdate from './FirmwareFormUpdate'; |
| 41 | import HostCards from './FirmwareCardsHost'; |
Yoshie Muranaka | 92a0a4a | 2020-07-15 10:30:31 -0700 | [diff] [blame] | 42 | import PageSection from '@/components/Global/PageSection'; |
| 43 | import PageTitle from '@/components/Global/PageTitle'; |
Yoshie Muranaka | 92a0a4a | 2020-07-15 10:30:31 -0700 | [diff] [blame] | 44 | |
SurenNeware | ba91c49 | 2020-10-27 14:18:54 +0530 | [diff] [blame] | 45 | import LoadingBarMixin, { loading } from '@/components/Mixins/LoadingBarMixin'; |
Yoshie Muranaka | 92a0a4a | 2020-07-15 10:30:31 -0700 | [diff] [blame] | 46 | |
| 47 | export default { |
Yoshie Muranaka | 33d755f | 2021-02-18 15:24:14 -0800 | [diff] [blame] | 48 | name: 'FirmwareSingleImage', |
Yoshie Muranaka | 92a0a4a | 2020-07-15 10:30:31 -0700 | [diff] [blame] | 49 | components: { |
Yoshie Muranaka | 33d755f | 2021-02-18 15:24:14 -0800 | [diff] [blame] | 50 | AlertsServerPower, |
| 51 | BmcCards, |
| 52 | FormUpdate, |
| 53 | HostCards, |
Yoshie Muranaka | 92a0a4a | 2020-07-15 10:30:31 -0700 | [diff] [blame] | 54 | PageSection, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 55 | PageTitle, |
Yoshie Muranaka | 92a0a4a | 2020-07-15 10:30:31 -0700 | [diff] [blame] | 56 | }, |
Yoshie Muranaka | 33d755f | 2021-02-18 15:24:14 -0800 | [diff] [blame] | 57 | mixins: [LoadingBarMixin], |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 58 | beforeRouteLeave(to, from, next) { |
| 59 | this.hideLoader(); |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 60 | next(); |
| 61 | }, |
Yoshie Muranaka | 92a0a4a | 2020-07-15 10:30:31 -0700 | [diff] [blame] | 62 | data() { |
| 63 | return { |
Yoshie Muranaka | 33d755f | 2021-02-18 15:24:14 -0800 | [diff] [blame] | 64 | loading, |
| 65 | isServerPowerOffRequired: |
| 66 | process.env.VUE_APP_SERVER_OFF_REQUIRED === 'true', |
Yoshie Muranaka | 92a0a4a | 2020-07-15 10:30:31 -0700 | [diff] [blame] | 67 | }; |
| 68 | }, |
| 69 | computed: { |
Derick Montague | 71114fe | 2021-05-06 18:17:34 -0500 | [diff] [blame] | 70 | serverStatus() { |
| 71 | return this.$store.getters['global/serverStatus']; |
Yoshie Muranaka | 33d755f | 2021-02-18 15:24:14 -0800 | [diff] [blame] | 72 | }, |
Derick Montague | 71114fe | 2021-05-06 18:17:34 -0500 | [diff] [blame] | 73 | isServerOff() { |
| 74 | return this.serverStatus === 'off' ? true : false; |
Yoshie Muranaka | 33d755f | 2021-02-18 15:24:14 -0800 | [diff] [blame] | 75 | }, |
| 76 | isSingleFileUploadEnabled() { |
| 77 | return this.$store.getters['firmware/isSingleFileUploadEnabled']; |
| 78 | }, |
| 79 | isPageDisabled() { |
| 80 | if (this.isServerPowerOffRequired) { |
Derick Montague | 71114fe | 2021-05-06 18:17:34 -0500 | [diff] [blame] | 81 | return !this.isServerOff || this.loading || this.isOperationInProgress; |
Yoshie Muranaka | 33d755f | 2021-02-18 15:24:14 -0800 | [diff] [blame] | 82 | } |
| 83 | return this.loading || this.isOperationInProgress; |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 84 | }, |
Yoshie Muranaka | 92a0a4a | 2020-07-15 10:30:31 -0700 | [diff] [blame] | 85 | }, |
| 86 | created() { |
| 87 | this.startLoader(); |
Yoshie Muranaka | 98bb24e | 2020-10-06 10:00:19 -0700 | [diff] [blame] | 88 | this.$store |
| 89 | .dispatch('firmware/getFirmwareInformation') |
| 90 | .finally(() => this.endLoader()); |
Yoshie Muranaka | 92a0a4a | 2020-07-15 10:30:31 -0700 | [diff] [blame] | 91 | }, |
Yoshie Muranaka | 92a0a4a | 2020-07-15 10:30:31 -0700 | [diff] [blame] | 92 | }; |
| 93 | </script> |