ff-admin/src/views/admin/management/backup/GeneratedBackup.vue

49 lines
1.5 KiB
Vue
Raw Normal View History

2025-02-02 16:37:46 +01:00
<template>
2025-02-03 11:03:38 +01:00
<div class="flex flex-col gap-4 h-full pl-7">
<div class="flex flex-col gap-2 grow overflow-y-scroll pr-7">
<BackupListItem v-for="backup in backups" :key="backup" :backup="backup" />
</div>
<div class="flex flex-row gap-4">
2025-04-12 15:17:44 +02:00
<button v-if="can('create', 'management', 'backup')" primary class="w-fit!" @click="openCreateModal">
2025-02-03 11:03:38 +01:00
Backup erstellen
</button>
</div>
</div>
2025-02-02 16:37:46 +01:00
</template>
<script setup lang="ts">
import { defineAsyncComponent, defineComponent, markRaw } from "vue";
import { mapState, mapActions } from "pinia";
import MainTemplate from "@/templates/Main.vue";
2025-02-15 11:08:09 +01:00
import { useBackupStore } from "@/stores/admin/management/backup";
import BackupListItem from "@/components/admin/management/backup/BackupListItem.vue";
2025-02-02 16:37:46 +01:00
import { useModalStore } from "@/stores/modal";
import { useAbilityStore } from "@/stores/ability";
</script>
<script lang="ts">
export default defineComponent({
computed: {
...mapState(useBackupStore, ["backups"]),
...mapState(useAbilityStore, ["can"]),
},
mounted() {
this.fetchBackups();
},
methods: {
...mapActions(useBackupStore, ["fetchBackups"]),
...mapActions(useModalStore, ["openModal"]),
openCreateModal() {
this.openModal(
2025-02-15 11:08:09 +01:00
markRaw(defineAsyncComponent(() => import("@/components/admin/management/backup/CreateBackupModal.vue")))
2025-02-02 16:37:46 +01:00
);
},
openUploadModal() {
this.openModal(
2025-02-15 11:08:09 +01:00
markRaw(defineAsyncComponent(() => import("@/components/admin/management/backup/UploadBackupModal.vue")))
2025-02-02 16:37:46 +01:00
);
},
},
});
</script>