blob: 0be920fe882e32803b30cf1e4e51c2aa6de3f545 [file] [log] [blame]
Dixsie Wolmers6a192d52021-09-02 15:26:58 -05001<template>
2 <overview-card
3 :title="$t('pageOverview.firmwareInformation')"
4 :to="`/operations/firmware`"
5 >
6 <b-row class="mt-3">
MichalX Szopinski112dbb22022-02-25 16:34:54 +01007 <b-col sm="6">
Dixsie Wolmers6a192d52021-09-02 15:26:58 -05008 <dl>
9 <dt>{{ $t('pageOverview.runningVersion') }}</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050010 <dd>{{ dataFormatter(runningVersion) }}</dd>
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050011 <dt>{{ $t('pageOverview.backupVersion') }}</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050012 <dd>{{ dataFormatter(backupVersion) }}</dd>
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050013 </dl>
14 </b-col>
MichalX Szopinski112dbb22022-02-25 16:34:54 +010015 <b-col sm="6">
16 <dl>
17 <dt>{{ $t('pageOverview.firmwareVersion') }}</dt>
18 <dd>{{ dataFormatter(firmwareVersion) }}</dd>
19 </dl>
20 </b-col>
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050021 </b-row>
22 </overview-card>
23</template>
24
25<script>
26import OverviewCard from './OverviewCard';
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050027import DataFormatterMixin from '@/components/Mixins/DataFormatterMixin';
MichalX Szopinski112dbb22022-02-25 16:34:54 +010028import { mapState } from 'vuex';
Ed Tanous883a0d52024-03-23 14:56:34 -070029import { useI18n } from 'vue-i18n';
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050030
31export default {
32 name: 'Firmware',
33 components: {
34 OverviewCard,
35 },
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050036 mixins: [DataFormatterMixin],
Ed Tanous883a0d52024-03-23 14:56:34 -070037 data() {
38 return {
39 $t: useI18n().t,
40 };
41 },
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050042 computed: {
MichalX Szopinski112dbb22022-02-25 16:34:54 +010043 ...mapState({
44 server: (state) => state.system.systems[0],
45 backupBmcFirmware() {
46 return this.$store.getters['firmware/backupBmcFirmware'];
47 },
48 backupVersion() {
49 return this.backupBmcFirmware?.version;
50 },
51 activeBmcFirmware() {
52 return this.$store.getters[`firmware/activeBmcFirmware`];
53 },
54 firmwareVersion() {
55 return this.server?.firmwareVersion;
56 },
57 runningVersion() {
58 return this.activeBmcFirmware?.version;
59 },
60 }),
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050061 },
62 created() {
63 this.$store.dispatch('firmware/getFirmwareInformation').finally(() => {
64 this.$root.$emit('overview-firmware-complete');
65 });
66 },
67};
68</script>