Dixsie Wolmers | 6a192d5 | 2021-09-02 15:26:58 -0500 | [diff] [blame] | 1 | <template> |
| 2 | <overview-card |
| 3 | :title="$t('pageOverview.firmwareInformation')" |
| 4 | :to="`/operations/firmware`" |
| 5 | > |
| 6 | <b-row class="mt-3"> |
MichalX Szopinski | 112dbb2 | 2022-02-25 16:34:54 +0100 | [diff] [blame] | 7 | <b-col sm="6"> |
Dixsie Wolmers | 6a192d5 | 2021-09-02 15:26:58 -0500 | [diff] [blame] | 8 | <dl> |
| 9 | <dt>{{ $t('pageOverview.runningVersion') }}</dt> |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 10 | <dd>{{ dataFormatter(runningVersion) }}</dd> |
Dixsie Wolmers | 6a192d5 | 2021-09-02 15:26:58 -0500 | [diff] [blame] | 11 | <dt>{{ $t('pageOverview.backupVersion') }}</dt> |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 12 | <dd>{{ dataFormatter(backupVersion) }}</dd> |
Dixsie Wolmers | 6a192d5 | 2021-09-02 15:26:58 -0500 | [diff] [blame] | 13 | </dl> |
| 14 | </b-col> |
MichalX Szopinski | 112dbb2 | 2022-02-25 16:34:54 +0100 | [diff] [blame] | 15 | <b-col sm="6"> |
| 16 | <dl> |
| 17 | <dt>{{ $t('pageOverview.firmwareVersion') }}</dt> |
| 18 | <dd>{{ dataFormatter(firmwareVersion) }}</dd> |
| 19 | </dl> |
| 20 | </b-col> |
Dixsie Wolmers | 6a192d5 | 2021-09-02 15:26:58 -0500 | [diff] [blame] | 21 | </b-row> |
| 22 | </overview-card> |
| 23 | </template> |
| 24 | |
| 25 | <script> |
| 26 | import OverviewCard from './OverviewCard'; |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 27 | import DataFormatterMixin from '@/components/Mixins/DataFormatterMixin'; |
MichalX Szopinski | 112dbb2 | 2022-02-25 16:34:54 +0100 | [diff] [blame] | 28 | import { mapState } from 'vuex'; |
Dixsie Wolmers | 6a192d5 | 2021-09-02 15:26:58 -0500 | [diff] [blame] | 29 | |
| 30 | export default { |
| 31 | name: 'Firmware', |
| 32 | components: { |
| 33 | OverviewCard, |
| 34 | }, |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 35 | mixins: [DataFormatterMixin], |
Dixsie Wolmers | 6a192d5 | 2021-09-02 15:26:58 -0500 | [diff] [blame] | 36 | computed: { |
MichalX Szopinski | 112dbb2 | 2022-02-25 16:34:54 +0100 | [diff] [blame] | 37 | ...mapState({ |
| 38 | server: (state) => state.system.systems[0], |
| 39 | backupBmcFirmware() { |
| 40 | return this.$store.getters['firmware/backupBmcFirmware']; |
| 41 | }, |
| 42 | backupVersion() { |
| 43 | return this.backupBmcFirmware?.version; |
| 44 | }, |
| 45 | activeBmcFirmware() { |
| 46 | return this.$store.getters[`firmware/activeBmcFirmware`]; |
| 47 | }, |
| 48 | firmwareVersion() { |
| 49 | return this.server?.firmwareVersion; |
| 50 | }, |
| 51 | runningVersion() { |
| 52 | return this.activeBmcFirmware?.version; |
| 53 | }, |
| 54 | }), |
Dixsie Wolmers | 6a192d5 | 2021-09-02 15:26:58 -0500 | [diff] [blame] | 55 | }, |
| 56 | created() { |
| 57 | this.$store.dispatch('firmware/getFirmwareInformation').finally(() => { |
| 58 | this.$root.$emit('overview-firmware-complete'); |
| 59 | }); |
| 60 | }, |
| 61 | }; |
| 62 | </script> |