summaryrefslogtreecommitdiffstats
path: root/glances/outputs/static/js/components/plugin-ip.vue
blob: 17be6b9303d3911919d52886e13238609b347f06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<template>
    <section id="ip" v-if="address != undefined">
        <span v-if="address != undefined" class="title">IP</span>
        <span v-if="address != undefined">{{ address }}/{{ maskCdir }}</span>
        <span v-if="publicAddress != undefined" class="title">Pub</span>
        <span v-if="publicAddress != undefined">{{ publicAddress }}</span>
        <span v-if="publicInfo != undefined">({{ publicInfo }})</span>
    </section>
</template>

<script>
export default {
    props: {
        data: {
            type: Object
        }
    },
    computed: {
        ipStats() {
            return this.data.stats['ip'];
        },
        address() {
            return this.ipStats.address;
        },
        gateway() {
            return this.ipStats.gateway;
        },
        // mask() {
        //     return this.ipStats.mask;
        // },
        maskCdir() {
            return this.ipStats.mask_cidr;
        },
        publicAddress() {
            return this.ipStats.public_address;
        },
        publicInfo() {
            return this.ipStats.public_info_human;
        }
    }
};
</script>