mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
refactor: rework async UserList
This commit is contained in:
parent
9dcdc654b9
commit
06ce2a5bec
1 changed files with 6 additions and 13 deletions
|
@ -1,15 +1,13 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import api from '@/api'
|
||||||
import { useUsersAndGroups } from '@/composables/data'
|
import { useUsersAndGroups } from '@/composables/data'
|
||||||
import { useInfos } from '@/composables/useInfos'
|
import { useInfos } from '@/composables/useInfos'
|
||||||
import { useInitialQueries } from '@/composables/useInitialQueries'
|
|
||||||
import { useSearch } from '@/composables/useSearch'
|
import { useSearch } from '@/composables/useSearch'
|
||||||
|
|
||||||
const { loading } = useInitialQueries([
|
await api.get({
|
||||||
{
|
|
||||||
uri: 'users?fields=username&fields=fullname&fields=mail&fields=mailbox-quota&fields=groups',
|
uri: 'users?fields=username&fields=fullname&fields=mail&fields=mailbox-quota&fields=groups',
|
||||||
cachePath: 'users',
|
cachePath: 'users',
|
||||||
},
|
})
|
||||||
])
|
|
||||||
|
|
||||||
const { users } = useUsersAndGroups()
|
const { users } = useUsersAndGroups()
|
||||||
const [search, filteredUsers] = useSearch(
|
const [search, filteredUsers] = useSearch(
|
||||||
|
@ -25,12 +23,7 @@ function downloadExport() {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ViewSearch
|
<ViewSearch v-model="search" :items="filteredUsers" items-name="users">
|
||||||
v-model="search"
|
|
||||||
:items="filteredUsers"
|
|
||||||
items-name="users"
|
|
||||||
:loading="loading"
|
|
||||||
>
|
|
||||||
<template #top-bar-buttons>
|
<template #top-bar-buttons>
|
||||||
<BButton variant="info" :to="{ name: 'group-list' }">
|
<BButton variant="info" :to="{ name: 'group-list' }">
|
||||||
<YIcon iname="key-modern" /> {{ $t('groups_and_permissions_manage') }}
|
<YIcon iname="key-modern" /> {{ $t('groups_and_permissions_manage') }}
|
||||||
|
|
Loading…
Add table
Reference in a new issue