blob: 74a737e20af1f7adf353e3ecaf5808c4e7a019f6 [file] [log] [blame]
Dixsie Wolmers6a192d52021-09-02 15:26:58 -05001<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 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';
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050028import { mapGetters } from 'vuex';
Ed Tanous883a0d52024-03-23 14:56:34 -070029import { useI18n } from 'vue-i18n';
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050030
31export default {
32 name: 'Power',
33 components: {
34 OverviewCard,
35 },
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050036 mixins: [DataFormatterMixin],
Ed Tanous883a0d52024-03-23 14:56:34 -070037 data() {
38 return {
39 $t: useI18n().t,
40 };
41 },
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050042 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>