mirror of
https://github.com/ubicloud/ubicloud.git
synced 2025-10-04 13:52:06 +08:00
It is redundant. role="form" should be set on non-form tags that operate as forms, and if a form tag is used that doesn't operate as a form, you could potentially use a different role, but the assumption is that a form tag has a form role, so there is no benefit to being explicit about it.
25 lines
1.1 KiB
Text
25 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", 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 %>
|