6b688f72e0
Internal cron is now triggered by an axios request from the frontend so it can truly run in a separate request. Fixes #167
41 lines
954 B
Vue
41 lines
954 B
Vue
<script setup lang="ts">
|
|
// import AuthLayout from '@/layouts/auth/AuthSimpleLayout.vue';
|
|
// import AuthLayout from '@/layouts/auth/AuthCardLayout.vue';
|
|
import AuthLayout from '@/layouts/auth/AuthSplitLayout.vue';
|
|
import { onMounted } from 'vue';
|
|
import { usePage } from '@inertiajs/vue3'
|
|
import axios from 'axios';
|
|
|
|
defineProps<{
|
|
title?: string;
|
|
description?: string;
|
|
}>();
|
|
const cron = usePage().props.cron
|
|
|
|
|
|
onMounted(() => {
|
|
if (navigator.platform.toUpperCase().indexOf('MAC') >= 0) {
|
|
document.body.classList.add('is-mac')
|
|
}
|
|
|
|
if (cron) {
|
|
triggerWebcron()
|
|
}
|
|
})
|
|
|
|
const triggerWebcron = async function () {
|
|
await axios.get('/webcron')
|
|
.catch(function (response) {
|
|
if (response.status >= 400) {
|
|
console.error(response)
|
|
}
|
|
})
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<AuthLayout :title="title" :description="description">
|
|
<slot />
|
|
</AuthLayout>
|
|
</template>
|