summaryrefslogtreecommitdiffstats
path: root/glances/outputs/static/js/components/plugin-processcount.vue
blob: a331ef87b24e3a710d59672d27a2999cdd850d6e (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
43
44
<template>
    <section id="processcount" class="plugin">
        <span class="title">TASKS</span>
        <span>{{ total }} ({{ thread }} thr),</span>
        <span>{{ running }} run,</span>
        <span>{{ sleeping }} slp,</span>
        <span>{{ stopped }} oth</span>
        <span class="title">{{ sorter.auto ? 'sorted automatically' : 'sorted' }}</span>
        <span>by {{ sorter.getColumnLabel(sorter.column) }}</span>
    </section>
</template>

<script>
export default {
    props: {
        data: {
            type: Object
        },
        sorter: {
            type: Object
        }
    },
    computed: {
        stats() {
            return this.data.stats['processcount'];
        },
        total() {
            return this.stats['total'] || 0;
        },
        running() {
            return this.stats['running'] || 0;
        },
        sleeping() {
            return this.stats['sleeping'] || 0;
        },
        stopped() {
            return this.stats['stopped'] || 0;
        },
        thread() {
            return this.stats['thread'] || 0;
        }
    }
};
</script>