mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
feat(jobs): show current job frequency in edit modal (#3008)
* fix(jobs): reset job schedule edit modal values when closed * feat(jobs): show job's current frequency * fix(jobs): reset job schedule edit modal values when cancelled * chore: rebase * refactor(jobs): use reducer instead of several react states * fix(jobs): reset modal state when opening instead of closing the modal This prevents the modal state from glitching when saving/closing the modal * feat(jobs): parse job schedule cron string unavailable locale will fallback to english
This commit is contained in:

committed by
GitHub

parent
611ceeb5f4
commit
99fc9a2da0
@@ -433,6 +433,7 @@ settingsRoutes.get('/jobs', (_req, res) => {
|
||||
name: job.name,
|
||||
type: job.type,
|
||||
interval: job.interval,
|
||||
cronSchedule: job.cronSchedule,
|
||||
nextExecutionTime: job.job.nextInvocation(),
|
||||
running: job.running ? job.running() : false,
|
||||
}))
|
||||
@@ -453,6 +454,7 @@ settingsRoutes.post<{ jobId: string }>('/jobs/:jobId/run', (req, res, next) => {
|
||||
name: scheduledJob.name,
|
||||
type: scheduledJob.type,
|
||||
interval: scheduledJob.interval,
|
||||
cronSchedule: scheduledJob.cronSchedule,
|
||||
nextExecutionTime: scheduledJob.job.nextInvocation(),
|
||||
running: scheduledJob.running ? scheduledJob.running() : false,
|
||||
});
|
||||
@@ -478,6 +480,7 @@ settingsRoutes.post<{ jobId: string }>(
|
||||
name: scheduledJob.name,
|
||||
type: scheduledJob.type,
|
||||
interval: scheduledJob.interval,
|
||||
cronSchedule: scheduledJob.cronSchedule,
|
||||
nextExecutionTime: scheduledJob.job.nextInvocation(),
|
||||
running: scheduledJob.running ? scheduledJob.running() : false,
|
||||
});
|
||||
@@ -502,11 +505,14 @@ settingsRoutes.post<{ jobId: string }>(
|
||||
settings.jobs[scheduledJob.id].schedule = req.body.schedule;
|
||||
settings.save();
|
||||
|
||||
scheduledJob.cronSchedule = req.body.schedule;
|
||||
|
||||
return res.status(200).json({
|
||||
id: scheduledJob.id,
|
||||
name: scheduledJob.name,
|
||||
type: scheduledJob.type,
|
||||
interval: scheduledJob.interval,
|
||||
cronSchedule: scheduledJob.cronSchedule,
|
||||
nextExecutionTime: scheduledJob.job.nextInvocation(),
|
||||
running: scheduledJob.running ? scheduledJob.running() : false,
|
||||
});
|
||||
|
Reference in New Issue
Block a user