diff options
-rw-r--r-- | app/views/terraform_http_backend/show.html.erb | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/app/views/terraform_http_backend/show.html.erb b/app/views/terraform_http_backend/show.html.erb index e167541..9a99d52 100644 --- a/app/views/terraform_http_backend/show.html.erb +++ b/app/views/terraform_http_backend/show.html.erb @@ -26,6 +26,12 @@ License along with the GOV.UK Mini Environment Admin. If not, see View all terraform states </a> +<% historical_states = TerraformState + .where(state_id: @state.state_id) + .order(:id) + .to_a +%> + <div class="row"> <div class="col-md-8"> <h1> @@ -35,7 +41,14 @@ License along with the GOV.UK Mini Environment Admin. If not, see </span> </h1> - <br> + <a class="pull-right" + href="<%= terraform_http_backend_show_by_index_path( + @state.state_id, + historical_states.find_index { |x| x.id == @state.id } + ) + %>.json"> + View raw JSON + </a> <table class="table"> <tbody> <tr> @@ -48,16 +61,9 @@ License along with the GOV.UK Mini Environment Admin. If not, see </tr> </tbody> </table> - </div> <div class="col-md-4" style="max-height: 400px; overflow-y: auto;"> - <% historical_states = TerraformState - .where(state_id: @state.state_id) - .order(:id) - .to_a - %> - <h3>History (<%= pluralize(historical_states.count, 'states') %>)</h3> <table class="table"> |