blob: 0d84c76cb8a4258253130a7ed8f552c9d348ccc8 [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';
29
30export default {
31 name: 'Power',
32 components: {
33 OverviewCard,
34 },
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050035 mixins: [DataFormatterMixin],
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050036 computed: {
37 ...mapGetters({
38 powerCapValue: 'powerControl/powerCapValue',
39 powerConsumptionValue: 'powerControl/powerConsumptionValue',
40 }),
41 },
42 created() {
43 this.$store.dispatch('powerControl/getPowerControl').finally(() => {
44 this.$root.$emit('overview-power-complete');
45 });
46 },
47};
48</script>