From bd40980c3b268d7e6cc46ff4ef7ea0f42fa18f3a Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 20 Jan 2022 13:49:00 -0500 Subject: [PATCH] Add a showAllRunning option for the admin jobs view --- client/src/components/admin/Jobs.vue | 81 ++++++++++++++++------------ 1 file changed, 48 insertions(+), 33 deletions(-) diff --git a/client/src/components/admin/Jobs.vue b/client/src/components/admin/Jobs.vue index 2ad2bf29190..da94688858a 100644 --- a/client/src/components/admin/Jobs.vue +++ b/client/src/components/admin/Jobs.vue @@ -20,12 +20,20 @@

Job Details

- + + + + {{ showAllRunning ? "Showing all currently running jobs" : "Time cutoff applied to query" }} + + @@ -35,8 +43,6 @@ - -

Unfinished Jobs

- There are no unfinished jobs to show with current cutoff time of {{ cutoffMin }} minutes. + There are no unfinished jobs. -

Finished Jobs

- - There are no recently finished jobs to show with current cutoff time of {{ cutoffMin }} minutes. - +
@@ -177,6 +187,7 @@ export default { loading: true, busy: true, cutoffMin: 5, + showAllRunning: false, }; }, watch: { @@ -211,10 +222,14 @@ export default { update() { this.busy = true; let params = []; - const cutoff = Math.floor(this.cutoffMin); - const dateRangeMin = new Date(Date.now() - cutoff * 60 * 1000).toISOString(); - params.push(`date_range_min=${dateRangeMin}`); params.push("view=admin_job_list"); + if (this.showAllRunning) { + params.push("state=running"); + } else { + const cutoff = Math.floor(this.cutoffMin); + const dateRangeMin = new Date(Date.now() - cutoff * 60 * 1000).toISOString(); + params.push(`date_range_min=${dateRangeMin}`); + } params = params.join("&"); axios .get(`${getAppRoot()}api/jobs?${params}`)