summaryrefslogtreecommitdiffstats
path: root/glances/outputs/static/js/components/plugin-cloud.vue
blob: 1cebc90365d249b426bde83c1262d899b5616a53 (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
<template>
    <section id="cloud" class="plugin" v-if="instance || provider">
        <span class="title">{{ provider }}</span> {{ instance }}
    </section>
</template>

<script>
export default {
    props: {
        data: {
            type: Object
        }
    },
    computed: {
        stats() {
            return this.data.stats['cloud'];
        },
        provider() {
            return this.stats['ami-id'] !== undefined ? 'AWS EC2' : null;
        },
        instance() {
            const { stats } = this;
            return this.stats['ami-id'] !== undefined
                ? `${stats['instance-type']} instance ${stats['instance-id']} (${stats['reggion']})`
                : null;
        }
    }
};
</script>