新增备份监控与定时配置

This commit is contained in:
yml2213
2026-08-16 23:53:50 +08:00
parent 66cb03ebce
commit f67ee12d72
19 changed files with 612 additions and 3 deletions
+32
View File
@@ -0,0 +1,32 @@
import { apiClient } from '@/shared/api/client'
import type { ApiResponse } from '@/shared/types/types'
export interface BackupSchedule {
enabled: boolean
full_hour: number
full_minute: number
binlog_interval_minutes: number
}
export interface BackupStatus {
generated_at: string
health: 'healthy' | 'warning'
last_full: { local_complete: string; remote_complete: string }
last_binlog: { file: string; remote_dir: string }
last_job: { type: string; status: string; at: string; message: string }
}
export async function fetchBackupStatus() {
const { data } = await apiClient.get<ApiResponse<BackupStatus>>('/admin/backups/status')
return data.data
}
export async function fetchBackupSchedule() {
const { data } = await apiClient.get<ApiResponse<BackupSchedule>>('/admin/backups/schedule')
return data.data
}
export async function updateBackupSchedule(payload: BackupSchedule) {
const { data } = await apiClient.put<ApiResponse<BackupSchedule>>('/admin/backups/schedule', payload)
return data.data
}