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