1<template>
2  <overview-card
3    :title="$t('pageOverview.firmwareInformation')"
4    :to="`/operations/firmware`"
5  >
6    <b-row class="mt-3">
7      <b-col sm="6">
8        <dl>
9          <dt>{{ $t('pageOverview.runningVersion') }}</dt>
10          <dd>{{ dataFormatter(runningVersion) }}</dd>
11          <dt>{{ $t('pageOverview.backupVersion') }}</dt>
12          <dd>{{ dataFormatter(backupVersion) }}</dd>
13        </dl>
14      </b-col>
15      <b-col sm="6">
16        <dl>
17          <dt>{{ $t('pageOverview.firmwareVersion') }}</dt>
18          <dd>{{ dataFormatter(firmwareVersion) }}</dd>
19        </dl>
20      </b-col>
21    </b-row>
22  </overview-card>
23</template>
24
25<script>
26import OverviewCard from './OverviewCard';
27import DataFormatterMixin from '@/components/Mixins/DataFormatterMixin';
28import { mapState } from 'vuex';
29
30export default {
31  name: 'Firmware',
32  components: {
33    OverviewCard,
34  },
35  mixins: [DataFormatterMixin],
36  computed: {
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    }),
55  },
56  created() {
57    this.$store.dispatch('firmware/getFirmwareInformation').finally(() => {
58      this.$root.$emit('overview-firmware-complete');
59    });
60  },
61};
62</script>
63