chore: update frontend configuration

This commit is contained in:
Matthieu
2025-09-26 11:29:47 +02:00
parent b7caa4f552
commit a78938a4d1
64 changed files with 5790 additions and 5129 deletions

View File

@@ -1,12 +1,12 @@
<template>
<main class="container mx-auto px-6 py-8">
<!-- Machine Types List -->
<div class="my-8">
<!-- Header with Add Button -->
<div class="flex justify-between items-center mb-6">
<h2 class="text-2xl font-bold text-gray-800">Squelettes de machine</h2>
<h2 class="text-2xl font-bold text-gray-800">
Squelettes de machine
</h2>
<NuxtLink to="/generator" class="btn btn-primary">
<IconLucidePlus
class="w-5 h-5 mr-2"
@@ -18,8 +18,8 @@
<!-- Categories Tabs -->
<div class="tabs tabs-boxed mb-6">
<a
v-for="category in categories"
<a
v-for="category in categories"
:key="category"
class="tab"
:class="{ 'tab-active': selectedCategory === category }"
@@ -31,17 +31,23 @@
<!-- Machine Types Grid -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<div
v-for="type in filteredTypes"
<div
v-for="type in filteredTypes"
:key="type.id"
class="card bg-base-100 shadow-lg hover:shadow-xl transition-all duration-300 cursor-pointer"
>
<div class="card-body">
<div class="flex items-center justify-between mb-4">
<h3 class="card-title text-lg">{{ type.name }}</h3>
<div class="badge badge-primary">{{ type.category }}</div>
<h3 class="card-title text-lg">
{{ type.name }}
</h3>
<div class="badge badge-primary">
{{ type.category }}
</div>
</div>
<p class="text-gray-600 mb-4">{{ type.description }}</p>
<p class="text-gray-600 mb-4">
{{ type.description }}
</p>
<div class="space-y-2 text-sm text-gray-500">
<div class="flex items-center gap-2">
<IconLucidePackage class="w-4 h-4" aria-hidden="true" />
@@ -56,8 +62,12 @@
<button class="btn btn-sm btn-error" @click.stop="confirmDeleteType(type)">
Supprimer
</button>
<NuxtLink :to="`/type/${type.id}`" class="btn btn-sm btn-outline">Voir détails</NuxtLink>
<button class="btn btn-sm btn-primary">Utiliser</button>
<NuxtLink :to="`/type/${type.id}`" class="btn btn-sm btn-outline">
Voir détails
</NuxtLink>
<button class="btn btn-sm btn-primary">
Utiliser
</button>
</div>
</div>
</div>
@@ -65,13 +75,17 @@
<!-- Empty State -->
<div v-if="filteredTypes.length === 0" class="text-center py-12">
<div class="avatar placeholder">
<div class="bg-neutral text-neutral-content rounded-full w-16">
<div class="avatar placeholder">
<div class="bg-neutral text-neutral-content rounded-full w-16">
<IconLucideLayoutGrid class="w-8 h-8" aria-hidden="true" />
</div>
</div>
<h3 class="text-lg font-semibold text-gray-600 mt-4">Aucun type trouvé</h3>
<p class="text-gray-500">Aucun type de machine ne correspond à cette catégorie.</p>
<h3 class="text-lg font-semibold text-gray-600 mt-4">
Aucun type trouvé
</h3>
<p class="text-gray-500">
Aucun type de machine ne correspond à cette catégorie.
</p>
</div>
</div>
</main>
@@ -90,7 +104,7 @@ const { machineTypes, loading, loadMachineTypes, deleteMachineType } = useMachin
const categories = ref([
'Toutes',
'Production',
'Transformation',
'Transformation',
'Manutention',
'Traitement',
'Contrôle'
@@ -107,7 +121,7 @@ const filteredTypes = computed(() => {
const confirmDeleteType = async (type) => {
const { showError, showSuccess } = useToast()
if (confirm(`Êtes-vous sûr de vouloir supprimer le type "${type.name}" ? Cette action est irréversible.`)) {
try {
const result = await deleteMachineType(type.id)
@@ -126,4 +140,4 @@ const confirmDeleteType = async (type) => {
onMounted(async () => {
await loadMachineTypes()
})
</script>
</script>