views: Fix table showing client's partitions

Display partition table in Scopes -> Client Update, this is meaningful context
information
master
Javier Hernandez 2024-01-15 10:11:22 +01:00 committed by OpenGnSys Support Team
parent 409dbe3f5c
commit 19e0517511
1 changed files with 15 additions and 1 deletions

View File

@ -1004,10 +1004,24 @@ def action_client_update():
if db_client['repo_id'] == repo["id"]]
form.repo.choices.extend([(repo["id"], repo["name"]) for repo in repositories
if db_client['repo_id'] != repo["id"]])
ip = list(ips)[0]
setup = get_client_setup(ip)
if setup and setup[0].get('code') == 'MSDOS':
setup[0]['code'] = 'MBR'
for entry in setup:
if images and entry['image'] != 0:
image = next((img for img in images if img['id'] == entry['image']), None)
if image:
entry['image'] = image['name']
else:
entry['image'] = ""
else:
entry['image'] = ""
form.submit.render_kw = {"formaction": url_for('action_client_update')}
return render_template('actions/client_details.html', form=form,
parent="scopes.html", scopes=scopes)
parent="scopes.html", scopes=scopes, setup=setup)
def find_folder(folder_id, scopes):
scopes = deque([scopes['scope']])