[Front] Refresh cloud list on setting change

This commit is contained in:
SebClem 2024-04-18 10:50:03 +02:00
parent 1b9d9d7aad
commit b87feaa8d9
Signed by: sebclem
GPG Key ID: 5A4308F6A359EA50
2 changed files with 15 additions and 5 deletions

View File

@ -2,7 +2,7 @@
<v-app>
<navbar-component></navbar-component>
<message-bar></message-bar>
<webdav-settings-menu></webdav-settings-menu>
<webdav-config-menu @saved="cloudList?.refreshBackup"></webdav-config-menu>
<backup-config-menu></backup-config-menu>
<alert-manager></alert-manager>
<v-main class="mx-12">
@ -11,7 +11,7 @@
<ha-list></ha-list>
</v-col>
<v-col cols="6">
<cloud-list></cloud-list>
<cloud-list ref="cloudList"></cloud-list>
</v-col>
</v-row>
</v-main>
@ -19,13 +19,16 @@
</template>
<script setup lang="ts">
import { ref } from "vue";
import AlertManager from "./components/AlertManager.vue";
import CloudList from "./components/cloud/CloudList.vue";
import HaList from "./components/homeAssistant/HaList.vue";
import MessageBar from "./components/MessageBar.vue";
import NavbarComponent from "./components/NavbarComponent.vue";
import BackupConfigMenu from "./components/settings/BackupConfigMenu.vue";
import WebdavSettingsMenu from "./components/settings/WebdavConfigMenu.vue";
import WebdavConfigMenu from "./components/settings/WebdavConfigMenu.vue";
import StatusComponent from "./components/StatusComponent.vue";
const cloudList = ref<InstanceType<typeof CloudList> | null>(null);
</script>
<style scoped></style>

View File

@ -53,6 +53,10 @@ let saveLoading = computed(() => {
return saving.value || loading.value;
});
const emit = defineEmits<{
(e: "saved"): void;
}>();
function save() {
saving.value = true;
form.value?.save();
@ -60,13 +64,16 @@ function save() {
function fail() {
saving.value = false;
alertStore.add("error", "Fail to save cloud settings !");
alertStore.add(
"error",
"Fail to connect to Cloud<br>Please check credentials !"
);
}
function saved() {
dialogStatusStore.webdav = false;
saving.value = false;
alertStore.add("success", "Cloud settings saved !");
emit("saved");
}
</script>
@/store/alert@/store/dialogStatus