2024-04-19 16:22:30 +02:00
|
|
|
<template>
|
|
|
|
<v-card border>
|
|
|
|
<v-card-title class="text-center">Action</v-card-title>
|
|
|
|
<v-divider class="border-opacity-25"></v-divider>
|
|
|
|
<v-card-text>
|
2024-08-02 16:07:58 +02:00
|
|
|
<v-row>
|
|
|
|
<v-col class="d-flex justify-center">
|
|
|
|
<v-btn
|
|
|
|
block
|
|
|
|
color="success"
|
|
|
|
@click="launchBackup"
|
|
|
|
prepend-icon="mdi-cloud-plus"
|
|
|
|
>
|
|
|
|
Backup Now
|
|
|
|
</v-btn>
|
|
|
|
</v-col>
|
|
|
|
<v-col class="d-flex justify-center">
|
|
|
|
<v-btn
|
|
|
|
block
|
|
|
|
color="orange-darken-3"
|
|
|
|
@click="launchClean"
|
|
|
|
prepend-icon="mdi-broom"
|
|
|
|
>
|
|
|
|
Clean
|
|
|
|
</v-btn>
|
|
|
|
</v-col>
|
|
|
|
</v-row>
|
2024-04-19 16:22:30 +02:00
|
|
|
</v-card-text>
|
|
|
|
</v-card>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2024-08-02 15:56:07 +02:00
|
|
|
import { backupNow, clean } from "@/services/actionService";
|
2024-04-19 16:22:30 +02:00
|
|
|
import { useAlertStore } from "@/store/alert";
|
|
|
|
|
|
|
|
const alertStore = useAlertStore();
|
|
|
|
|
|
|
|
function launchBackup() {
|
|
|
|
backupNow()
|
|
|
|
.then(() => {
|
|
|
|
alertStore.add("success", "Backup workflow started !");
|
|
|
|
})
|
|
|
|
.catch(() => {
|
|
|
|
alertStore.add("error", "Fail to start backup workflow !");
|
|
|
|
});
|
|
|
|
}
|
2024-08-02 15:56:07 +02:00
|
|
|
|
|
|
|
function launchClean() {
|
|
|
|
clean()
|
|
|
|
.then(() => {
|
|
|
|
alertStore.add("success", "Backup workflow started !");
|
|
|
|
})
|
|
|
|
.catch(() => {
|
|
|
|
alertStore.add("error", "Fail to start backup workflow !");
|
|
|
|
});
|
|
|
|
}
|
2024-04-19 16:22:30 +02:00
|
|
|
</script>
|