Change presence layout

This commit is contained in:
Douglas Barone 2020-12-04 09:39:48 -04:00
parent 3dfbbe9264
commit 7f763020c7
2 changed files with 57 additions and 43 deletions

View File

@ -1,47 +1,61 @@
<template>
<div v-if="!loading">
<v-list three-line>
<v-fade-transition group hide-on-leave appear>
<v-list-item
v-for="userPresence in userPresences"
:key="userPresence.user.id"
>
<v-list-item-avatar size="52px" style="overflow: visible">
<v-badge
:color="
userPresence.wifiDevices.some(wifiDevice => wifiDevice.isOnline)
? 'green'
: 'grey'
"
bottom
offset-x="18px"
offset-y="18px"
>
<Avatar :src="userPresence.user.thumbnailPhoto" size="52px" />
</v-badge>
</v-list-item-avatar>
<transition-group
name="scale-transition"
tag="div"
class="d-flex flex-wrap"
>
<v-col
v-for="userPresence in userPresences"
:key="userPresence.user.id"
cols="12"
md="6"
>
<v-card rounded outlined>
<v-list three-line>
<v-list-item>
<v-list-item-avatar size="52px" style="overflow: visible">
<v-badge
:color="
userPresence.wifiDevices.some(
wifiDevice => wifiDevice.isOnline
)
? 'green'
: 'grey'
"
bottom
offset-x="18px"
offset-y="18px"
>
<Avatar :src="userPresence.user.thumbnailPhoto" size="52px" />
</v-badge>
</v-list-item-avatar>
<v-list-item-content>
<v-list-item-title>
{{ userPresence.user.displayName }}
</v-list-item-title>
<v-list-item-subtitle v-if="!userPresence.wifiDevices[0].isOnline">
<span class="font-weight-medium">Off-line.</span>
Visto {{ userPresence.wifiDevices[0].lastSeen | from }}
</v-list-item-subtitle>
<v-list-item-subtitle v-else>
<span class="font-weight-medium">On-line</span>
</v-list-item-subtitle>
<v-list-item-subtitle>
Próximo ao AP
<span class="font-weight-medium"
>{{ userPresence.wifiDevices[0].apName }}
</span>
</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
</v-fade-transition>
</v-list>
<v-list-item-content>
<v-list-item-title>
{{ userPresence.user.displayName }}
</v-list-item-title>
<v-list-item-subtitle
v-if="!userPresence.wifiDevices[0].isOnline"
>
<span class="font-weight-medium">Off-line.</span>
Visto {{ userPresence.wifiDevices[0].lastSeen | from }}
</v-list-item-subtitle>
<v-list-item-subtitle v-else>
<span class="font-weight-medium">On-line</span>
</v-list-item-subtitle>
<v-list-item-subtitle>
Próximo ao AP
<span class="font-weight-medium"
>{{ userPresence.wifiDevices[0].apName }}
</span>
</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
</v-list>
</v-card>
</v-col>
</transition-group>
</div>
<v-list v-else>
<v-divider />

View File

@ -29,7 +29,7 @@
text
large
block
@click="resultSize = resultSize + 5"
@click="resultSize += 10"
>
Mostrar mais
</v-btn>
@ -56,7 +56,7 @@ export default {
components: { UserPresenceStatusList },
data: () => ({
search: '',
resultSize: 5
resultSize: 10
}),
apollo: {
userPresence: {