[enh] Filter by groups

This commit is contained in:
ljf (zamentur) 2021-07-05 07:10:58 +02:00 committed by GitHub
parent 8df88919e0
commit 40e61b5f59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,7 +48,7 @@ export default {
data () {
return {
queries: [
['GET', { uri: 'users' }]
['GET', { uri: 'users?fields=username&fields=fullname&fields=mail&fields=mailbox-quota&fields=shell&fields=groups' }]
],
search: ''
}
@ -61,7 +61,7 @@ export default {
if (!this.users) return
const search = this.search.toLowerCase()
const filtered = this.users.filter(user => {
return user.username.toLowerCase().includes(search)
return user.username.toLowerCase().includes(search) || user.groups.includes(search)
})
return filtered.length === 0 ? null : filtered
}