Refactor UserPresence view

This commit is contained in:
Douglas Barone 2020-11-30 13:51:24 -04:00
parent 093c7f3a7e
commit c4efe7f168

View File

@ -1,13 +1,12 @@
<template> <template>
<div v-if="!loading"> <div v-if="!loading">
<v-divider /> <v-list three-line>
<v-fade-transition group hide-on-leave appear> <v-fade-transition group hide-on-leave appear>
<v-sheet <v-list-item
v-for="userPresence in userPresences" v-for="userPresence in userPresences"
:key="userPresence.user.id" :key="userPresence.user.id"
link
> >
<v-list three-line>
<v-list-item>
<v-list-item-avatar size="52px" style="overflow: visible"> <v-list-item-avatar size="52px" style="overflow: visible">
<v-badge <v-badge
:color=" :color="
@ -43,41 +42,11 @@
<span class="font-weight-medium" <span class="font-weight-medium"
>{{ userPresence.wifiDevices[0].apName }} >{{ userPresence.wifiDevices[0].apName }}
</span> </span>
<ApIcon :controller="userPresence.wifiDevices[0].controller" />
</v-list-item-subtitle> </v-list-item-subtitle>
</v-list-item-content> </v-list-item-content>
<v-list-item-icon>
<span v-if="$vuetify.breakpoint.smAndUp" class="ml-1">
<v-badge
color="green"
bottom
:content="
userPresence.wifiDevices
.filter(wifiDevice => wifiDevice.status === 'ONLINE')
.length.toString()
"
>
<v-icon color="green">mdi-wifi</v-icon>
</v-badge>
<v-badge
class="mx-4"
color="grey"
bottom
:content="
userPresence.wifiDevices
.filter(wifiDevice => wifiDevice.status === 'OFFLINE')
.length.toString()
"
>
<v-icon color="grey">mdi-wifi</v-icon>
</v-badge>
</span>
</v-list-item-icon>
</v-list-item> </v-list-item>
</v-list>
<v-divider />
</v-sheet>
</v-fade-transition> </v-fade-transition>
</v-list>
</div> </div>
<v-list v-else> <v-list v-else>
<v-divider /> <v-divider />
@ -97,11 +66,10 @@
<script> <script>
import Avatar from './Avatar' import Avatar from './Avatar'
import ApIcon from './ApIcon'
export default { export default {
name: 'UserPresenceStatusList', name: 'UserPresenceStatusList',
components: { Avatar, ApIcon }, components: { Avatar },
props: { props: {
userPresences: { userPresences: {
type: Array, type: Array,