mirror of https://git.48k.eu/ogcp
views: Make session form easier to understand
Show a more detailed description of each choice Display an error and redirect the user if an empty list of os's was received. Post does not work with an empty listmaster
parent
088316e006
commit
04fe9e8367
|
@ -838,9 +838,14 @@ def action_session():
|
|||
form.ips.data = ' '.join(ips)
|
||||
r = server.get('/session', payload={'client': list(ips)})
|
||||
sessions = r.json()['sessions']
|
||||
if not sessions:
|
||||
flash(_('ogServer returned an empty session list'),
|
||||
category='error')
|
||||
return redirect(url_for('commands'))
|
||||
|
||||
for os in sessions:
|
||||
choice = (f"{os['disk']} {os['partition']}",
|
||||
f"{os['name']} ({os['disk']},{os['partition']})")
|
||||
f"OS: {os['name']} (Disk:{os['disk']}, Partition:{os['partition']})")
|
||||
form.os.choices.append(choice)
|
||||
scopes, clients = get_scopes(set(ips))
|
||||
selected_clients = list(get_selected_clients(scopes['scope']).items())
|
||||
|
|
Loading…
Reference in New Issue