use PVE::VZDump;
use PVE::VZDump::Common;
use PVE::Jobs; # for VZDump Jobs
+use PVE::RS::CalendarEvent;
use base qw(PVE::RESTHandler);
foreach my $jobid (sort { $order->{$a} <=> $order->{$b} } keys %$jobs) {
my $job = $jobs->{$jobid};
next if $job->{type} ne 'vzdump';
+
+ if (my $schedule = $job->{schedule}) {
+ # vzdump jobs are cluster wide, there maybe was no local run
+ # so simply calculate from now
+ my $last_run = time();
+ my $calspec = PVE::RS::CalendarEvent->new($schedule);
+ my $next_run = $calspec->compute_next_event($last_run);
+ $job->{'next-run'} = $next_run if defined($next_run);
+ }
+
push @$res, $job;
}
sorter: (a, b) => (a.data.comment || '').localeCompare(b.data.comment || ''),
flex: 1,
},
+ {
+ text: gettext('Next Run'),
+ dataIndex: 'next-run',
+ width: 150,
+ renderer: function(value) {
+ if (!value) {
+ return '-';
+ }
+
+ let now = new Date(), next = new Date(value * 1000);
+ if (next < now) {
+ return gettext('pending');
+ }
+ return Proxmox.Utils.render_timestamp(value);
+ },
+ },
{
header: gettext('Retention'),
dataIndex: 'prune-backups',