blob: c2c7f4ada061a30122d2f2df6daf092d44706098 [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';
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050029
30export default {
31 name: 'Firmware',
32 components: {
33 OverviewCard,
34 },
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050035 mixins: [DataFormatterMixin],
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050036 computed: {
MichalX Szopinski112dbb22022-02-25 16:34:54 +010037 ...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 Wolmers6a192d52021-09-02 15:26:58 -050055 },
56 created() {
57 this.$store.dispatch('firmware/getFirmwareInformation').finally(() => {
58 this.$root.$emit('overview-firmware-complete');
59 });
60 },
61};
62</script>