Compare commits

..

No commits in common. "041232bcae39457239a4435d5f5bba30ce76e791" and "b6f9968a46e75d09f8024e4c128bce4221680b64" have entirely different histories.

10 changed files with 10 additions and 96 deletions

View File

@ -4,7 +4,6 @@ namespace App\Http\Controllers;
use App\Models\BookRecommendation; use App\Models\BookRecommendation;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
class BookRecommendationController extends Controller class BookRecommendationController extends Controller
@ -137,10 +136,4 @@ class BookRecommendationController extends Controller
$bookRecommendation->delete(); $bookRecommendation->delete();
return response()->json(null, 204); return response()->json(null, 204);
} }
public function fetchCover(Request $request)
{
Artisan::call('book:open-library-fetch-cover-art');
return response()->json(Artisan::output());
}
} }

View File

@ -1,6 +1,4 @@
// https://nuxt.com/docs/api/configuration/nuxt-config // https://nuxt.com/docs/api/configuration/nuxt-config
import pkg from './package.json'
export default defineNuxtConfig({ export default defineNuxtConfig({
srcDir: 'nuxt/', srcDir: 'nuxt/',
@ -78,8 +76,6 @@ export default defineNuxtConfig({
apiBase: process.env.API_URL, apiBase: process.env.API_URL,
apiPrefix: '/api/v1', apiPrefix: '/api/v1',
storageBase: `${process.env.API_URL}/storage/`, storageBase: `${process.env.API_URL}/storage/`,
packageVersion: pkg.version,
gitHash: process.env.GIT_HASH,
providers: { providers: {
google: { google: {
name: 'Google', name: 'Google',

View File

@ -2,12 +2,9 @@
</script> </script>
<template> <template>
<UMain>
<NuxtLayout> <NuxtLayout>
<NuxtPage /> <NuxtPage />
</NuxtLayout> </NuxtLayout>
</UMain>
<Footer />
<UNotifications /> <UNotifications />
</template> </template>

View File

@ -1,24 +0,0 @@
<script setup lang="ts">
const config = useRuntimeConfig()
</script>
<template>
<div>
<UDivider />
<UFooter c>
<template #left>
<div class="text-xs">
Copyright © {{ new Date().getFullYear() }}
</div>
</template>
<template #center>
Made with by <a class="text-primary hover:text-primary-600 ml-1" href="https://flycro.me" target="_blank">Flycro</a>
</template>
<template #right>
<div class="font-mono text-xs">
{{ config.public.packageVersion }} - {{ config.public.gitHash }}
</div>
</template>
</UFooter>
</div>
</template>

View File

@ -38,11 +38,6 @@ if (authStore.user?.roles.includes('admin')) {
to: '/admin/votes', to: '/admin/votes',
icon: 'i-heroicons-star', icon: 'i-heroicons-star',
}, },
{
label: 'Jobs',
to: '/admin/jobs',
icon: 'i-heroicons-briefcase',
},
], ],
}) })
} }

View File

@ -35,7 +35,7 @@ const gray = computed({
<UPopover mode="hover" :popper="{ strategy: 'absolute' }" :ui="{ width: 'w-[156px]' }"> <UPopover mode="hover" :popper="{ strategy: 'absolute' }" :ui="{ width: 'w-[156px]' }">
<template #default="{ open }"> <template #default="{ open }">
<UButton color="gray" variant="ghost" square :class="[open && 'bg-gray-50 dark:bg-gray-800']" aria-label="Color picker"> <UButton color="gray" variant="ghost" square :class="[open && 'bg-gray-50 dark:bg-gray-800']" aria-label="Color picker">
<UIcon name="i-heroicons-paint-brush-20-solid" class="text-primary-500 dark:text-primary-400 size-5" /> <UIcon name="i-heroicons-swatch-20-solid" class="text-primary-500 dark:text-primary-400 size-5" />
</UButton> </UButton>
</template> </template>

View File

@ -32,7 +32,7 @@ const { refresh: onVote, status } = useFetch<any>(`vote`, {
async onResponse({ response }) { async onResponse({ response }) {
if (response.ok) { if (response.ok) {
useToast().add({ useToast().add({
icon: 'i-heroicons-check-circle', icon: 'i-heroicons-check-circle-20-solid',
title: 'Abstimmung erfolgreich.', title: 'Abstimmung erfolgreich.',
color: 'emerald', color: 'emerald',
}) })
@ -45,12 +45,12 @@ const { refresh: onVote, status } = useFetch<any>(`vote`, {
</script> </script>
<template> <template>
<UButton v-if="props.row.status === 'PENDING'" class="transition-150 transform-gpu hover:scale-110" icon="i-heroicons-check-circle" size="sm" color="green" variant="solid" square :disabled="authStore.user.total_votes === 0" @click="isOpen = true" /> <UButton v-if="props.row.status === 'PENDING'" class="transition-150 transform-gpu hover:scale-110" icon="i-heroicons-star" size="sm" color="green" variant="solid" square :disabled="authStore.user.total_votes === 0" @click="isOpen = true" />
<UDashboardModal <UDashboardModal
v-model="isOpen" v-model="isOpen"
title="Für Buch abstimmen" title="Für Buch abstimmen"
:description="`Bist du dir sicher das du für die Buchempfehlung &quot;${row.book_name}&quot; abstimmen möchtest?`" :description="`Bist du dir sicher das du für die Buchempfehlung &quot;${row.book_name}&quot; abstimmen möchtest?`"
icon="i-heroicons-check-circle" icon="i-heroicons-star"
:ui="{ :ui="{
icon: { base: 'text-primary-500 dark:text-primary-400' } as any, icon: { base: 'text-primary-500 dark:text-primary-400' } as any,
footer: { base: 'ml-16' } as any, footer: { base: 'ml-16' } as any,

View File

@ -1,40 +0,0 @@
<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>

View File

@ -1,13 +1,12 @@
{ {
"name": "laravel-nuxt", "name": "laravel-nuxt",
"version": "0.0.4",
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {
"serve": "cross-env PORT=3000 HOST=127.0.0.1 node .output/server/index.mjs", "serve": "cross-env PORT=3000 HOST=127.0.0.1 node .output/server/index.mjs",
"build": "GIT_HASH=`git rev-parse --short HEAD` nuxi cleanup && nuxi build", "build": "nuxi cleanup && nuxi build",
"cleanup": "nuxi cleanup", "cleanup": "nuxi cleanup",
"dev": "GIT_HASH=`git rev-parse --short HEAD` nuxt dev --port=3000 --host=127.0.0.1", "dev": "nuxt dev --port=3000 --host=127.0.0.1",
"generate": "nuxt generate", "generate": "nuxt generate",
"preview": "nuxt preview", "preview": "nuxt preview",
"postinstall": "nuxt prepare", "postinstall": "nuxt prepare",

View File

@ -42,8 +42,6 @@ Route::prefix('api/v1')->group(function () {
Route::post('account/update', [AccountController::class, 'update'])->name('account.update'); Route::post('account/update', [AccountController::class, 'update'])->name('account.update');
Route::post('account/password', [AccountController::class, 'password'])->name('account.password'); Route::post('account/password', [AccountController::class, 'password'])->name('account.password');
Route::post('jobs/fetch-cover', [BookRecommendationController::class, 'fetchCover'])->name('jobs.fetch-cover');
Route::middleware(['throttle:uploads'])->group(function () { Route::middleware(['throttle:uploads'])->group(function () {
Route::post('upload', [UploadController::class, 'image'])->name('upload.image'); Route::post('upload', [UploadController::class, 'image'])->name('upload.image');
}); });