mirror of
https://github.com/shuaiplus/nodewarden.git
synced 2026-06-20 13:00:39 +00:00
feat: refactor backup scheduling to use interval hours and update UI components
This commit is contained in:
+3
-10
@@ -1,11 +1,10 @@
|
||||
export const BACKUP_DEFAULT_TIMEZONE = 'UTC';
|
||||
export const BACKUP_DEFAULT_SCHEDULE_TIME = '03:00';
|
||||
export const BACKUP_DEFAULT_RETENTION_COUNT = 30;
|
||||
export const BACKUP_DEFAULT_E3_REGION = 'auto';
|
||||
export const BACKUP_DEFAULT_REMOTE_PATH = 'nodewarden';
|
||||
export const BACKUP_DEFAULT_INTERVAL_HOURS = 24;
|
||||
|
||||
export type BackupDestinationType = 'e3' | 'webdav';
|
||||
export type BackupScheduleFrequency = 'daily' | 'weekly' | 'monthly';
|
||||
|
||||
export interface E3BackupDestination {
|
||||
endpoint: string;
|
||||
@@ -40,11 +39,8 @@ export interface BackupRuntimeState {
|
||||
|
||||
export interface BackupScheduleConfig {
|
||||
enabled: boolean;
|
||||
frequency: BackupScheduleFrequency;
|
||||
scheduleTime: string;
|
||||
intervalHours: number;
|
||||
timezone: string;
|
||||
dayOfWeek: number;
|
||||
dayOfMonth: number;
|
||||
retentionCount: number | null;
|
||||
}
|
||||
|
||||
@@ -85,11 +81,8 @@ export function createDefaultBackupRuntimeState(): BackupRuntimeState {
|
||||
export function createDefaultBackupScheduleConfig(timezone: string = BACKUP_DEFAULT_TIMEZONE): BackupScheduleConfig {
|
||||
return {
|
||||
enabled: false,
|
||||
frequency: 'daily',
|
||||
scheduleTime: BACKUP_DEFAULT_SCHEDULE_TIME,
|
||||
intervalHours: BACKUP_DEFAULT_INTERVAL_HOURS,
|
||||
timezone,
|
||||
dayOfWeek: 1,
|
||||
dayOfMonth: 1,
|
||||
retentionCount: BACKUP_DEFAULT_RETENTION_COUNT,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user