mirror of https://git.48k.eu/ogcp
views: fix partition scheme default values
Assign EMPTY when no scheme code is found. Select GPT by default when the partition scheme is EMPTY in partition and format view. Add missing EMPTY value to SetupForm.master v1.1.3-40
parent
b3b47ac0cb
commit
d9597e4e01
|
@ -73,7 +73,8 @@ class SetupForm(FlaskForm):
|
|||
ips = HiddenField()
|
||||
disk = SelectField(label='Disk', validate_choice=False)
|
||||
disk_type = SelectField(label=_l('Type'),
|
||||
choices=[('MSDOS', 'MBR'),
|
||||
choices=[('EMPTY', 'EMPTY'),
|
||||
('MSDOS', 'MBR'),
|
||||
('GPT', 'GPT')])
|
||||
partitions = FieldList(FormField(PartitionForm),
|
||||
min_entries=1,
|
||||
|
|
|
@ -183,7 +183,7 @@ def get_client_setup(ip):
|
|||
res = {}
|
||||
for partition in db_partitions:
|
||||
if partition['partition'] == 0:
|
||||
partition['code'] = PART_SCHEME_CODES.get(partition['code'], 'MSDOS')
|
||||
partition['code'] = PART_SCHEME_CODES.get(partition['code'], 'EMPTY')
|
||||
else:
|
||||
partition['code'] = PART_TYPE_CODES.get(partition['code'], 'EMPTY')
|
||||
|
||||
|
@ -794,8 +794,11 @@ def action_setup_show():
|
|||
|
||||
form.disk.choices = [(disk, disk) for disk in setup_data]
|
||||
form.disk.data = selected_disk
|
||||
# If partition table is empty, set MSDOS
|
||||
form.disk_type.data = setup_data[selected_disk][0]['code'] or 1
|
||||
|
||||
for disk in setup_data:
|
||||
if setup_data[disk][0]['code'] == 'EMPTY':
|
||||
setup_data[disk][0]['code'] = 'GPT'
|
||||
form.disk_type.data = setup_data[selected_disk][0]['code']
|
||||
|
||||
scopes, _clients = get_scopes(ips)
|
||||
return render_template('actions/setup.html',
|
||||
|
|
Loading…
Reference in New Issue