hassio-nextcloud-backup/nextcloud_backup/frontend/src/components/settings/WebdavConfigMenu.vue

63 lines
1.6 KiB
Vue
Raw Normal View History

2022-10-24 22:58:19 +02:00
<template>
<v-dialog
v-model="dialogStatusStore.webdav"
persistent
:width="width"
2023-01-13 16:18:27 +01:00
:fullscreen="isFullScreen"
2022-10-24 22:58:19 +02:00
scrollable
>
<v-card>
<v-card-title class="text-center">Cloud Settings</v-card-title>
<v-divider></v-divider>
<v-card-text>
<webdav-settings-form
ref="form"
@fail="saving = false"
2023-01-13 16:18:27 +01:00
@success="saved"
2022-10-24 22:58:19 +02:00
@loaded="loading = false"
@loading="loading = true"
2022-10-24 22:58:19 +02:00
></webdav-settings-form>
</v-card-text>
<v-divider></v-divider>
<v-card-actions class="justify-end">
<v-btn
color="red"
@click="dialogStatusStore.webdav = false"
:disabled="saving"
>Cancel</v-btn
>
<v-btn color="success" @click="save()" :loading="saveLoading"
>Save</v-btn
>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script setup lang="ts">
2023-01-13 16:18:27 +01:00
import { useMenuSize } from "@/composable/menuSize";
2022-10-24 22:58:19 +02:00
import { useDialogStatusStore } from "@/stores/dialogStatus";
import { computed, ref } from "vue";
import WebdavSettingsForm from "./WebdavConfigForm.vue";
const dialogStatusStore = useDialogStatusStore();
const form = ref<InstanceType<typeof WebdavSettingsForm> | null>(null);
2023-01-13 16:18:27 +01:00
const { width, isFullScreen } = useMenuSize();
2022-10-24 22:58:19 +02:00
const loading = ref(true);
const saving = ref(false);
let saveLoading = computed(() => {
return saving.value || loading.value;
});
function save() {
saving.value = true;
form.value?.save();
}
2023-01-13 16:18:27 +01:00
function saved() {
dialogStatusStore.webdav = false;
saving.value = false;
}
2022-10-24 22:58:19 +02:00
</script>