From 4c6b3b725275eaa8a87c22c56e0086722e7a7748 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 21 Jun 2018 23:09:19 +0100 Subject: Redesign the mini environment show page Start introducing some workflow, and simplifying the layout. Also improve the jobs partial, making it actually show when jobs are running. The next step is to run the build as a mini environment job, which should remove some unnecessary complexity. --- app/views/shared/_jobs.html.erb | 75 ++++++++++++++++++++++++++++------------- 1 file changed, 51 insertions(+), 24 deletions(-) (limited to 'app/views/shared') diff --git a/app/views/shared/_jobs.html.erb b/app/views/shared/_jobs.html.erb index 73d59ce..5b559c1 100644 --- a/app/views/shared/_jobs.html.erb +++ b/app/views/shared/_jobs.html.erb @@ -4,7 +4,10 @@ role="tablist" aria-multiselectable="true"> + <% job_states = Que.job_states %> + <% jobs.each do |job| %> + <% job_state = job_states.find { |x| x[:id] == job.id } %>
@@ -38,24 +51,38 @@ >
-
-
<%= job['last_error'] %>
-
-
- <%= form_with(url: retry_now_que_job_path(job.id)) do %> - <%= submit_tag( - 'Retry now', - class: 'btn btn-primary btn-lg btn-block' - ) %> - <% end %> - <%= form_with(url: cancel_que_job_path(job.id)) do %> - <%= submit_tag( - 'Cancel Job', - class: 'btn btn-warning btn-lg btn-block', - style: 'margin-top: 5px;' - ) %> - <% end %> -
+ <% if job_state %> +
+ Running now +
+
+ PID: <%= job_state[:ruby_pid] %> +
+ <% elsif job.finished_at %> +
+ Finished after <%= job['error_count'] %> errors. +
+ <% else %> +
+
<%= job.last_error_message %>
+
<%= job.last_error_backtrace %>
+
+
+ <%= form_with(url: retry_now_que_job_path(job.id)) do %> + <%= submit_tag( + 'Retry now', + class: 'btn btn-primary btn-lg btn-block' + ) %> + <% end %> + <%= form_with(url: cancel_que_job_path(job.id)) do %> + <%= submit_tag( + 'Cancel', + class: 'btn btn-warning btn-lg btn-block', + style: 'margin-top: 5px;' + ) %> + <% end %> +
+ <% end %>
-- cgit v1.2.3