diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..19f1dd2 --- /dev/null +++ b/.env.example @@ -0,0 +1,8 @@ +API_SECRET_KEY= +DISCORD_BOT_TOKEN= +DISCORD_CHANNEL_ID= +BACKUPS_REMOTE_HOST= +BACKUPS_REMOTE_ROOT= +BACKUPS_MAX_FILES= +DISK_COMMAND_REMOTE= +DISK_COMMAND_LOCAL= \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a6061a..08a4431 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +## [1.2.4](https://gitea.malio.fr/MALIO-DEV/Supervisor/compare/v1.2.3...v1.2.4) (2026-03-10) + + +### Bug Fixes + +* bundle latest backup downloads ([ffe463e](https://gitea.malio.fr/MALIO-DEV/Supervisor/commit/ffe463e13034601843446514abbd7c69cbaee081)) + +## [1.2.3](https://gitea.malio.fr/MALIO-DEV/Supervisor/compare/v1.2.2...v1.2.3) (2026-03-10) + + +### Bug Fixes + +* add scroll to backup history ([505ebd9](https://gitea.malio.fr/MALIO-DEV/Supervisor/commit/505ebd9325c0aa54adb034c012c45c913bb36d73)) +* restore backup history listing ([d0e39c9](https://gitea.malio.fr/MALIO-DEV/Supervisor/commit/d0e39c92b270993c99cde0eed8577c6dde817fdd)) + ## [1.2.2](https://gitea.malio.fr/MALIO-DEV/Supervisor/compare/v1.2.1...v1.2.2) (2026-03-10) diff --git a/components/BackupList.vue b/components/BackupList.vue index 9dcad3b..63a63ea 100644 --- a/components/BackupList.vue +++ b/components/BackupList.vue @@ -22,6 +22,13 @@ +
+ +

+ {{ errorMessage }} +

+
+

@@ -55,6 +62,7 @@ import {Icon as IconifyIcon} from "@iconify/vue" import CircleSkeleton from "~/components/skeleton/CircleSkeleton.vue" import TextSkeleton from "~/components/skeleton/TextSkeleton.vue" +import { apiFetch, downloadApiFile } from "~/composables/useApiAuth" const props = defineProps<{ folder: string | null @@ -62,31 +70,42 @@ const props = defineProps<{ const backups = ref([]) const loading = ref(false) +const errorMessage = ref("") const title = computed(() => { if (!props.folder) return "Fichiers" return `Backup — ${props.folder.toUpperCase()}` }) -const downloadBackup = (file: string) => { +const downloadBackup = async (file: string) => { if (!props.folder) return const url = `/api/download?folder=${encodeURIComponent(props.folder)}&file=${encodeURIComponent(file)}` - window.location.href = url + errorMessage.value = "" + + try { + await downloadApiFile(url, file) + } catch (error) { + console.error("Erreur telechargement backup:", error) + errorMessage.value = "Erreur lors de l'opération" + } } watch(() => props.folder, async (folder) => { if (!folder) { loading.value = false backups.value = [] + errorMessage.value = "" return } loading.value = true + errorMessage.value = "" try { - const data = await $fetch(`/api/backups?folder=${encodeURIComponent(folder)}`) + const data = await apiFetch(`/api/backups?folder=${encodeURIComponent(folder)}`) backups.value = data } catch (error) { console.error("Erreur récupération backups:", error) backups.value = [] + errorMessage.value = "Erreur lors de l'opération" } finally { loading.value = false } @@ -120,6 +139,12 @@ watch(() => props.folder, async (folder) => { padding: 2.5rem 1rem; } +.error-state { + border-radius: 8px; + border: 1px solid rgb(var(--m-error) / 0.12); + background: rgb(var(--m-error) / 0.06); +} + .file-list { display: flex; flex-direction: column; diff --git a/components/BackupRun.vue b/components/BackupRun.vue index cae972c..d3eb365 100644 --- a/components/BackupRun.vue +++ b/components/BackupRun.vue @@ -79,6 +79,8 @@