cloduflare
This commit is contained in:
@@ -233,6 +233,10 @@
|
||||
</div>
|
||||
<div class="flex justify-end gap-3 pt-2 border-t">
|
||||
<button type="button" @click="configModal=false" class="px-4 py-2 border rounded text-sm">Cancelar</button>
|
||||
<button type="button" @click="verifyToken()" :disabled="loading"
|
||||
class="px-4 py-2 border border-orange-400 text-orange-600 rounded text-sm hover:bg-orange-50">
|
||||
Verificar token
|
||||
</button>
|
||||
<button type="submit" :disabled="loading" class="px-5 py-2 text-white text-sm rounded"
|
||||
style="background-color:#8eb02f">
|
||||
<span x-text="loading ? 'Guardando…' : 'Guardar'"></span>
|
||||
@@ -328,6 +332,18 @@ document.addEventListener('alpine:init', () => {
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
async verifyToken() {
|
||||
this.loading = true;
|
||||
try {
|
||||
const res = await axios.get('/app/cloudflare/verify');
|
||||
const status = res.data?.data?.status || 'active';
|
||||
this.showToast('Token válido — estado: ' + status);
|
||||
} catch (e) {
|
||||
this.showToast(e.response?.data?.error || 'Token inválido o sin permisos', 'error');
|
||||
}
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
showToast(msg, type = 'ok') {
|
||||
this.toast = { show: true, msg, type };
|
||||
setTimeout(() => this.toast.show = false, 3500);
|
||||
|
||||
Reference in New Issue
Block a user