Minor Ui changes
This commit is contained in:
parent
e10cd72522
commit
0683a5e265
|
@ -15,6 +15,8 @@ const WifiDevice = {
|
||||||
})
|
})
|
||||||
).user,
|
).user,
|
||||||
|
|
||||||
|
usage: parent => parent.usage < 0 ? parent.usage * -1 : parent.usage,
|
||||||
|
|
||||||
accessPoint: async parent => {
|
accessPoint: async parent => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -1,13 +1,18 @@
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
|
|
||||||
function bytes(bytes, decimals, kib, maxUnit) {
|
function bytes(bytes, kib, maxUnit) {
|
||||||
console.log(bytes, decimals, kib, maxUnit)
|
const decimals = 1
|
||||||
|
|
||||||
kib = kib || false
|
kib = kib || false
|
||||||
|
|
||||||
|
if (bytes < 0) bytes = bytes * -1
|
||||||
|
|
||||||
if (bytes === 0) return '0 Bytes'
|
if (bytes === 0) return '0 Bytes'
|
||||||
|
|
||||||
if (isNaN(parseFloat(bytes)) && !isFinite(bytes)) return ''
|
if (isNaN(parseFloat(bytes)) && !isFinite(bytes)) return ''
|
||||||
|
|
||||||
const k = kib ? 1024 : 1000
|
const k = kib ? 1024 : 1000
|
||||||
const dm =
|
|
||||||
decimals != null && !isNaN(decimals) && decimals >= 0 ? decimals : 2
|
|
||||||
const sizes = kib
|
const sizes = kib
|
||||||
? ['Bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB', 'BiB']
|
? ['Bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB', 'BiB']
|
||||||
: ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB', 'BB']
|
: ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB', 'BB']
|
||||||
|
@ -16,7 +21,7 @@ function bytes(bytes, decimals, kib, maxUnit) {
|
||||||
const index = sizes.indexOf(maxUnit)
|
const index = sizes.indexOf(maxUnit)
|
||||||
if (index != -1) i = index
|
if (index != -1) i = index
|
||||||
}
|
}
|
||||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i]
|
return parseFloat((bytes / Math.pow(k, i)).toFixed(decimals)) + ' ' + sizes[i]
|
||||||
}
|
}
|
||||||
|
|
||||||
Vue.filter('bytes', bytes)
|
Vue.filter('bytes', bytes)
|
||||||
|
|
|
@ -89,7 +89,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #[`item.speed`]="{ item: { speed } }">
|
<template #[`item.speed`]="{ item: { speed } }">
|
||||||
{{ speed }} Mbps
|
{{ speed }} <small>Mbps</small>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #[`item.usage`]="{ item: { usage } }">
|
<template #[`item.usage`]="{ item: { usage } }">
|
||||||
|
@ -97,20 +97,23 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #[`item.protocol`]="{ item: { protocol } }">
|
<template #[`item.protocol`]="{ item: { protocol } }">
|
||||||
<code>{{ protocol || 'Indisponível' }}</code>
|
<code v-if="protocol">{{ protocol }}</code>
|
||||||
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #[`item.frequency`]="{ item: { frequency } }">
|
<template #[`item.frequency`]="{ item: { frequency } }">
|
||||||
{{ frequency || 'Indisponível' }}
|
{{ frequency || '-' }}
|
||||||
</template>
|
</template>
|
||||||
</v-data-table>
|
</v-data-table>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
<v-divider />
|
<v-divider />
|
||||||
<v-card-actions>
|
<v-card-actions>
|
||||||
<v-icon left>mdi-account-group</v-icon>
|
<v-icon small left>mdi-account-group</v-icon>
|
||||||
{{ accessPoint.wifiDevices.length }} clientes conectados
|
{{ accessPoint.wifiDevices.length }} clientes conectados
|
||||||
<v-spacer />
|
<v-spacer />
|
||||||
<v-btn color="primary" @click="showDialog = false"> Voltar </v-btn>
|
<v-btn color="primary" text @click="showDialog = false">
|
||||||
|
Voltar
|
||||||
|
</v-btn>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-dialog>
|
</v-dialog>
|
||||||
|
@ -136,10 +139,10 @@ export default {
|
||||||
{ text: 'Uptime', value: 'uptime' },
|
{ text: 'Uptime', value: 'uptime' },
|
||||||
{ text: 'Usuário', value: 'user' },
|
{ text: 'Usuário', value: 'user' },
|
||||||
{ text: 'Sinal', value: 'signalStrength' },
|
{ text: 'Sinal', value: 'signalStrength' },
|
||||||
{ text: 'Frequência', value: 'frequency' },
|
{ text: 'Frequência', value: 'frequency', align: 'end' },
|
||||||
{ text: 'Protocolo', value: 'protocol' },
|
{ text: 'Protocolo', value: 'protocol' },
|
||||||
{ text: 'Velocidade', value: 'speed' },
|
{ text: 'Velocidade', value: 'speed', align: 'end' },
|
||||||
{ text: 'Uso', value: 'usage' }
|
{ text: 'Uso', value: 'usage', align: 'end' }
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
watch: {
|
watch: {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user