1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-10 12:16:49 +00:00
webvirtcloud/instances/templates/instances
catborise dba41f97f3 fix(instances): a refused VM create form comes back with what was entered
When the server refused a VM create submission (a field error, a busy
resource, a reused submission key, an existing VM name, a missing MAC
for a new disk), the page came back on its first tab with the flavor
dialog closed and every entered value gone: the hand-written fields
showed fixed defaults, and the errors sat in a block at the top of the
page, outside #messages and tied to no field.

The view builds one NewVMForm per create form on the page (custom,
template, one per flavor; create_forms), each with its own defaults; a
hidden form_id, which is also the prefix of the form's field ids, names
the submitted one, and it comes back bound. Every field renders from its
own form and is marked by two small template tags (form_fields:
error_attrs, field_error) when refused; a summary at the top of the
form lists all of its errors, also those of fields it keeps hidden. The
submitted tab or flavor dialog, marked data-form-id, reopens with any
"Advanced" section that holds an error; a reopened dialog shows the
messages too; the template form gets its pool, template and storage
back. base.html's error focus is a function that walks the places an
error can be, and a page can call it once it is set up, as the create
page does. form_id changes nothing in how a POST is processed; one of
an unknown form (a flavor deleted since) has its errors in the
messages. The default video now applies to every create form.

The custom form's disks and networks are not restored yet.
2026-10-20 08:12:25 +03:00
..
access_tab.html fix(instances): the VM page offers only the controls the user may use 2026-10-07 20:42:10 +03:00
destroy_instance_form.html fix(instances): a paused VM can be destroyed from its page 2026-10-08 08:50:21 +03:00
destroy_tab.html fix(instances): a paused VM can be destroyed from its page 2026-10-08 08:50:21 +03:00
edit_instance_volume.html logger updates (#31) 2023-08-09 09:20:18 +03:00
form_errors.html fix(instances): a refused VM create form comes back with what was entered 2026-10-20 08:12:25 +03:00
info_tab.html Bootstrap5 (#17) 2021-07-07 14:12:38 +03:00
power_tab.html fix(templates): icon-only buttons, selects and delete pages have accessible names 2026-10-19 16:15:06 +03:00
resize_tab.html fix(instances): a running VM's options and CPU edits keep the pending changes 2026-10-11 14:09:23 +03:00
settings_tab.html fix(templates): pages parse without markup errors, element IDs are unique 2026-10-19 07:49:25 +03:00
snapshots_tab.html fix(templates): pages parse without markup errors, element IDs are unique 2026-10-19 07:49:25 +03:00
stats_tab.html build: Chart.js 4.5.1 2026-10-17 13:19:43 +03:00