|
@@ -314,7 +314,10 @@ export class SchedulesPage {
|
|
|
<div class="mt-4 pt-4 border-t border-gray-200 dark:border-gray-600">
|
|
<div class="mt-4 pt-4 border-t border-gray-200 dark:border-gray-600">
|
|
|
<h5 class="text-sm font-medium text-gray-900 dark:text-white mb-2">Recent Schedules:</h5>
|
|
<h5 class="text-sm font-medium text-gray-900 dark:text-white mb-2">Recent Schedules:</h5>
|
|
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-2 text-xs">
|
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-2 text-xs">
|
|
|
- ${siteSchedules.slice(0, 3).map(schedule => `
|
|
|
|
|
|
|
+ ${[...siteSchedules]
|
|
|
|
|
+ .sort((a, b) => (b.next_run_at || '').localeCompare(a.next_run_at || ''))
|
|
|
|
|
+ .slice(0, 3)
|
|
|
|
|
+ .map(schedule => `
|
|
|
<div class="flex items-center justify-between p-2 bg-gray-50 dark:bg-gray-700 rounded">
|
|
<div class="flex items-center justify-between p-2 bg-gray-50 dark:bg-gray-700 rounded">
|
|
|
<span class="text-gray-700 dark:text-gray-300">
|
|
<span class="text-gray-700 dark:text-gray-300">
|
|
|
${this.calculateNextScheduleTime(schedule)}
|
|
${this.calculateNextScheduleTime(schedule)}
|
|
@@ -411,9 +414,10 @@ export class SchedulesPage {
|
|
|
? `Cron set to "${cron}"${next ? ` — next run ${new Date(next).toLocaleString()}` : ''}`
|
|
? `Cron set to "${cron}"${next ? ` — next run ${new Date(next).toLocaleString()}` : ''}`
|
|
|
: 'Cron cleared — using sitemap default'
|
|
: 'Cron cleared — using sitemap default'
|
|
|
);
|
|
);
|
|
|
- await this.loadScheduleDetails();
|
|
|
|
|
- this.renderStats();
|
|
|
|
|
- this.renderSchedulesList();
|
|
|
|
|
|
|
+ // Reload BOTH the site list (so scrape_cron in the input reflects
|
|
|
|
|
+ // the saved value) AND the per-site schedule rows (next_run_at).
|
|
|
|
|
+ // loadScheduleDetails alone leaves this.sites stale.
|
|
|
|
|
+ await this.loadSitesAndSchedules();
|
|
|
} else {
|
|
} else {
|
|
|
this.toastService.error('Update Failed', response.error || 'Failed to update cron');
|
|
this.toastService.error('Update Failed', response.error || 'Failed to update cron');
|
|
|
}
|
|
}
|