generated from Flycro/laravel-nuxt
feat: Added Jobs Admin Page
This commit is contained in:
@@ -38,6 +38,11 @@ if (authStore.user?.roles.includes('admin')) {
|
||||
to: '/admin/votes',
|
||||
icon: 'i-heroicons-star',
|
||||
},
|
||||
{
|
||||
label: 'Jobs',
|
||||
to: '/admin/jobs',
|
||||
icon: 'i-heroicons-briefcase',
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
|
||||
40
nuxt/pages/admin/jobs.vue
Normal file
40
nuxt/pages/admin/jobs.vue
Normal file
@@ -0,0 +1,40 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user