In various places, we were parsing the size to get family information. This is not necessary, as we can get the family information from the options hash. Also parsing by splitting the size string by dash character is not reliable, because the size string can be in different format in the future. For example, for AWS size string can be like `m6gd.large`.
28 lines
1.4 KiB
Plaintext
28 lines
1.4 KiB
Plaintext
<% form_elements = [
|
|
{name: "family", type: "radio_small_cards", label: "Server family", required: "required", content_generator: ContentGenerator::Postgres.method(:family)},
|
|
{name: "size", type: "radio_small_cards", label: "Server size", required: "required", content_generator: ContentGenerator::Postgres.method(:size)},
|
|
{name: "storage_size", type: "radio_small_cards", label: "Storage size", required: "required", content_generator: ContentGenerator::Postgres.method(:storage_size)},
|
|
{name: "failover_time_notice", type: "section", content: "If a maintenance window is configured, failover to the new server with the desired configuration will occur during the first available maintenance window after the new server is ready. Otherwise, failover will take place as soon as the new server becomes ready. Depending on the size of the data, it may take several hours for the new server to become ready.", separator: false}
|
|
]
|
|
|
|
pre_selected_values = {
|
|
"flavor" => @pg.flavor,
|
|
"location" => @location.ubid,
|
|
"family" => Option::POSTGRES_SIZE_OPTIONS[@pg.target_vm_size].family,
|
|
"size" => @pg.target_vm_size,
|
|
"storage_size" => @pg.target_storage_size_gib
|
|
} %>
|
|
|
|
<%== render(
|
|
"components/form/resource_creation_form",
|
|
locals: {
|
|
action: "#{@project_data[:path]}#{@pg.path}",
|
|
method: "PATCH",
|
|
form_elements:,
|
|
pre_selected_values:,
|
|
option_tree: @option_tree,
|
|
option_parents: @option_parents,
|
|
mode: "update"
|
|
}
|
|
) %>
|