diff --git a/app/components/machine/MachineProductsCard.vue b/app/components/machine/MachineProductsCard.vue
index 0b7f1c7..68c8575 100644
--- a/app/components/machine/MachineProductsCard.vue
+++ b/app/components/machine/MachineProductsCard.vue
@@ -24,24 +24,26 @@
-
{{ product.name }}
-
- {{ product.groupLabel }}
-
+
+
+ {{ product.groupLabel }}
+
+
+
Référence :
diff --git a/app/components/sites/SiteCard.vue b/app/components/sites/SiteCard.vue
index e98d0e5..534b3fe 100644
--- a/app/components/sites/SiteCard.vue
+++ b/app/components/sites/SiteCard.vue
@@ -1,11 +1,21 @@
-
+
-
+
{{ site.name }}
-
+
{{ machineCount }} machines
diff --git a/app/components/sites/SiteCreateModal.vue b/app/components/sites/SiteCreateModal.vue
index 8e7173b..09d1e7c 100644
--- a/app/components/sites/SiteCreateModal.vue
+++ b/app/components/sites/SiteCreateModal.vue
@@ -17,6 +17,46 @@
/>
+
+
@@ -39,6 +79,7 @@ import SiteContactFormFields from '~/components/sites/SiteContactFormFields.vue'
type SiteForm = {
name: string
+ color: string
contactName: string
contactPhone: string
contactAddress: string
diff --git a/app/components/sites/SiteEditModal.vue b/app/components/sites/SiteEditModal.vue
index bbffc8c..ee4a059 100644
--- a/app/components/sites/SiteEditModal.vue
+++ b/app/components/sites/SiteEditModal.vue
@@ -20,6 +20,46 @@
>
+
+
diff --git a/app/composables/useDarkMode.ts b/app/composables/useDarkMode.ts
new file mode 100644
index 0000000..a79d683
--- /dev/null
+++ b/app/composables/useDarkMode.ts
@@ -0,0 +1,26 @@
+const isDark = ref(false)
+
+export function useDarkMode() {
+ const toggle = () => {
+ isDark.value = !isDark.value
+ applyTheme()
+ }
+
+ const applyTheme = () => {
+ const theme = isDark.value ? 'mytheme-dark' : 'mytheme'
+ document.documentElement.setAttribute('data-theme', theme)
+ localStorage.setItem('theme', theme)
+ }
+
+ const init = () => {
+ const saved = localStorage.getItem('theme')
+ if (saved === 'mytheme-dark') {
+ isDark.value = true
+ } else if (!saved && window.matchMedia('(prefers-color-scheme: dark)').matches) {
+ isDark.value = true
+ }
+ applyTheme()
+ }
+
+ return { isDark, toggle, init }
+}
diff --git a/app/composables/useSiteManagement.ts b/app/composables/useSiteManagement.ts
index 80f0f80..2c4d705 100644
--- a/app/composables/useSiteManagement.ts
+++ b/app/composables/useSiteManagement.ts
@@ -10,6 +10,7 @@ import { canPreviewDocument } from '~/utils/documentPreview'
type SiteForm = {
name: string
+ color: string
contactName: string
contactPhone: string
contactAddress: string
@@ -31,6 +32,7 @@ type SiteDocument = {
type SiteWithDocuments = {
id: string
name?: string
+ color?: string
contactName?: string
contactPhone?: string
contactAddress?: string
@@ -54,6 +56,7 @@ export function useSiteManagement() {
const newSite = reactive
({
name: '',
+ color: '',
contactName: '',
contactPhone: '',
contactAddress: '',
@@ -63,6 +66,7 @@ export function useSiteManagement() {
const editSiteForm = reactive({
name: '',
+ color: '',
contactName: '',
contactPhone: '',
contactAddress: '',
@@ -81,6 +85,7 @@ export function useSiteManagement() {
const resetNewSite = () => {
newSite.name = ''
+ newSite.color = ''
newSite.contactName = ''
newSite.contactPhone = ''
newSite.contactAddress = ''
@@ -101,6 +106,7 @@ export function useSiteManagement() {
const handleCreateSite = async () => {
const result = await createSite({
name: newSite.name,
+ color: newSite.color,
contactName: newSite.contactName,
contactPhone: newSite.contactPhone,
contactAddress: newSite.contactAddress,
@@ -116,6 +122,7 @@ export function useSiteManagement() {
const editSite = (site: SiteWithDocuments) => {
siteBeingEdited.value = site
editSiteForm.name = site.name || ''
+ editSiteForm.color = site.color || ''
editSiteForm.contactName = site.contactName || ''
editSiteForm.contactPhone = site.contactPhone || ''
editSiteForm.contactAddress = site.contactAddress || ''
@@ -148,6 +155,7 @@ export function useSiteManagement() {
const baseUpdate = {
name: editSiteForm.name,
+ color: editSiteForm.color,
contactName: editSiteForm.contactName,
contactPhone: editSiteForm.contactPhone,
contactAddress: editSiteForm.contactAddress,
diff --git a/app/composables/useSites.ts b/app/composables/useSites.ts
index fa9a28c..cbe0dbc 100644
--- a/app/composables/useSites.ts
+++ b/app/composables/useSites.ts
@@ -6,6 +6,7 @@ import { extractCollection } from '~/shared/utils/apiHelpers'
export interface Site {
id: string
name?: string
+ color?: string
contactName?: string
contactPhone?: string
contactAddress?: string
diff --git a/app/pages/component-catalog.vue b/app/pages/component-catalog.vue
index 577c4ae..4920fd0 100644
--- a/app/pages/component-catalog.vue
+++ b/app/pages/component-catalog.vue
@@ -95,7 +95,7 @@
-
+
diff --git a/app/pages/constructeurs.vue b/app/pages/constructeurs.vue
index 282874b..eeef20f 100644
--- a/app/pages/constructeurs.vue
+++ b/app/pages/constructeurs.vue
@@ -49,11 +49,11 @@
-
+
-
diff --git a/app/pages/index.vue b/app/pages/index.vue
index 0701a13..7527fac 100644
--- a/app/pages/index.vue
+++ b/app/pages/index.vue
@@ -102,19 +102,26 @@
-
+
-
+
{{ site.name }}
@@ -134,7 +141,11 @@
-
+
{{ site.machines?.length || 0 }}
@@ -180,21 +191,21 @@
Modifier
Supprimer
Détails
diff --git a/app/pages/machine/[id].vue b/app/pages/machine/[id].vue
index 521e756..ae7db98 100644
--- a/app/pages/machine/[id].vue
+++ b/app/pages/machine/[id].vue
@@ -39,7 +39,11 @@
rounded
>
-
+
{{ d.machine.value.site?.name }}
diff --git a/app/pages/machines/index.vue b/app/pages/machines/index.vue
index 1afe900..9d03c57 100644
--- a/app/pages/machines/index.vue
+++ b/app/pages/machines/index.vue
@@ -65,7 +65,11 @@
@@ -77,8 +81,11 @@
-
- {{ machine.site?.name || 'Site inconnu' }}
+
+ {{ machine.site?.name || 'Site inconnu' }}
@@ -88,13 +95,13 @@
-
+
Modifier
-
+
Supprimer
-
+
Détails
diff --git a/app/pages/pieces-catalog.vue b/app/pages/pieces-catalog.vue
index a902990..e9ca1bf 100644
--- a/app/pages/pieces-catalog.vue
+++ b/app/pages/pieces-catalog.vue
@@ -118,7 +118,7 @@
-
+
diff --git a/app/pages/product-catalog.vue b/app/pages/product-catalog.vue
index d39650f..ebd98f1 100644
--- a/app/pages/product-catalog.vue
+++ b/app/pages/product-catalog.vue
@@ -115,7 +115,7 @@
-