mirror of
https://github.com/Sebclem/hassio-nextcloud-backup.git
synced 2024-12-24 15:06:43 +01:00
Add message on cloud delete
This commit is contained in:
parent
8510115686
commit
c043f27f93
@ -32,9 +32,9 @@
|
||||
<script setup lang="ts">
|
||||
import { useMenuSize } from "@/composable/menuSize";
|
||||
import { deleteWebdabBackup } from "@/services/webdavService";
|
||||
import { useAlertStore } from "@/store/alert";
|
||||
import type { WebdavBackup } from "@/types/webdav";
|
||||
import { computed, ref } from "vue";
|
||||
import { useDisplay } from "vuetify/dist/vuetify";
|
||||
import { ref } from "vue";
|
||||
|
||||
const dialog = ref(false);
|
||||
const loading = ref(false);
|
||||
@ -42,6 +42,11 @@ const item = ref<WebdavBackup | null>(null);
|
||||
|
||||
const { width, isFullScreen } = useMenuSize();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: "deleted"): void;
|
||||
}>();
|
||||
|
||||
const alertStore = useAlertStore();
|
||||
function confirm() {
|
||||
loading.value = true;
|
||||
if (item.value) {
|
||||
@ -49,9 +54,12 @@ function confirm() {
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
dialog.value = false;
|
||||
alertStore.add("success", "Backup deleted from cloud");
|
||||
emit("deleted");
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
alertStore.add("error", "Fail to deleted backup from cloud");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -76,7 +76,10 @@
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
<cloud-delete-dialog ref="deleteDialog"></cloud-delete-dialog>
|
||||
<cloud-delete-dialog
|
||||
ref="deleteDialog"
|
||||
@deleted="refreshBackup"
|
||||
></cloud-delete-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -69,4 +69,3 @@ function saved() {
|
||||
alertStore.add("success", "Backup settings saved !");
|
||||
}
|
||||
</script>
|
||||
@/store/dialogStatus@/store/alert
|
||||
|
Loading…
Reference in New Issue
Block a user