@@ -1032,6 +1032,33 @@ <h4 class="text-xs font-semibold text-gray-700 uppercase tracking-wide mb-2">
10321032 < label class ="block text-sm font-medium text-gray-700 mb-1 "> Schedule (Cron)</ label >
10331033 < input type ="text " x-model ="backupForm.schedule_cron " placeholder ="0 2 * * * "
10341034 class ="w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:border-primary-500 ">
1035+ < div class ="mt-2 flex flex-wrap gap-2 ">
1036+ < button type ="button "
1037+ @click ="setBackupSchedulePreset('0 * * * *') "
1038+ :class ="isBackupSchedulePreset('0 * * * *') ? 'bg-primary-50 text-primary-700 border-primary-200' : 'bg-white text-gray-600 border-gray-200 hover:bg-gray-50' "
1039+ class ="px-2.5 py-1 text-xs border rounded-md transition-colors ">
1040+ Hourly
1041+ </ button >
1042+ < button type ="button "
1043+ @click ="setBackupSchedulePreset('0 */6 * * *') "
1044+ :class ="isBackupSchedulePreset('0 */6 * * *') ? 'bg-primary-50 text-primary-700 border-primary-200' : 'bg-white text-gray-600 border-gray-200 hover:bg-gray-50' "
1045+ class ="px-2.5 py-1 text-xs border rounded-md transition-colors ">
1046+ Every 6 Hours
1047+ </ button >
1048+ < button type ="button "
1049+ @click ="setBackupSchedulePreset('0 2 * * *') "
1050+ :class ="isBackupSchedulePreset('0 2 * * *') ? 'bg-primary-50 text-primary-700 border-primary-200' : 'bg-white text-gray-600 border-gray-200 hover:bg-gray-50' "
1051+ class ="px-2.5 py-1 text-xs border rounded-md transition-colors ">
1052+ Daily
1053+ </ button >
1054+ < button type ="button "
1055+ @click ="setBackupSchedulePreset('0 2 * * 0') "
1056+ :class ="isBackupSchedulePreset('0 2 * * 0') ? 'bg-primary-50 text-primary-700 border-primary-200' : 'bg-white text-gray-600 border-gray-200 hover:bg-gray-50' "
1057+ class ="px-2.5 py-1 text-xs border rounded-md transition-colors ">
1058+ Weekly
1059+ </ button >
1060+ </ div >
1061+ < p class ="mt-1 text-xs text-gray-400 "> Quick presets. You can still enter any custom cron expression.</ p >
10351062 </ div >
10361063 < div class ="flex items-end ">
10371064 < label class ="inline-flex items-center gap-2 text-sm text-gray-700 ">
@@ -2900,6 +2927,12 @@ <h3 class="text-xl font-semibold text-gray-800">Login as User</h3>
29002927 keep_monthly : Number . isFinite ( cfg . keep_monthly ) ? cfg . keep_monthly : 6
29012928 } ;
29022929 } ,
2930+ setBackupSchedulePreset ( expr ) {
2931+ this . backupForm . schedule_cron = ( expr || '' ) . trim ( ) ;
2932+ } ,
2933+ isBackupSchedulePreset ( expr ) {
2934+ return ( this . backupForm ?. schedule_cron || '' ) . trim ( ) === ( expr || '' ) . trim ( ) ;
2935+ } ,
29032936 async loadBackupRcloneStatus ( ) {
29042937 this . backupRcloneStatus = await this . api ( '/backups/rclone/status' ) ;
29052938 } ,
0 commit comments