Dixsie Wolmers | 6a192d5 | 2021-09-02 15:26:58 -0500 | [diff] [blame] | 1 | <template> |
| 2 | <overview-card |
| 3 | :title="$t('pageOverview.powerInformation')" |
| 4 | :to="`/resource-management/power`" |
| 5 | > |
| 6 | <b-row class="mt-3"> |
| 7 | <b-col sm="6"> |
| 8 | <dl> |
| 9 | <dt>{{ $t('pageOverview.powerConsumption') }}</dt> |
| 10 | <dd v-if="powerConsumptionValue == null"> |
| 11 | {{ $t('global.status.notAvailable') }} |
| 12 | </dd> |
| 13 | <dd v-else>{{ powerConsumptionValue }} W</dd> |
| 14 | <dt>{{ $t('pageOverview.powerCap') }}</dt> |
| 15 | <dd v-if="powerCapValue == null"> |
| 16 | {{ $t('global.status.disabled') }} |
| 17 | </dd> |
| 18 | <dd v-else>{{ powerCapValue }} W</dd> |
| 19 | </dl> |
| 20 | </b-col> |
Dixsie Wolmers | 6a192d5 | 2021-09-02 15:26:58 -0500 | [diff] [blame] | 21 | </b-row> |
| 22 | </overview-card> |
| 23 | </template> |
| 24 | |
| 25 | <script> |
| 26 | import OverviewCard from './OverviewCard'; |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 27 | import DataFormatterMixin from '@/components/Mixins/DataFormatterMixin'; |
Dixsie Wolmers | 6a192d5 | 2021-09-02 15:26:58 -0500 | [diff] [blame] | 28 | import { mapGetters } from 'vuex'; |
Ed Tanous | 883a0d5 | 2024-03-23 14:56:34 -0700 | [diff] [blame^] | 29 | import { useI18n } from 'vue-i18n'; |
Dixsie Wolmers | 6a192d5 | 2021-09-02 15:26:58 -0500 | [diff] [blame] | 30 | |
| 31 | export default { |
| 32 | name: 'Power', |
| 33 | components: { |
| 34 | OverviewCard, |
| 35 | }, |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 36 | mixins: [DataFormatterMixin], |
Ed Tanous | 883a0d5 | 2024-03-23 14:56:34 -0700 | [diff] [blame^] | 37 | data() { |
| 38 | return { |
| 39 | $t: useI18n().t, |
| 40 | }; |
| 41 | }, |
Dixsie Wolmers | 6a192d5 | 2021-09-02 15:26:58 -0500 | [diff] [blame] | 42 | computed: { |
| 43 | ...mapGetters({ |
| 44 | powerCapValue: 'powerControl/powerCapValue', |
| 45 | powerConsumptionValue: 'powerControl/powerConsumptionValue', |
| 46 | }), |
| 47 | }, |
| 48 | created() { |
| 49 | this.$store.dispatch('powerControl/getPowerControl').finally(() => { |
| 50 | this.$root.$emit('overview-power-complete'); |
| 51 | }); |
| 52 | }, |
| 53 | }; |
| 54 | </script> |