Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dates and result displaying #487

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions rq_dashboard/templates/rq_dashboard/job.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,18 @@ <h2><strong>Job ID</strong>: {{ id }}</h2>
<p class="ellipsify"><strong>Description</strong>:<br><%= d.description %></p>
<p><strong>Origin queue</strong>:<br><%= d.origin %></p>
<p><strong>Status</strong>:<br><%= d.status %></p>
<% if (d.result) { %>
<p><strong>Result</strong>:<br><%= d.result %></p>
<% } %>
</span>

<span class="col-6">
<p><strong>Created at</strong>:<br> <%= d.created_at %></p>
<p><strong>Enqueued at</strong>:<br> <%= d.enqueued_at %></p>
<% if (d.exc_info) { %>
<p><strong>Ended at</strong>:<br> <%= d.ended_at %></p>
<% } %>
</span>

<% if (d.exc_info) { %>
<div class = "row col-12">
<pre class="exc_info col-12"><%= d.exc_info %></pre>
</div>
<% } %>
</script>
</div>

Expand Down
9 changes: 7 additions & 2 deletions rq_dashboard/templates/rq_dashboard/scripts/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,17 @@
$job_data.empty();

job.created_at = toRelative(Date.create(job.created_at)) + ' / ' + toShort(Date.create(job.created_at));
if (job.enqueued_at !== undefined) {
if (job.enqueued_at !== null) {
job.enqueued_at = toRelative(Date.create(job.enqueued_at)) + ' / ' + toShort(Date.create(job.enqueued_at));
} else {
job.enqueued_at = '-'
}
if (job.ended_at !== undefined) {
if (job.ended_at !== null) {
job.ended_at = toRelative(Date.create(job.ended_at)) + ' / ' + toShort(Date.create(job.ended_at));
} else {
job.ended_at = '-'
}

if (job.status === "failed") {
$("#requeue-job-btn").show()
}
Expand Down
2 changes: 1 addition & 1 deletion rq_dashboard/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ def job_info(instance_number, job_id):
ended_at=serialize_date(job.ended_at),
origin=job.origin,
status=job.get_status(),
result=job._result,
result=job.return_value(),
exc_info=str(job.exc_info) if job.exc_info else None,
description=job.description,
)
Expand Down
Loading