blob: b4a8e90daa9dd742eb3818700eced0101b00deaa [file] [log] [blame]
Yoshie Muranaka7bc85e42021-02-11 09:59:13 -08001<template>
Yoshie Muranaka33d755f2021-02-18 15:24:14 -08002 <page-section :section-title="$t('pageFirmware.sectionTitleHostCards')">
Yoshie Muranaka7bc85e42021-02-11 09:59:13 -08003 <b-card-group deck>
4 <!-- Running image -->
5 <b-card>
6 <template #header>
7 <p class="font-weight-bold m-0">
Yoshie Muranaka33d755f2021-02-18 15:24:14 -08008 {{ $t('pageFirmware.cardTitleRunning') }}
Yoshie Muranaka7bc85e42021-02-11 09:59:13 -08009 </p>
10 </template>
11 <dl class="mb-0">
Yoshie Muranaka33d755f2021-02-18 15:24:14 -080012 <dt>{{ $t('pageFirmware.cardBodyVersion') }}</dt>
Yoshie Muranaka7bc85e42021-02-11 09:59:13 -080013 <dd class="mb-0">{{ runningVersion }}</dd>
14 </dl>
15 </b-card>
16
17 <!-- Backup image -->
18 <b-card>
19 <template #header>
20 <p class="font-weight-bold m-0">
Yoshie Muranaka33d755f2021-02-18 15:24:14 -080021 {{ $t('pageFirmware.cardTitleBackup') }}
Yoshie Muranaka7bc85e42021-02-11 09:59:13 -080022 </p>
23 </template>
24 <dl class="mb-0">
Yoshie Muranaka33d755f2021-02-18 15:24:14 -080025 <dt>{{ $t('pageFirmware.cardBodyVersion') }}</dt>
Yoshie Muranaka7bc85e42021-02-11 09:59:13 -080026 <dd class="mb-0">
27 <status-icon v-if="showBackupImageStatus" status="danger" />
28 <span v-if="showBackupImageStatus" class="sr-only">
29 {{ backupStatus }}
30 </span>
31 {{ backupVersion }}
32 </dd>
33 </dl>
34 </b-card>
35 </b-card-group>
36 </page-section>
37</template>
38
39<script>
40import PageSection from '@/components/Global/PageSection';
41
42export default {
43 components: { PageSection },
44 computed: {
45 running() {
Yoshie Muranaka33d755f2021-02-18 15:24:14 -080046 return this.$store.getters['firmware/activeHostFirmware'];
Yoshie Muranaka7bc85e42021-02-11 09:59:13 -080047 },
48 backup() {
Yoshie Muranaka33d755f2021-02-18 15:24:14 -080049 return this.$store.getters['firmware/backupHostFirmware'];
Yoshie Muranaka7bc85e42021-02-11 09:59:13 -080050 },
51 runningVersion() {
52 return this.running?.version || '--';
53 },
54 backupVersion() {
55 return this.backup?.version || '--';
56 },
57 backupStatus() {
58 return this.backup?.status || null;
59 },
60 showBackupImageStatus() {
61 return (
62 this.backupStatus === 'Critical' || this.backupStatus === 'Warning'
63 );
64 },
65 },
66};
67</script>
68
69<style lang="scss" scoped>
70.page-section {
71 margin-top: -$spacer * 1.5;
72}
73</style>