From 636e4520ac3ddfa756d66ba4894c36eda89fb0a7 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 23 Jun 2018 21:53:34 +0100 Subject: Redesign the backend show page actions and status reporting Use panels and list groups to better layout the actions and status. --- app/views/backends/terraform_aws/show.html.erb | 122 ++++++++++++--------- app/views/backends/terraform_libvirt/show.html.erb | 116 ++++++++++++-------- 2 files changed, 146 insertions(+), 92 deletions(-) (limited to 'app/views') diff --git a/app/views/backends/terraform_aws/show.html.erb b/app/views/backends/terraform_aws/show.html.erb index 98034f5..6a576ab 100644 --- a/app/views/backends/terraform_aws/show.html.erb +++ b/app/views/backends/terraform_aws/show.html.erb @@ -29,42 +29,89 @@ 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 %> +
+
+ Current Status
+ updated at <%= status[:updated_at] %> +
+
+ <% if status[:running] %> + + <% else %> + + <% end %> + +
+ + View Terraform state information + +
+
<%= form_with( url: perform_action_terraform_aws_backend_path(@backend), local: true, method: "post" ) do %> - <%= submit_tag("Refresh state", - role: 'button', - class: 'btn btn-lg btn-info') - %> + +
+
Actions
+ +
    +
  • + <%= submit_tag('Deploy', + role: 'button', + style: 'margin-bottom: 5px;', + class: 'btn btn-lg btn-success btn-block') + %> +

    + Run Terraform to deploy this backend, ensuring everything + is setup to create new mini environments. +

    +
  • +
  • + <%= submit_tag("Destroy", + role: 'button', + style: 'margin-bottom: 5px;', + class: 'btn btn-lg btn-danger btn-block') + %> +

    + Run Terraform to destroy this backend, note that this will + remove all cached data and disrupt all mini environments + using this backend. +

    +
  • +
  • + <%= submit_tag("Refresh state", + role: 'button', + style: 'margin-bottom: 5px;', + class: 'btn btn-lg btn-info btn-block') + %> +

    + Run Terraform to refresh the state information for this + backend. +

    +
  • +
+
<% end %>
-
+
<%= render( partial: 'shared/jobs', locals: { @@ -72,29 +119,6 @@ License along with the GOV.UK Mini Environment Admin. If not, see } ) %>
-
- - <% if status[:running] %> - - <% else %> - - <% end %> - -
- - View detailed Terraform state information - -
diff --git a/app/views/backends/terraform_libvirt/show.html.erb b/app/views/backends/terraform_libvirt/show.html.erb index f97b4e2..64a48fc 100644 --- a/app/views/backends/terraform_libvirt/show.html.erb +++ b/app/views/backends/terraform_libvirt/show.html.erb @@ -29,42 +29,88 @@ 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 %> +
+ +
+
+ Current Status
+ updated at <%= status[:updated_at] %> +
+
+ <% if status[:running] %> + + <% else %> + + <% end %> + +
+ + View Terraform state information + +
+
<%= 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 %> - - <%= form_with( - url: perform_action_terraform_libvirt_backend_path(@backend), - local: true, - method: "post" - ) do %> - <%= submit_tag("Refresh state", - role: 'button', - class: 'btn btn-lg btn-info') - %> +
+
Actions
+ +
    +
  • + <%= submit_tag('Deploy', + role: 'button', + style: 'margin-bottom: 5px;', + class: 'btn btn-lg btn-success btn-block') + %> +

    + Run Terraform to deploy this backend, ensuring everything + is setup to create new mini environments. +

    +
  • +
  • + <%= submit_tag("Destroy", + role: 'button', + style: 'margin-bottom: 5px;', + class: 'btn btn-lg btn-danger btn-block') + %> +

    + Run Terraform to destroy this backend, note that this + will disrupt all running mini environments using this + backend. +

    +
  • +
  • + <%= submit_tag("Refresh state", + role: 'button', + style: 'margin-bottom: 5px;', + class: 'btn btn-lg btn-info btn-block') + %> +

    + Run Terraform to refresh the state information for this + backend. +

    +
  • +
+
<% end %>
-
+
<%= render( partial: 'shared/jobs', locals: { @@ -72,22 +118,6 @@ License along with the GOV.UK Mini Environment Admin. If not, see } ) %>
-
- - <% if status[:running] %> - - <% else %> - - <% end %> -
-- cgit v1.2.3