mirror of
https://github.com/ubicloud/ubicloud.git
synced 2025-10-07 15:21:58 +08:00
Currently, herb/formatter has at least 4 bugs the prevent us from switching to it (https://github.com/marcoroth/herb/issues 476, 477, 478, and 479). This includes manual fixes for each issue. herb/formatter also introduces a rubocop violation for the Layout/AssignmentIndentation cop. This disables that cop.
23 lines
1.1 KiB
Text
23 lines
1.1 KiB
Text
<% pg_config = @pg.user_config || {}
|
|
pgbouncer_config = @pg.pgbouncer_user_config || {}
|
|
|
|
errors = flash.now["errors"] || {}
|
|
old = request.POST || {}
|
|
|
|
unless old.empty?
|
|
pg_keys = old["pg_config_keys"] || []
|
|
pg_values = old["pg_config_values"] || []
|
|
pgbouncer_keys = old["pgbouncer_config_keys"] || []
|
|
pgbouncer_values = old["pgbouncer_config_values"] || []
|
|
|
|
pg_config = pg_keys.zip(pg_values).to_h
|
|
pgbouncer_config = pgbouncer_keys.zip(pgbouncer_values).to_h
|
|
end %>
|
|
|
|
<% form(action: "#{path(@pg)}/config", role: :form, method: :post, class: "min-w-2/3 pg-config") do %>
|
|
<%== part("components/config_card", title: "PostgreSQL Configuration", config: pg_config, extra_class: "pg-config-card", name: "pg_config", errors: errors) %>
|
|
<%== part("components/config_card", title: "PgBouncer Configuration", config: pgbouncer_config, extra_class: "pgbouncer-config-card", name: "pgbouncer_config", errors: errors) %>
|
|
<div class="flex justify-end">
|
|
<%== part("components/form/submit_button", text: "Save", extra_class: "save-config-btn") if @edit_perm %>
|
|
</div>
|
|
<% end %>
|