From 19e0517511c20ac04d335f1d544a6b3c06838edd Mon Sep 17 00:00:00 2001 From: Javier Hernandez Date: Mon, 15 Jan 2024 10:11:22 +0100 Subject: views: Fix table showing client's partitions Display partition table in Scopes -> Client Update, this is meaningful context information --- ogcp/views.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ogcp/views.py b/ogcp/views.py index 59e086f..1004aec 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -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']]) -- cgit v1.2.3-18-g5258