mirror of
https://github.com/ubicloud/ubicloud.git
synced 2025-10-04 13:52:06 +08:00
29 lines
1.5 KiB
Text
29 lines
1.5 KiB
Text
<% 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}
|
|
]
|
|
|
|
@option_tree, @option_parents = generate_postgres_options(flavor: @pg.flavor, location: @location)
|
|
|
|
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: path(@pg),
|
|
method: "PATCH",
|
|
form_elements:,
|
|
pre_selected_values:,
|
|
option_tree: @option_tree,
|
|
option_parents: @option_parents,
|
|
mode: "update"
|
|
}
|
|
) %>
|