diff options
author | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-08-29 11:55:52 +0200 |
---|---|---|
committer | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-09-02 15:05:45 +0200 |
commit | d00e437b8d76bc32732643a92f0ea32fbe0b7901 (patch) | |
tree | cf8998b06022b7ca8e29eedb74c0a32b1ecea6b5 /ogcp/forms/action_forms.py | |
parent | 78a26f947fba1af6b339567cb58e0f852d253137 (diff) |
ogcp: add support for multi-disk partition and format
Add support for selecting different disks in the disk inspector.
Add disk_inspector.html as a template to show the disk contents of
a client. The view can define the variable readonly_disk_inspector
to make the view non editable.
Use disk_inspector.html in the following views:
- client details
- partition and format
Update code to obtain the partitions of a client to better fit the
requirements of disk_inspector.html
Remove code to setup the SetupForm as the contents of the disks
are now dynamically loaded through javascript.
Diffstat (limited to 'ogcp/forms/action_forms.py')
-rw-r--r-- | ogcp/forms/action_forms.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ogcp/forms/action_forms.py b/ogcp/forms/action_forms.py index 5a2a4b1..b97ff4d 100644 --- a/ogcp/forms/action_forms.py +++ b/ogcp/forms/action_forms.py @@ -35,6 +35,7 @@ class PartitionForm(FlaskForm): render_kw={'readonly': True}, default=1) part_type = SelectField(label=_l('Type'), + validators=[InputRequired()], choices=[('LINUX', 'Linux'), ('NTFS', 'NTFS'), ('CACHE', 'CACHE'), @@ -52,6 +53,7 @@ class PartitionForm(FlaskForm): ('EMPTY', 'Empty')], default='EMPTY') fs = SelectField(label=_l('Filesystem'), + validators=[InputRequired()], choices=[('EXT4', 'EXT4'), ('NTFS', 'NTFS'), ('CACHE', 'CACHE'), @@ -59,23 +61,23 @@ class PartitionForm(FlaskForm): ('FAT32', 'FAT32'), ('EMPTY', 'Empty')], default='EMPTY') - size = IntegerField(label=_l('Size (KB)')) + size = IntegerField(label=_l('Size (KB)'), validators=[InputRequired()],) class SelectClientForm(FlaskForm): ips = HiddenField() selected_client = SelectField(label=_l('Select one client as reference to ' 'define the partition scheme')) - ok = SubmitField(label=_l('Submit')) + submit = SubmitField(label=_l('Select')) class SetupForm(FlaskForm): ips = HiddenField() - disk = HiddenField() + disk = SelectField(label='Disk', validate_choice=False) disk_type = SelectField(label=_l('Type'), choices=[('MSDOS', 'MBR'), ('GPT', 'GPT')]) partitions = FieldList(FormField(PartitionForm), min_entries=1, - max_entries=10) + max_entries=16) class HardwareForm(FlaskForm): ips = HiddenField() |