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