feat: implement backup management features

- Added `createBackupAction`, `verifyDatabaseAction`, and `refreshBackupStatsAction` for handling backup operations.
- Introduced `getBackupStats` method in `BackupClient` to retrieve daily backup statistics.
- Updated API route to support fetching backup stats.
- Integrated backup stats into the `BackupSettingsPage` and visualized them with `BackupTimelineChart`.
- Enhanced `BackupSettingsPageClient` to manage backup stats and actions more effectively.
This commit is contained in:
Julien Froidefond
2025-09-25 22:28:17 +02:00
parent cd71824cc8
commit f2b18e4527
8 changed files with 471 additions and 67 deletions

View File

@@ -109,6 +109,24 @@ export class BackupClient {
const response = await httpClient.get<{ data: { logs: string[] } }>(`${this.baseUrl}?action=logs&maxLines=${maxLines}`);
return response.data.logs;
}
/**
* Récupère les statistiques de sauvegarde par jour
*/
async getBackupStats(days: number = 30): Promise<Array<{
date: string;
manual: number;
automatic: number;
total: number;
}>> {
const response = await httpClient.get<{ data: Array<{
date: string;
manual: number;
automatic: number;
total: number;
}> }>(`${this.baseUrl}?action=stats&days=${days}`);
return response.data;
}
}
export const backupClient = new BackupClient();