From 7bc196dabd3186793880c6d833392e8d8da3d191 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 23 Jun 2018 11:40:52 +0100 Subject: Add support for managing Terraform AWS backends from the show page --- app/views/backends/terraform_aws/show.html.erb | 51 ++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'app/views/backends/terraform_aws/show.html.erb') diff --git a/app/views/backends/terraform_aws/show.html.erb b/app/views/backends/terraform_aws/show.html.erb index 3a1b329..eca5d3f 100644 --- a/app/views/backends/terraform_aws/show.html.erb +++ b/app/views/backends/terraform_aws/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_aws_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_aws_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::TerraformAwsJob.jobs(@backend.id).order(id: :desc) + } + ) %> +
+
+ + <% if status[:running] %> + + <% else %> + + <% end %> +
+
-- cgit v1.2.3