UI update

This commit is contained in:
Douglas Barone 2022-05-02 14:00:10 -04:00
parent f8ff438e5a
commit 15be4acd27

View File

@ -96,11 +96,12 @@
<span class="font-weight-medium mr-1">On-line</span>
</v-list-item-subtitle>
<v-list-item-subtitle>
<span v-if="userPresence.local" class="font-weight-medium">
<span v-if="userPresence.local">
<v-icon small>mdi-map-marker-account</v-icon>
{{ userPresence.local }}
</span>
<span v-else>
Próximo ao AP
<v-icon small>mdi-access-point</v-icon>
{{ userPresence.apName }}
</span>
</v-list-item-subtitle>
@ -291,13 +292,15 @@ export default {
watch: {
search(newValue) {
if (!newValue) this.$router.push({ query: {} })
else if (this.$route.query.search != newValue)
this.$router.push({ query: { search: newValue } })
if (this.$route.query.search != newValue) this.updateQuery()
},
onlyServants(newValue) {
if (this.$route.query.onlyServants != newValue) this.updateQuery()
}
},
mounted() {
this.search = this.$route.query.search || ''
this.onlyServants = this.$route.query.onlyServants === 'true'
},
apollo: {
userPresence: {
@ -357,6 +360,14 @@ export default {
RECENT: 'warning lighten-1',
OFFLINE: 'offline'
}[status]
},
updateQuery() {
this.$router.replace({
query: {
search: this.search,
onlyServants: this.onlyServants
}
})
}
}
}