forked from halo-dev/halo
-
Notifications
You must be signed in to change notification settings - Fork 38
/
List.vue
30 lines (28 loc) · 1009 Bytes
/
List.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<script lang="ts" setup>
import { VButton, VEmpty, VLoading } from "@halo-dev/components";
import BackupListItem from "../components/BackupListItem.vue";
import { useBackupFetch } from "../composables/use-backup";
const { data: backups, isLoading, isFetching, refetch } = useBackupFetch();
</script>
<template>
<VLoading v-if="isLoading" />
<Transition v-else-if="!backups?.items?.length" appear name="fade">
<VEmpty
:message="$t('core.backup.empty.message')"
:title="$t('core.backup.empty.title')"
>
<template #actions>
<VButton :loading="isFetching" @click="refetch()">
{{ $t("core.common.buttons.refresh") }}
</VButton>
</template>
</VEmpty>
</Transition>
<Transition v-else appear name="fade">
<ul class="box-border h-full w-full divide-y divide-gray-100" role="list">
<li v-for="(backup, index) in backups?.items" :key="index">
<BackupListItem :backup="backup" />
</li>
</ul>
</Transition>
</template>