Some checks failed
Telegram Mini App Shop Builder / Compute version metadata (push) Has been cancelled
Telegram Mini App Shop Builder / Run Frontend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run Backend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run PHP_CodeSniffer (push) Has been cancelled
Telegram Mini App Shop Builder / Build module. (push) Has been cancelled
Telegram Mini App Shop Builder / release (push) Has been cancelled
41 lines
874 B
Vue
41 lines
874 B
Vue
<template>
|
||
<Button
|
||
icon="fa fa-refresh"
|
||
severity="warn"
|
||
v-tooltip.top="'Сбросить кеш модуля'"
|
||
:loading="isLoading"
|
||
@click="resetCache"
|
||
/>
|
||
</template>
|
||
|
||
<script setup>
|
||
import {Button, useToast} from "primevue";
|
||
import {ref} from "vue";
|
||
import {apiPost} from "@/utils/http.js";
|
||
|
||
const isLoading = ref(false);
|
||
const toast = useToast();
|
||
|
||
async function resetCache() {
|
||
isLoading.value = true;
|
||
|
||
const response = await apiPost('resetCache');
|
||
if (response.success) {
|
||
toast.add({
|
||
severity: 'success',
|
||
summary: 'Выполнено',
|
||
detail: 'Кеш модуля сброшен.',
|
||
life: 3000
|
||
});
|
||
} else {
|
||
toast.add({
|
||
severity: 'error',
|
||
summary: 'Ошибка',
|
||
detail: 'Ошибка при сбросе кеша.',
|
||
life: 3000
|
||
});
|
||
}
|
||
isLoading.value = false;
|
||
}
|
||
</script>
|