From afd83a42629ab865d1338c823dd04556c00e52cf Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 1 Jul 2018 09:10:48 +0100 Subject: Add a really basic que_jobs index page --- app/controllers/que_jobs_controller.rb | 4 ++++ app/views/que_jobs/index.html.erb | 7 +++++++ app/views/shared/_jobs.html.erb | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 app/views/que_jobs/index.html.erb (limited to 'app') diff --git a/app/controllers/que_jobs_controller.rb b/app/controllers/que_jobs_controller.rb index 36d5558..a4607d9 100644 --- a/app/controllers/que_jobs_controller.rb +++ b/app/controllers/que_jobs_controller.rb @@ -19,6 +19,10 @@ # . class QueJobsController < ApplicationController + def index + @jobs = QueJob.order(id: :desc) + end + def cancel Que.execute :expire_job, [job_id] diff --git a/app/views/que_jobs/index.html.erb b/app/views/que_jobs/index.html.erb new file mode 100644 index 0000000..0824ef9 --- /dev/null +++ b/app/views/que_jobs/index.html.erb @@ -0,0 +1,7 @@ + +<%= render( + partial: 'shared/jobs', + locals: { + jobs: @jobs + } +) %> diff --git a/app/views/shared/_jobs.html.erb b/app/views/shared/_jobs.html.erb index de6d7c1..951fa06 100644 --- a/app/views/shared/_jobs.html.erb +++ b/app/views/shared/_jobs.html.erb @@ -88,7 +88,7 @@ <% if job.args.last == 'build' %> <%# TODO: Generalise this somehow %>
- <% @mini_environment.backend_data.each do |(key, value)| %> + <% (@mini_environment.try(:backend_data) || []).each do |(key, value)| %>
<%= key %>
<%= value %>
<% end %> -- cgit v1.2.3