before gemiin

This commit is contained in:
2026-02-22 22:18:32 +01:00
parent fb33540bb0
commit 9db5cbf236
147 changed files with 7948 additions and 531 deletions

View File

@@ -3,4 +3,19 @@ export const settingsApi = {
get: () => client.get('/api/settings').then(r => r.data),
update: (settings) => client.put('/api/settings', settings).then(r => r.data),
getDebugSystemStats: () => client.get('/api/settings/debug/system').then(r => r.data),
downloadBackup: () => client.get('/api/settings/backup/download', { responseType: 'blob' }).then(r => {
let filename = 'jardin_backup.zip';
const contentDisposition = r.headers?.['content-disposition'];
if (typeof contentDisposition === 'string') {
const utf8Match = contentDisposition.match(/filename\*=UTF-8''([^;]+)/i);
const classicMatch = contentDisposition.match(/filename="?([^\";]+)"?/i);
if (utf8Match?.[1]) {
filename = decodeURIComponent(utf8Match[1]);
}
else if (classicMatch?.[1]) {
filename = classicMatch[1];
}
}
return { blob: r.data, filename };
}),
};

View File

@@ -30,4 +30,19 @@ export const settingsApi = {
client.put<{ ok: boolean }>('/api/settings', settings).then(r => r.data),
getDebugSystemStats: () =>
client.get<DebugSystemStats>('/api/settings/debug/system').then(r => r.data),
downloadBackup: () =>
client.get('/api/settings/backup/download', { responseType: 'blob' }).then(r => {
let filename = 'jardin_backup.zip'
const contentDisposition = r.headers?.['content-disposition']
if (typeof contentDisposition === 'string') {
const utf8Match = contentDisposition.match(/filename\*=UTF-8''([^;]+)/i)
const classicMatch = contentDisposition.match(/filename="?([^\";]+)"?/i)
if (utf8Match?.[1]) {
filename = decodeURIComponent(utf8Match[1])
} else if (classicMatch?.[1]) {
filename = classicMatch[1]
}
}
return { blob: r.data as Blob, filename }
}),
}

View File

@@ -5,6 +5,8 @@ export interface Task {
titre: string
description?: string
garden_id?: number
planting_id?: number
outil_id?: number
priorite: string
echeance?: string
recurrence?: string | null
@@ -14,7 +16,7 @@ export interface Task {
}
export const tasksApi = {
list: (params?: { statut?: string; garden_id?: number }) =>
list: (params?: { statut?: string; garden_id?: number; planting_id?: number }) =>
client.get<Task[]>('/api/tasks', { params }).then(r => r.data),
get: (id: number) => client.get<Task>(`/api/tasks/${id}`).then(r => r.data),
create: (t: Partial<Task>) => client.post<Task>('/api/tasks', t).then(r => r.data),

View File

@@ -7,6 +7,7 @@ export interface Tool {
categorie?: string
photo_url?: string
video_url?: string
notice_texte?: string
notice_fichier_url?: string
boutique_nom?: string
boutique_url?: string