Skip to content

Commit

Permalink
feat(job-details): add children counters
Browse files Browse the repository at this point in the history
  • Loading branch information
t-baezo committed Jun 10, 2021
1 parent 3a26602 commit 71bbb9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/server/views/dashboard/jobDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,15 @@ async function handler(req, res) {
if (queue.IS_BULLMQ) {
job.parent = JobHelpers.getKeyProperties(job.parentKey);
const {processed, unprocessed} = await job.getDependencies();
const count = await job.getDependenciesCount();
if (unprocessed && unprocessed.length) {
job.unprocessedChildren = unprocessed.map((child) => {
return JobHelpers.getKeyProperties(child);
});
}

job.countDependencies = count;

if (processed) {
const childrenKeys = Object.keys(processed);
job.processedChildren = childrenKeys.map((child) => {
Expand Down
4 changes: 2 additions & 2 deletions src/server/views/partials/dashboard/jobDetails.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
{{#if this.unprocessedChildren }}
<div class="row">
<div class="col-sm-12">
<h5>Unprocessed Children</h5>
<h5>Unprocessed Children <span class="count">{{ this.countDependencies.unprocessed}}</span></h5>

{{#each this.unprocessedChildren}}
<a href="{{ ../basePath }}/{{ encodeURI ../queueHost }}/{{ encodeURI this.queueName }}/{{ this.id }}">
Expand All @@ -157,7 +157,7 @@
{{#if this.processedChildren }}
<div class="row">
<div class="col-sm-12">
<h5>Processed Children</h5>
<h5>Processed Children <span class="count">{{ this.countDependencies.processed}}</span></h5>

{{#each this.processedChildren}}
<a href="{{ ../basePath }}/{{ encodeURI ../queueHost }}/{{ encodeURI this.queueName }}/{{ this.id }}">
Expand Down

0 comments on commit 71bbb9d

Please sign in to comment.