Yoshie Muranaka | 7bc85e4 | 2021-02-11 09:59:13 -0800 | [diff] [blame^] | 1 | <template> |
| 2 | <page-section |
| 3 | :section-title="$t('pageFirmware.singleFileUpload.sectionTitleHostCards')" |
| 4 | > |
| 5 | <b-card-group deck> |
| 6 | <!-- Running image --> |
| 7 | <b-card> |
| 8 | <template #header> |
| 9 | <p class="font-weight-bold m-0"> |
| 10 | {{ $t('pageFirmware.singleFileUpload.cardTitleRunning') }} |
| 11 | </p> |
| 12 | </template> |
| 13 | <dl class="mb-0"> |
| 14 | <dt>{{ $t('pageFirmware.singleFileUpload.cardBodyVersion') }}</dt> |
| 15 | <dd class="mb-0">{{ runningVersion }}</dd> |
| 16 | </dl> |
| 17 | </b-card> |
| 18 | |
| 19 | <!-- Backup image --> |
| 20 | <b-card> |
| 21 | <template #header> |
| 22 | <p class="font-weight-bold m-0"> |
| 23 | {{ $t('pageFirmware.singleFileUpload.cardTitleBackup') }} |
| 24 | </p> |
| 25 | </template> |
| 26 | <dl class="mb-0"> |
| 27 | <dt>{{ $t('pageFirmware.singleFileUpload.cardBodyVersion') }}</dt> |
| 28 | <dd class="mb-0"> |
| 29 | <status-icon v-if="showBackupImageStatus" status="danger" /> |
| 30 | <span v-if="showBackupImageStatus" class="sr-only"> |
| 31 | {{ backupStatus }} |
| 32 | </span> |
| 33 | {{ backupVersion }} |
| 34 | </dd> |
| 35 | </dl> |
| 36 | </b-card> |
| 37 | </b-card-group> |
| 38 | </page-section> |
| 39 | </template> |
| 40 | |
| 41 | <script> |
| 42 | import PageSection from '@/components/Global/PageSection'; |
| 43 | |
| 44 | export default { |
| 45 | components: { PageSection }, |
| 46 | computed: { |
| 47 | running() { |
| 48 | return this.$store.getters['firmwareSingleImage/activeHostFirmware']; |
| 49 | }, |
| 50 | backup() { |
| 51 | return this.$store.getters['firmwareSingleImage/backupHostFirmware']; |
| 52 | }, |
| 53 | runningVersion() { |
| 54 | return this.running?.version || '--'; |
| 55 | }, |
| 56 | backupVersion() { |
| 57 | return this.backup?.version || '--'; |
| 58 | }, |
| 59 | backupStatus() { |
| 60 | return this.backup?.status || null; |
| 61 | }, |
| 62 | showBackupImageStatus() { |
| 63 | return ( |
| 64 | this.backupStatus === 'Critical' || this.backupStatus === 'Warning' |
| 65 | ); |
| 66 | }, |
| 67 | }, |
| 68 | }; |
| 69 | </script> |
| 70 | |
| 71 | <style lang="scss" scoped> |
| 72 | .page-section { |
| 73 | margin-top: -$spacer * 1.5; |
| 74 | } |
| 75 | </style> |