diff --git a/app/views/pg_hero/home/explain.html.erb b/app/views/pg_hero/home/explain.html.erb index 4b626b9a0..e8bc66058 100644 --- a/app/views/pg_hero/home/explain.html.erb +++ b/app/views/pg_hero/home/explain.html.erb @@ -5,8 +5,10 @@
<%= text_area_tag :query, @query, placeholder: "Enter a SQL query" %>

<%= submit_tag "Explain", class: "btn btn-info", style: "margin-right: 10px;" %> - <%= submit_tag "Analyze", class: "btn btn-danger", style: "margin-right: 10px;" %> - <%= submit_tag "Visualize", class: "btn btn-danger" %> + <% if PgHero.config["show_analyze_and_visualize"] %> + <%= submit_tag "Analyze", class: "btn btn-danger", style: "margin-right: 10px;" %> + <%= submit_tag "Visualize", class: "btn btn-danger" %> + <% end %>

<% end %> diff --git a/app/views/pg_hero/home/live_queries.html.erb b/app/views/pg_hero/home/live_queries.html.erb index ad3625ca3..6b87f825e 100644 --- a/app/views/pg_hero/home/live_queries.html.erb +++ b/app/views/pg_hero/home/live_queries.html.erb @@ -5,7 +5,9 @@ <%= render partial: "live_queries_table", locals: {queries: @running_queries, vacuum_progress: @vacuum_progress} %> -

<%= button_to "Kill all connections", kill_all_path, class: "btn btn-danger" %>

+ <% if PgHero.config["show_kill_all_connections"] %> +

<% button_to "Kill all connections", kill_all_path, class: "btn btn-danger" %>

+ <% end %>

You may need to restart your app servers afterwards.

diff --git a/lib/generators/pghero/templates/config.yml.tt b/lib/generators/pghero/templates/config.yml.tt index 1069e6e00..9dbf28c2b 100644 --- a/lib/generators/pghero/templates/config.yml.tt +++ b/lib/generators/pghero/templates/config.yml.tt @@ -44,3 +44,9 @@ databases: # Filter data from queries (experimental) # filter_data: true + +# Show Kill All Connections button on Live Queries tab +# show_kill_all_connections: true + +# On Explain tab, Show Analyze and Visualize options +# show_analyze_and_visualize: true