diff options
author | Christopher Baines <mail@cbaines.net> | 2018-06-23 11:40:52 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2018-06-23 21:16:39 +0100 |
commit | 7bc196dabd3186793880c6d833392e8d8da3d191 (patch) | |
tree | 027f3faffdfeda646cb4535b0df8c59e338c68a3 /app/views | |
parent | 76f7351c19777379d4d42a348a7f8da735a30649 (diff) | |
download | govuk-mini-environment-admin-7bc196dabd3186793880c6d833392e8d8da3d191.tar govuk-mini-environment-admin-7bc196dabd3186793880c6d833392e8d8da3d191.tar.gz |
Add support for managing Terraform AWS backends from the show page
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/backends/terraform_aws/show.html.erb | 51 |
1 files changed, 51 insertions, 0 deletions
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 </a> <h1>Backend: <%= @backend.label %></h1> +<% status = @backend.status %> + +<div class="row"> + <div class="col-md-2"> + <%= 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 %> + </div> + <div class="col-md-6"> + <%= render( + partial: 'shared/jobs', + locals: { + jobs: Backends::TerraformAwsJob.jobs(@backend.id).order(id: :desc) + } + ) %> + </div> + <div class="col-md-4"> + + <% if status[:running] %> + <div class="alert alert-success text-center" + role="alert" + style="margin-bottom: 0px;"> + Backend available + </div> + <% else %> + <div class="alert alert-warning text-center" + role="alert" + style="margin-bottom: 0px;"> + Backend down + </div> + <% end %> + </div> +</div> <div class="row"> <div class="col-md-8"> |