diff --git a/app/composables/useApi.js b/app/composables/useApi.js index b5ec749..a40e315 100644 --- a/app/composables/useApi.js +++ b/app/composables/useApi.js @@ -3,7 +3,7 @@ import { useToast } from './useToast' export function useApi() { const { showSuccess, showError, showInfo } = useToast() const { public: publicConfig } = useRuntimeConfig() - const API_BASE_URL = publicConfig.apiBaseUrl || 'http://localhost:3000/api' + const API_BASE_URL = publicConfig.apiBaseUrl || 'http://localhost:3000' const parsedApiTimeout = Number(publicConfig.apiTimeout ?? 30000) const API_TIMEOUT = Number.isNaN(parsedApiTimeout) ? 30000 : parsedApiTimeout diff --git a/app/pages/machine/[id].vue b/app/pages/machine/[id].vue index b17138d..898bfec 100644 --- a/app/pages/machine/[id].vue +++ b/app/pages/machine/[id].vue @@ -13,64 +13,324 @@ @close="closePreview" /> - +

Détails de la machine

- - -
+
- - + +
+

Debug: Machine trouvée - {{ machine.name }}

+

Components count: {{ components.length }}

+

Pieces count: {{ pieces.length }}

+
+ + + +
+
{{ machine.typeMachine?.category || 'N/A' }}
+
{{ machine.site?.name }}
+
{{ machine.reference }}
+
+
+ + +
+
+

Informations de la machine

+
+
+ + +
+ {{ machineName }} +
+
+
+ + +
+ {{ machineReference || 'Non définie' }} +
+
+
+ + +
+ {{ machineEmplacement || 'Non défini' }} +
+
+
+ + +
+
+ {{ machineConstructeurDisplay?.name || 'Non défini' }} + + {{ [machineConstructeurDisplay?.email, machineConstructeurDisplay?.phone].filter(Boolean).join(' • ') || '' }} + +
+
+
+
+ + +
+

Champs personnalisés de la machine

+
+
+ + + + +
+
+
+
+
+ + +
+
+
+
+

Documents de la machine

+

Ajoutez ou consultez les documents liés à cette machine.

+
+ + {{ machineDocumentFiles.length }} fichier{{ machineDocumentFiles.length > 1 ? 's' : '' }} sélectionné{{ machineDocumentFiles.length > 1 ? 's' : '' }} + +
+ + + +
+
+
+ + +
+
{{ document.name }}
+
+ {{ document.mimeType || 'Inconnu' }} • {{ formatSize(document.size) }} +
+
+
+
+ + + +
+
+
+

Aucun document lié à cette machine.

+
+
+ + +
+
+
+

Composants

+ +
+ + +
@@ -142,8 +402,8 @@ import MachinePrintSelectionModal from '~/components/MachinePrintSelectionModal. import { buildMachinePrintContext, buildMachinePrintHtml } from '~/utils/printTemplates/machineReport' import IconLucideAlertTriangle from '~icons/lucide/alert-triangle' import IconLucideSquarePen from '~icons/lucide/square-pen' -import IconLucideCheck from '~icons/lucide/check' -import IconLucideChevronDown from '~icons/lucide/chevron-down' +import IconLucideEye from '~icons/lucide/eye' +import IconLucideChevronRight from '~icons/lucide/chevron-right' import IconLucidePrinter from '~icons/lucide/printer' const route = useRoute() diff --git a/env.example b/env.example index 3956c74..4166563 100644 --- a/env.example +++ b/env.example @@ -1,5 +1,5 @@ # Configuration de l'API backend -NUXT_PUBLIC_API_BASE_URL=http://localhost:3000/api +NUXT_PUBLIC_API_BASE_URL=http://localhost:3000 # Configuration du serveur de développement NUXT_PUBLIC_APP_URL=http://localhost:3001 @@ -21,4 +21,4 @@ NUXT_PUBLIC_LOG_LEVEL=debug # Configuration des timeouts NUXT_PUBLIC_API_TIMEOUT=30000 -NUXT_PUBLIC_REQUEST_TIMEOUT=10000 \ No newline at end of file +NUXT_PUBLIC_REQUEST_TIMEOUT=10000 diff --git a/nuxt.config.ts b/nuxt.config.ts index 2ae5f9f..0b7b8d5 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -19,7 +19,7 @@ export default defineNuxtConfig({ ], runtimeConfig: { public: { - apiBaseUrl: process.env.NUXT_PUBLIC_API_BASE_URL || 'http://localhost:3000/api', + apiBaseUrl: process.env.NUXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', appUrl: process.env.NUXT_PUBLIC_APP_URL || 'http://localhost:3001', appName: process.env.NUXT_PUBLIC_APP_NAME || 'Inventory Management System', apiTimeout: process.env.NUXT_PUBLIC_API_TIMEOUT || '30000',