diff options
-rw-r--r-- | ogcp/views.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/ogcp/views.py b/ogcp/views.py index 6a0d99c..41042a8 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -1757,11 +1757,21 @@ def action_mode(): if r.status_code != requests.codes.ok: return ogserver_error('commands') + mode_descriptions = { + 'pxe': 'ogLive (pxe)', + '11': 'Disk 1 Partition 1 (11)', + '19pxeADMIN': 'ogLive Debug (19pxeADMIN)', + '12': 'Disk 1 Partition 2 (12)', + '13': 'Disk 1 Partition 3 (13)', + 'memtest': 'Memory Test (memtest)', + } + most_used_mode = max(modes_set, key=lambda m: len(modes_set[m])) available_modes = [] if most_used_mode in r.json()['modes']: - available_modes.append((most_used_mode, most_used_mode)) - available_modes.extend([(mode, mode) for mode in r.json()['modes'] if mode != most_used_mode]) + most_used_t = (most_used_mode, mode_descriptions.get(most_used_mode, most_used_mode)) + available_modes.append(most_used_t) + available_modes.extend([(mode, mode_descriptions.get(mode, mode)) for mode in r.json()['modes'] if mode != most_used_mode]) if not available_modes: flash(_('no boot templates are available in the server'), category='error') |