From 05df9f91e9bdf39b190710ef5d80162d03dd52c5 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 23 Jun 2018 11:16:26 +0100 Subject: Support managing the libvirt backend from the show page --- app/views/backends/terraform_libvirt/show.html.erb | 58 +++++++++++++++++++--- 1 file changed, 51 insertions(+), 7 deletions(-) (limited to 'app/views') diff --git a/app/views/backends/terraform_libvirt/show.html.erb b/app/views/backends/terraform_libvirt/show.html.erb index d7a1641..5b2213b 100644 --- a/app/views/backends/terraform_libvirt/show.html.erb +++ b/app/views/backends/terraform_libvirt/show.html.erb @@ -27,6 +27,57 @@ License along with the GOV.UK Mini Environment Admin. If not, see

Backend: <%= @backend.label %>

+<% status = @backend.status %> + +
+
+ <%= form_with(url: perform_action_terraform_libvirt_backend_path( + @backend + ), + local: true, + method: "post") do %> + <%= submit_tag('Deploy', + role: 'button', + class: 'btn btn-lg btn-success') + %> + <% end %> + + <%= form_with(url: perform_action_terraform_libvirt_backend_path( + @backend + ), + local: true, + method: "post") do %> + <%= submit_tag("Destroy", + role: 'button', + class: 'btn btn-lg btn-danger') + %> + <% end %> +
+
+ <%= render( + partial: 'shared/jobs', + locals: { + jobs: Backends::TerraformLibvirtJob.jobs(@backend.id).order(id: :desc) + } + ) %> +
+
+ + <% if status[:running] %> + + <% else %> + + <% end %> +
+
@@ -118,10 +169,3 @@ License along with the GOV.UK Mini Environment Admin. If not, see <% end %> - -

Jobs

- -<%= render( - partial: 'shared/jobs', - locals: { jobs: Backends::DeployTerraformLibvirtJob.jobs(@backend.id) } -) %> -- cgit v1.2.3