新增备份监控与定时配置
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user