blob: 98597d16d8990fac0d8c29c38308adaf483ac395 (
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
<template>
<section id="mem" class="plugin">
<div class="table">
<div class="table-row">
<div class="table-cell text-left title">MEM</div>
<div class="table-cell" :class="getDecoration('percent')">{{ percent }}%</div>
</div>
<div class="table-row">
<div class="table-cell text-left">total:</div>
<div class="table-cell">{{ $filters.bytes(total) }}</div>
</div>
<div class="table-row">
<div class="table-cell text-left">used:</div>
<div class="table-cell" :class="getDecoration('used')">
{{ $filters.bytes(used, 2) }}
</div>
</div>
<div class="table-row">
<div class="table-cell text-left">free:</div>
<div class="table-cell">{{ $filters.bytes(free) }}</div>
</div>
</div>
</section>
</template>
<script>
export default {
props: {
data: {
type: Object
}
},
computed: {
stats() {
return this.data.stats['mem'];
},
view() {
return this.data.views['mem'];
},
percent() {
return this.stats['percent'];
},
total() {
return this.stats['total'];
},
used() {
return this.stats['used'];
},
free() {
return this.stats['free'];
}
},
methods: {
getDecoration(value) {
if (this.view[value] === undefined) {
return;
}
return this.view[value].decoration.toLowerCase();
}
}
};
</script>
|