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>
21    </b-row>
22  </overview-card>
23</template>
24
25<script>
26import OverviewCard from './OverviewCard';
27import DataFormatterMixin from '@/components/Mixins/DataFormatterMixin';
28import { mapGetters } from 'vuex';
29
30export default {
31  name: 'Power',
32  components: {
33    OverviewCard,
34  },
35  mixins: [DataFormatterMixin],
36  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>
49