blob: b81e5c7345aedbf752ff6f17816796f140b5054a [file] [log] [blame]
Dixsie Wolmers9d40e302020-02-13 13:29:40 -06001<template>
Dixsie Wolmers6a192d52021-09-02 15:26:58 -05002 <overview-card
Dixsie Wolmers182b3f12021-09-24 14:35:34 -05003 v-if="network"
Dixsie Wolmers6a192d52021-09-02 15:26:58 -05004 :title="$t('pageOverview.networkInformation')"
5 :to="`/settings/network`"
6 >
7 <b-row class="mt-3">
8 <b-col sm="6">
9 <dl>
Dixsie Wolmers182b3f12021-09-24 14:35:34 -050010 <dt>{{ $t('pageOverview.hostName') }}</dt>
11 <dd>{{ dataFormatter(network.hostname) }}</dd>
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050012 </dl>
13 </b-col>
14 <b-col sm="6">
15 <dl>
16 <dt>{{ $t('pageOverview.linkStatus') }}</dt>
17 <dd>
Dixsie Wolmers182b3f12021-09-24 14:35:34 -050018 {{ dataFormatter(network.linkStatus) }}
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050019 </dd>
20 </dl>
21 </b-col>
22 </b-row>
23 <b-row>
24 <b-col>
25 <dl>
26 <dt>{{ $t('pageOverview.ipv4') }}</dt>
27 <dd>
Dixsie Wolmers182b3f12021-09-24 14:35:34 -050028 {{ dataFormatter(network.staticAddress) }}
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050029 </dd>
30 </dl>
31 </b-col>
32 <b-col>
33 <dl>
34 <dt>{{ $t('pageOverview.dhcp') }}</dt>
35 <dd>
Dixsie Wolmers182b3f12021-09-24 14:35:34 -050036 {{
37 dataFormatter(
Konstantin Aladyshevb98a1332021-12-01 17:58:47 +030038 network.dhcpAddress.length !== 0
39 ? network.dhcpAddress[0].Address
40 : null
Dixsie Wolmers182b3f12021-09-24 14:35:34 -050041 )
42 }}
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050043 </dd>
44 </dl>
45 </b-col>
46 </b-row>
47 </overview-card>
Dixsie Wolmers9d40e302020-02-13 13:29:40 -060048</template>
49
50<script>
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050051import OverviewCard from './OverviewCard';
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050052import DataFormatterMixin from '@/components/Mixins/DataFormatterMixin';
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050053
Dixsie Wolmers9d40e302020-02-13 13:29:40 -060054export default {
55 name: 'Network',
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050056 components: {
57 OverviewCard,
58 },
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050059 mixins: [DataFormatterMixin],
Dixsie Wolmers9d40e302020-02-13 13:29:40 -060060 computed: {
Dixsie Wolmers182b3f12021-09-24 14:35:34 -050061 network() {
62 return this.$store.getters['network/globalNetworkSettings'][0];
63 },
Dixsie Wolmers9d40e302020-02-13 13:29:40 -060064 },
65 created() {
Sandeepa Singhf67f7692021-07-19 18:04:18 +053066 this.$store.dispatch('network/getEthernetData').finally(() => {
Sukanya Pandeyedb8a772020-10-29 11:33:42 +053067 this.$root.$emit('overview-network-complete');
Yoshie Muranaka598bf7e2020-05-01 12:26:00 -070068 });
Derick Montague602e98a2020-10-21 16:20:00 -050069 },
Dixsie Wolmers9d40e302020-02-13 13:29:40 -060070};
71</script>