mirror of
https://github.com/shuaiplus/nodewarden.git
synced 2026-06-20 13:00:39 +00:00
feat: add backup start time configuration and theme switch functionality
- Introduced BACKUP_DEFAULT_START_TIME constant for backup scheduling. - Updated BackupScheduleConfig interface to include startTime. - Implemented normalizeStartTime function for validating and normalizing start time input. - Enhanced backup settings parsing to accommodate start time. - Added start time input field in BackupDestinationDetail component. - Created ThemeSwitch component for toggling between light and dark themes. - Integrated theme preference management in App component. - Updated styles for dark mode support across the application. - Added translations for theme toggle and backup start time labels.
This commit is contained in:
@@ -3,6 +3,7 @@ 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 const BACKUP_DEFAULT_START_TIME = '03:00';
|
||||
|
||||
export type BackupDestinationType = 'e3' | 'webdav';
|
||||
|
||||
@@ -40,6 +41,7 @@ export interface BackupRuntimeState {
|
||||
export interface BackupScheduleConfig {
|
||||
enabled: boolean;
|
||||
intervalHours: number;
|
||||
startTime: string;
|
||||
timezone: string;
|
||||
retentionCount: number | null;
|
||||
}
|
||||
@@ -82,6 +84,7 @@ export function createDefaultBackupScheduleConfig(timezone: string = BACKUP_DEFA
|
||||
return {
|
||||
enabled: false,
|
||||
intervalHours: BACKUP_DEFAULT_INTERVAL_HOURS,
|
||||
startTime: BACKUP_DEFAULT_START_TIME,
|
||||
timezone,
|
||||
retentionCount: BACKUP_DEFAULT_RETENTION_COUNT,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user