blob: b907d0b6192dc053316d6ad2ad8610d5f427acb1 (
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
|
<template>
<section class="plugin" id="wifi">
<div class="table-row" v-if="hotspots.length > 0">
<div class="table-cell text-left title">WIFI</div>
<div class="table-cell"></div>
<div class="table-cell">dBm</div>
</div>
<div class="table-row" v-for="(hotspot, hotspotId) in hotspots" :key="hotspotId">
<div class="table-cell text-left">
{{ $filters.limitTo(hotspot.ssid, 20) }}
</div>
<div class="table-cell"></div>
<div class="table-cell" :class="getDecoration(hotspot, 'quality_level')">
{{ hotspot.quality_level }}
</div>
</div>
</section>
</template>
<script>
import { orderBy } from 'lodash';
export default {
props: {
data: {
type: Object
}
},
computed: {
stats() {
return this.data.stats['wifi'];
},
view() {
return this.data.views['wifi'];
},
hotspots() {
const hotspots = this.stats
.map((hotspotData) => {
if (hotspotData['ssid'] === '') {
return;
}
return {
ssid: hotspotData['ssid'],
quality_level: hotspotData['quality_level']
};
})
.filter(Boolean);
return orderBy(hotspots, ['ssid']);
}
},
methods: {
getDecoration(hotpost, field) {
if (this.view[hotpost.ssid][field] === undefined) {
return;
}
return this.view[hotpost.ssid][field].decoration.toLowerCase();
}
}
};
</script>
|