bookclub-manager/nuxt/pages/admin/jobs.vue

41 lines
906 B
Vue

<script setup lang="ts">
definePageMeta({ middleware: ['role-admin'] })
const serverLogs = ref<string>('')
async function runJobs(job: string) {
switch (job) {
case 'fetch_cover':
serverLogs.value = await $fetch('jobs/fetch-cover', { method: 'POST' })
break
}
}
</script>
<template>
<div class="flex gap-4">
<UCard class="w-1/2">
<template #header>
<h1 class="font-sans text-3xl font-bold">
Server Jobs
</h1>
<UButton class="mt-4" @click="runJobs('fetch_cover')">
Cover Bilder anfragen
</UButton>
</template>
</UCard>
<UCard class="w-1/2">
<template #header>
<h1 class="font-sans text-3xl font-bold">
Server Logs
</h1>
<UTextarea v-model="serverLogs" autoresize disabled class="mt-4" />
</template>
</UCard>
</div>
</template>
<style scoped>
</style>