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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user