diff options
author | Javier Hernandez <jhernandez@soleta.eu> | 2024-01-15 10:11:22 +0100 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2024-01-15 10:23:21 +0100 |
commit | 19e0517511c20ac04d335f1d544a6b3c06838edd (patch) | |
tree | e9048468f70aeac7eb4077cefe3fe29fc36bcf7d /ogcp | |
parent | 409dbe3f5cb711c8a542281236f0f5edd28fdd59 (diff) |
views: Fix table showing client's partitions
Display partition table in Scopes -> Client Update, this is meaningful context
information
Diffstat (limited to 'ogcp')
-rw-r--r-- | ogcp/views.py | 16 |
1 files changed, 15 insertions, 1 deletions
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']]) |