mirror of https://git.48k.eu/ogcp
views: Preselect client's associated repo
Make the create-image menu preselect the repo of the selected clientmaster
parent
24aab951a8
commit
a9d367e795
|
@ -1233,9 +1233,14 @@ def action_image_create():
|
|||
f"| {PART_TYPE_CODES[part.get('code')]} "
|
||||
f"{FS_CODES[part.get('filesystem')]}")
|
||||
)
|
||||
r = server.get('/client/info', payload={'client': list(ips)})
|
||||
client_repo_id = r.json()['repo_id']
|
||||
repositories = get_repositories(server)
|
||||
form.repository.choices = [ (repo['id'], repo['name']) for repo in repositories
|
||||
if client_repo_id == repo['id']]
|
||||
for repo in repositories:
|
||||
form.repository.choices.append((repo['id'], repo['name']))
|
||||
if client_repo_id != repo['id']:
|
||||
form.repository.choices.append((repo['id'], repo['name']))
|
||||
|
||||
scopes, clients = get_scopes(set(ips))
|
||||
return render_template('actions/image_create.html', form=form,
|
||||
|
|
Loading…
Reference in New Issue