From 03b493293c316ae044c6cbb471f0048f0c1308e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?rogger=20andr=C3=A9=20valverde=20flores?= Date: Wed, 10 Mar 2021 16:54:27 -0500 Subject: [PATCH] feat(jobdetails): support executes at for bee queue --- src/server/views/dashboard/jobDetails.js | 1 + src/server/views/helpers/handlebars.js | 4 ++-- src/server/views/partials/dashboard/jobDetails.hbs | 7 ++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/server/views/dashboard/jobDetails.js b/src/server/views/dashboard/jobDetails.js index 0a493321..4658951d 100644 --- a/src/server/views/dashboard/jobDetails.js +++ b/src/server/views/dashboard/jobDetails.js @@ -25,6 +25,7 @@ async function handler(req, res) { return res.json(_.omit(job, 'domain', 'queue', '_events', '_eventsCount')); } + console.log(job); const jobState = queue.IS_BEE ? job.status : await job.getState(); job.showRetryButton = !queue.IS_BEE || jobState === 'failed'; job.retryButtonText = jobState === 'failed' ? 'Retry' : 'Trigger'; diff --git a/src/server/views/helpers/handlebars.js b/src/server/views/helpers/handlebars.js index e3278ca4..c8341540 100644 --- a/src/server/views/helpers/handlebars.js +++ b/src/server/views/helpers/handlebars.js @@ -61,8 +61,8 @@ const helpers = { return mapping; }, - getDelayDate(job) { - return job.timestamp ? job.timestamp : job.options.timestamp + job.delay; + getTimestamp(job) { + return job.timestamp ? job.timestamp : job.options.timestamp; }, encodeURI(url) { diff --git a/src/server/views/partials/dashboard/jobDetails.hbs b/src/server/views/partials/dashboard/jobDetails.hbs index 35d67f10..fb21e217 100644 --- a/src/server/views/partials/dashboard/jobDetails.hbs +++ b/src/server/views/partials/dashboard/jobDetails.hbs @@ -48,7 +48,12 @@ {{#if this.delay}}
Executes At
- {{moment (getDelayDate this) "llll"}} + {{moment (add this.delay (getTimestamp this) ) "llll"}} +
+ {{else if this.options.delay}} +
+
Executes At
+ {{moment (add this.options.delay (getTimestamp this) ) "llll"}}
{{/if}}